diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-07-01 00:49:09 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-07-01 00:49:50 -0400 |
commit | 60411adb8256b06545ea6db3cd2b4d2e7f58d03a (patch) | |
tree | 2bd80d57cec276a497473cf52780f62aae7da028 /lib/sisu/v6/ao_misc_arrange.rb | |
parent | v5 v6: ao, (param), book index, strip white spaces around terms (diff) |
v5 v6: ao, quote block, insert text indent markup (book index markup unchanged)
Diffstat (limited to 'lib/sisu/v6/ao_misc_arrange.rb')
-rw-r--r-- | lib/sisu/v6/ao_misc_arrange.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sisu/v6/ao_misc_arrange.rb b/lib/sisu/v6/ao_misc_arrange.rb index 387c14ca..8adebfd5 100644 --- a/lib/sisu/v6/ao_misc_arrange.rb +++ b/lib/sisu/v6/ao_misc_arrange.rb @@ -66,7 +66,7 @@ module SiSU_AO_MiscArrangeText @md,@data=md,data end def conditional_headings(para) - para=para.gsub(/^(:?A~)\s*$/,'\1~ @title @author'). #conditional header + para=para.gsub(/^(:?A~)\s*$/,'\1~ @title @author'). #conditional header gsub(/^((?:[1-9]|:?[A-D])~\S*)\s*$/, '\1~ [Note: heading marker::required title missing]~#') #conditional header for incorporated document 2004w12 if para =~/^@\S+?:/ @@ -130,7 +130,12 @@ module SiSU_AO_MiscArrangeText para << '`:quote_open`' text=text.gsub(/```[ ]+quote/m,'') end - text=text.gsub(/(?:\n|\A)([^`=\n]+)/m,'_1 \1') #not a perfect match for book index \n={ + text=if text =~/(?:\n|\A)=\{.+?\}/m #exclude book index from indent markup + txt,bkidx,tail=/(.+?)((?:\n|\A)=\{.+?\}$)(.*)/m.match(text).captures + txt=txt.gsub(/(?:\n|\A)([^`\n]+)/m,'_1 \1') + txt + bkidx + tail + else text.gsub(/(?:\n|\A)([^`\n]+)/m,'_1 \1') + end para << text.gsub(/```/m,'') if text =~/```/m @flag=:quote_close |