From 55617009d55521dc4c9bf3e998dc8354a74fb8e1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 5 Sep 2013 23:42:16 -0400 Subject: 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] --- data/doc/sisu/CHANGELOG_v4 | 4 ++++ data/doc/sisu/CHANGELOG_v5 | 4 ++++ lib/sisu/v4/dal_doc_str.rb | 3 +++ lib/sisu/v5/dal_doc_str.rb | 3 +++ 4 files changed, 14 insertions(+) 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 -- cgit v1.2.3