From d1c4bb34715672c50a646b11007191ef91fcc287 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Jul 2014 00:03:26 -0400 Subject: v5 v6: ao_numbering, auto name segment, extract "number" from heading, fix --- data/doc/sisu/CHANGELOG_v5 | 3 +++ data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v5/ao_numbering.rb | 4 ++-- lib/sisu/v6/ao_numbering.rb | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 8363130b..7eed7c3d 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.5.0.orig.tar.xz sisu_5.5.0.orig.tar.xz sisu_5.5.0-1.dsc +* ao_numbering, + * auto name segment, extract "number" from heading, fix + %% 5.4.5.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.4.5 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.4.5-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 00ff460b..98358c7e 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.1.0.orig.tar.xz sisu_6.1.0.orig.tar.xz sisu_6.1.0-1.dsc +* ao_numbering, + * auto name segment, extract "number" from heading, fix + %% 6.0.11.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.0.11 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.0.11-1 diff --git a/lib/sisu/v5/ao_numbering.rb b/lib/sisu/v5/ao_numbering.rb index 278ea514..d213ca4d 100644 --- a/lib/sisu/v5/ao_numbering.rb +++ b/lib/sisu/v5/ao_numbering.rb @@ -326,7 +326,7 @@ module SiSU_AO_Numbering if possible_seg_name =~/^[0-9]+$/m \ and possible_seg_name.to_i <= heading_num_is.to_i prefix + leading_zeros_fixed_width_number(possible_seg_name) - elsif possible_seg_name =~/^[\d.,:-]+$/m + elsif possible_seg_name =~/^[0-9][\d.,:-]*$/m possible_seg_name=possible_seg_name. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') @@ -369,7 +369,7 @@ module SiSU_AO_Numbering @md.set_heading_seg=true end if dob.name !~/^\S+/ \ - and dob.obj =~/^\s*(?:\S+\s+)?([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name + and dob.obj =~/^\s*(?:\S+\s+)?([0-9][0-9.,:-]*)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name possible_seg_name=$1 possible_seg_name= auto_seg_name(possible_seg_name,heading_num_is,:extract) diff --git a/lib/sisu/v6/ao_numbering.rb b/lib/sisu/v6/ao_numbering.rb index ffafbf9c..ef85bbd6 100644 --- a/lib/sisu/v6/ao_numbering.rb +++ b/lib/sisu/v6/ao_numbering.rb @@ -326,7 +326,7 @@ module SiSU_AO_Numbering if possible_seg_name =~/^[0-9]+$/m \ and possible_seg_name.to_i <= heading_num_is.to_i prefix + leading_zeros_fixed_width_number(possible_seg_name) - elsif possible_seg_name =~/^[\d.,:-]+$/m + elsif possible_seg_name =~/^[0-9][\d.,:-]*$/m possible_seg_name=possible_seg_name. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') @@ -369,7 +369,7 @@ module SiSU_AO_Numbering @md.set_heading_seg=true end if dob.name !~/^\S+/ \ - and dob.obj =~/^\s*(?:\S+\s+)?([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name + and dob.obj =~/^\s*(?:\S+\s+)?([0-9][0-9.,:-]*)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name possible_seg_name=$1 possible_seg_name= auto_seg_name(possible_seg_name,heading_num_is,:extract) -- cgit v1.2.3