aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/ao_doc_str.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-07-01 00:47:13 -0400
committerRalph Amissah <ralph@amissah.com>2014-07-01 00:47:23 -0400
commit844f9270e3190ec55666d787cfc8c482997cfc06 (patch)
treef1d772765da121d0827156590c269f9d1f637a15 /lib/sisu/v5/ao_doc_str.rb
parentv5 v6: ao, code cosmetic rearrangement (diff)
v5 v6: ao, (param), book index, strip white spaces around terms
* fix uppercase first character where spaces used
Diffstat (limited to 'lib/sisu/v5/ao_doc_str.rb')
-rw-r--r--lib/sisu/v5/ao_doc_str.rb7
1 files changed, 4 insertions, 3 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