aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-09-05 23:42:16 -0400
committerRalph Amissah <ralph@amissah.com>2013-09-05 23:42:20 -0400
commit55617009d55521dc4c9bf3e998dc8354a74fb8e1 (patch)
tree6f4ab0343b3c50deb21c3630ed1a78039b6c2571
parentv4: dal, grouped text with fontface spanning newlines, partial solution (diff)
v4 v5: dal, book index markup, round delimiters: allow spaces or space & newline
* allow spaces on both sides of delimiters, or a space before & newline following a delimiter \s+[:|;](\s+|\n) [else parses as before no spaces]
-rw-r--r--data/doc/sisu/CHANGELOG_v44
-rw-r--r--data/doc/sisu/CHANGELOG_v54
-rw-r--r--lib/sisu/v4/dal_doc_str.rb3
-rw-r--r--lib/sisu/v5/dal_doc_str.rb3
4 files changed, 14 insertions, 0 deletions
diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4
index f41bafaa..d7e1b7ea 100644
--- a/data/doc/sisu/CHANGELOG_v4
+++ b/data/doc/sisu/CHANGELOG_v4
@@ -33,6 +33,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.2.2.orig.tar.xz
* dal, grouped text with fontface spanning newlines, partial solution, merge
from 5.0.14
+* dal, book index markup, allow spaces on both sides of delimiters, or a space
+ before and newline following a delimiter \s+[:|;](\s+|\n)
+ [else parses as before no spaces]
+
%% 4.2.1.orig.tar.xz (2013-08-28:34/3)
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.2.1
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.2.1-1
diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5
index ab3e139e..54b251a7 100644
--- a/data/doc/sisu/CHANGELOG_v5
+++ b/data/doc/sisu/CHANGELOG_v5
@@ -30,6 +30,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.0.15.orig.tar.xz
sisu_5.0.15.orig.tar.xz
sisu_5.0.15-1.dsc
+* dal, book index markup, allow spaces on both sides of delimiters, or a space
+ before and newline following a delimiter \s+[:|;](\s+|\n)
+ [else parses as before no spaces]
+
%% 5.0.14.orig.tar.xz (2013-08-28:34/3)
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.0.14
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.0.14-1
diff --git a/lib/sisu/v4/dal_doc_str.rb b/lib/sisu/v4/dal_doc_str.rb
index e7d9917b..2a3e6b83 100644
--- a/lib/sisu/v4/dal_doc_str.rb
+++ b/lib/sisu/v4/dal_doc_str.rb
@@ -203,6 +203,9 @@ module SiSU_DAL_DocumentStructureExtract
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(' ').
+ gsub(/\s+([|:;])\s+/,'\1').
+ gsub(/\s+([+])\s+/,'\1')
t_o=t_o.gsub(/\n=\{.+\}\s*$\Z/m,'')
m
else nil
diff --git a/lib/sisu/v5/dal_doc_str.rb b/lib/sisu/v5/dal_doc_str.rb
index 612d2905..83493c48 100644
--- a/lib/sisu/v5/dal_doc_str.rb
+++ b/lib/sisu/v5/dal_doc_str.rb
@@ -203,6 +203,9 @@ module SiSU_DAL_DocumentStructureExtract
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(' ').
+ gsub(/\s+([|:;])\s+/,'\1').
+ gsub(/\s+([+])\s+/,'\1')
t_o=t_o.gsub(/\n=\{.+\}\s*$\Z/m,'')
m
else nil