aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/ao_misc_arrange.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v5/ao_misc_arrange.rb')
-rw-r--r--lib/sisu/v5/ao_misc_arrange.rb9
1 files changed, 7 insertions, 2 deletions
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