aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v5/ao_doc_str.rb7
-rw-r--r--lib/sisu/v5/param.rb2
-rw-r--r--lib/sisu/v6/ao_doc_str.rb7
-rw-r--r--lib/sisu/v6/param.rb2
4 files changed, 10 insertions, 8 deletions
diff --git a/lib/sisu/v5/ao_doc_str.rb b/lib/sisu/v5/ao_doc_str.rb
index 9743f794..c3b65ee1 100644
--- a/lib/sisu/v5/ao_doc_str.rb
+++ b/lib/sisu/v5/ao_doc_str.rb
@@ -200,6 +200,7 @@ module SiSU_AO_DocumentStructureExtract
idx_array_raw=idxraw.scan(/[^;]+/)
idx_hash,idx_array,idx_lst={},[],[]
idx_array_raw.each do |idx|
+ idx=idx.strip
idx_lst=case idx
when /\S+?\s*:/
idx_couplet_tmp=[]
@@ -308,11 +309,11 @@ module SiSU_AO_DocumentStructureExtract
and @@flag[:box]==:off \
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(' ').
+ idx=if t_o=~/^=\{\s*(.+)\s*\}\s*$\Z/m; m=$1
+ m=m.split(/[ ]*\n/).join(' ').
gsub(/\s+([|:;])\s+/,'\1').
gsub(/\s+([+]\d+)\s+/,'\1')
- t_o=t_o.gsub(/\n=\{.+\}\s*$\Z/m,'')
+ t_o=t_o.gsub(/\n=\{.+?\}\s*$/m,'')
idx_array_and_hash=construct_idx_array_and_hash(m)
idx_array_and_hash[:hash]
else nil
diff --git a/lib/sisu/v5/param.rb b/lib/sisu/v5/param.rb
index d20a0129..b2e50d41 100644
--- a/lib/sisu/v5/param.rb
+++ b/lib/sisu/v5/param.rb
@@ -1167,7 +1167,7 @@ module SiSU_Param
).txt_grey if @opt.act[:verbose][:set]==:on
end
if not @book_idx \
- and para =~/^=\{(.+?)\}\s*$/
+ and para =~/^=\{(.+?)\}[\s`]*\Z/m
@book_idx=true
end
unless @code_flag
diff --git a/lib/sisu/v6/ao_doc_str.rb b/lib/sisu/v6/ao_doc_str.rb
index 675bfc90..001b2aef 100644
--- a/lib/sisu/v6/ao_doc_str.rb
+++ b/lib/sisu/v6/ao_doc_str.rb
@@ -200,6 +200,7 @@ module SiSU_AO_DocumentStructureExtract
idx_array_raw=idxraw.scan(/[^;]+/)
idx_hash,idx_array,idx_lst={},[],[]
idx_array_raw.each do |idx|
+ idx=idx.strip
idx_lst=case idx
when /\S+?\s*:/
idx_couplet_tmp=[]
@@ -308,11 +309,11 @@ module SiSU_AO_DocumentStructureExtract
and @@flag[:box]==:off \
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(' ').
+ idx=if t_o=~/^=\{\s*(.+)\s*\}\s*$\Z/m; m=$1
+ m=m.split(/[ ]*\n/).join(' ').
gsub(/\s+([|:;])\s+/,'\1').
gsub(/\s+([+]\d+)\s+/,'\1')
- t_o=t_o.gsub(/\n=\{.+\}\s*$\Z/m,'')
+ t_o=t_o.gsub(/\n=\{.+?\}\s*$/m,'')
idx_array_and_hash=construct_idx_array_and_hash(m)
idx_array_and_hash[:hash]
else nil
diff --git a/lib/sisu/v6/param.rb b/lib/sisu/v6/param.rb
index 1e7ea9de..bacee802 100644
--- a/lib/sisu/v6/param.rb
+++ b/lib/sisu/v6/param.rb
@@ -1167,7 +1167,7 @@ module SiSU_Param
).txt_grey if @opt.act[:verbose][:set]==:on
end
if not @book_idx \
- and para =~/^=\{(.+?)\}\s*$/
+ and para =~/^=\{(.+?)\}[\s`]*\Z/m
@book_idx=true
end
unless @code_flag