From 60411adb8256b06545ea6db3cd2b4d2e7f58d03a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 1 Jul 2014 00:49:09 -0400 Subject: v5 v6: ao, quote block, insert text indent markup (book index markup unchanged) --- data/doc/sisu/CHANGELOG_v5 | 1 + data/doc/sisu/CHANGELOG_v6 | 1 + lib/sisu/v5/ao_misc_arrange.rb | 9 +++++++-- lib/sisu/v6/ao_misc_arrange.rb | 9 +++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 7acd5140..6605fc8e 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -42,6 +42,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.4.3.orig.tar.xz * code cosmetic rearrangement * book index, strip white spaces around terms (fix uppercase first character where spaces used) + * quote block, insert text indent markup, exclude book index * code cosmetic rearrangement * ao*, param, hub, options, composite diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index beada6ad..266f1219 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -32,6 +32,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.9.orig.tar.xz * code cosmetic rearrangement * book index, strip white spaces around terms (fix uppercase first character where spaces used) + * quote block, insert text indent markup, exclude book index * code cosmetic rearrangement * ao*, param, hub, options, composite diff --git a/lib/sisu/v5/ao_misc_arrange.rb b/lib/sisu/v5/ao_misc_arrange.rb index a053f37e..09842fcc 100644 --- a/lib/sisu/v5/ao_misc_arrange.rb +++ b/lib/sisu/v5/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 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 -- cgit v1.2.3