aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-09-05 23:42:16 -0400
committerRalph Amissah <ralph@amissah.com>2013-09-05 23:42:20 -0400
commit55617009d55521dc4c9bf3e998dc8354a74fb8e1 (patch)
tree6f4ab0343b3c50deb21c3630ed1a78039b6c2571 /lib
parentv4: dal, grouped text with fontface spanning newlines, partial solution (diff)
v4 v5: dal, book index markup, round delimiters: allow spaces or space & newline
* allow spaces on both sides of delimiters, or a space before & newline following a delimiter \s+[:|;](\s+|\n) [else parses as before no spaces]
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v4/dal_doc_str.rb3
-rw-r--r--lib/sisu/v5/dal_doc_str.rb3
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/sisu/v4/dal_doc_str.rb b/lib/sisu/v4/dal_doc_str.rb
index e7d9917b..2a3e6b83 100644
--- a/lib/sisu/v4/dal_doc_str.rb
+++ b/lib/sisu/v4/dal_doc_str.rb
@@ -203,6 +203,9 @@ module SiSU_DAL_DocumentStructureExtract
and @@flag[:table]==:off
unless t_o =~/^(?:@\S+?:|%+)\s/ # extract book index for paragraph if any
idx=if t_o=~/^=\{(.+)\}\s*$\Z/m; m=$1
+ m=m.split(/\n/).join(' ').
+ gsub(/\s+([|:;])\s+/,'\1').
+ gsub(/\s+([+])\s+/,'\1')
t_o=t_o.gsub(/\n=\{.+\}\s*$\Z/m,'')
m
else nil
diff --git a/lib/sisu/v5/dal_doc_str.rb b/lib/sisu/v5/dal_doc_str.rb
index 612d2905..83493c48 100644
--- a/lib/sisu/v5/dal_doc_str.rb
+++ b/lib/sisu/v5/dal_doc_str.rb
@@ -203,6 +203,9 @@ module SiSU_DAL_DocumentStructureExtract
and @@flag[:table]==:off
unless t_o =~/^(?:@\S+?:|%+)\s/ # extract book index for paragraph if any
idx=if t_o=~/^=\{(.+)\}\s*$\Z/m; m=$1
+ m=m.split(/\n/).join(' ').
+ gsub(/\s+([|:;])\s+/,'\1').
+ gsub(/\s+([+])\s+/,'\1')
t_o=t_o.gsub(/\n=\{.+\}\s*$\Z/m,'')
m
else nil