aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-07-01 00:49:09 -0400
committerRalph Amissah <ralph@amissah.com>2014-07-01 00:49:50 -0400
commit60411adb8256b06545ea6db3cd2b4d2e7f58d03a (patch)
tree2bd80d57cec276a497473cf52780f62aae7da028
parentv5 v6: ao, (param), book index, strip white spaces around terms (diff)
v5 v6: ao, quote block, insert text indent markup (book index markup unchanged)
-rw-r--r--data/doc/sisu/CHANGELOG_v51
-rw-r--r--data/doc/sisu/CHANGELOG_v61
-rw-r--r--lib/sisu/v5/ao_misc_arrange.rb9
-rw-r--r--lib/sisu/v6/ao_misc_arrange.rb9
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