From 5c5510b300ec51aadabc1e175797f53e6d725cbe Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 24 Feb 2008 20:58:27 +0000 Subject: identify sisu-0.66 tags --- lib/sisu/v0/param_identify_markup.rb | 61 ++++++++++++++++++++++++++---------- lib/sisu/v0/sst_identify_markup.rb | 25 ++++++++++----- 2 files changed, 62 insertions(+), 24 deletions(-) diff --git a/lib/sisu/v0/param_identify_markup.rb b/lib/sisu/v0/param_identify_markup.rb index 5124e89b..056fcc49 100644 --- a/lib/sisu/v0/param_identify_markup.rb +++ b/lib/sisu/v0/param_identify_markup.rb @@ -1,3 +1,4 @@ +# coding: utf-8 =begin * Name: SiSU @@ -76,28 +77,54 @@ module SiSU_Markup_type or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/ @version_declared=$1 end - @flag_57,@flag_38=false,false + @flat_66,@flag_57,@flag_38=false,false,false @cont.each_with_index do |y,i| - if @flag_57 \ - or y =~/^:?A~\?? @title/ - @version_determined=0.57 - @flag_57=true - break + if y =~/^(?:0\{?~links?|@links?:)\s/ + links=unless y =~/\{.+?\}\S+/; oldlinks=' (pre 0.20.4 header links)' + else ' (post 0.20.4 header links)' + end + end + unless @flag_38 + if y =~/^:?A~/ + version='0.38' + @version_determined=version + @flag_38=true + end end - if @flag_38 \ - or y =~/^:?A~/ - @version_determined=0.38 - @flag_38=true - break if i >= 200 - if y =~ /(?:~{\*+|~\[\*|~\[\+)\s/ - @version_determined=0.42 #0.38 can safely be treated as 0.42 + if @flag_38 + if @flag_66 \ + or y =~/[:;]\{.+?\}[:;][a-z+]/ + version='0.66' + @version_determined=version + @flag_66=true break end end - if y =~/^0~/ \ - and not @flag_38 - @version_determined=0.16 - break + end + @flag_57,@flag_38=false,false + unless @flag_66 + @cont.each_with_index do |y,i| + if @flag_57 \ + or y =~/^:?A~\?? @title/ + @version_determined=0.57 + @flag_57=true + break + end + if @flag_38 \ + or y =~/^:?A~/ + @version_determined=0.38 + @flag_38=true + break if i >= 200 + if y =~ /(?:~{\*+|~\[\*|~\[\+)\s/ + @version_determined=0.42 #0.38 can safely be treated as 0.42 + break + end + end + if y =~/^0~/ \ + and not @flag_38 + @version_determined=0.16 + break + end end end @@fns=@opt.fns diff --git a/lib/sisu/v0/sst_identify_markup.rb b/lib/sisu/v0/sst_identify_markup.rb index 0f60b916..a9eb4d32 100644 --- a/lib/sisu/v0/sst_identify_markup.rb +++ b/lib/sisu/v0/sst_identify_markup.rb @@ -1,3 +1,4 @@ +# coding: utf-8 =begin * Name: SiSU @@ -113,7 +114,7 @@ WOK or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/ @declared_markup=$1 end - @flat_65,@flag_57,@flag_38=false,false,false + @flat_66,@flag_57,@flag_38=false,false,false cont.each_with_index do |y,i| if y =~/^(?:0\{?~links?|@links?:)\s/ \ and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/ @@ -129,16 +130,16 @@ WOK end end if @flag_38 - if @flag_65 \ + if @flag_66 \ or y =~/[a-z+][:;]\{.+?\}[:;][a-z+]/ - version='0.65' - markup=Markup_inform.new(version,'0.65' + oldlinks,@declared_markup,@declared_type) - @flag_65=true + version='0.66' + markup=Markup_inform.new(version,'0.66' + oldlinks,@declared_markup,@declared_type) + @flag_66=true break end end end - unless @flag_65 + unless @flag_66 cont.each_with_index do |y,i| if y =~/^(?:0\{?~links?|@links?:)\s/ \ and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/ @@ -244,6 +245,14 @@ WOK def initialize(opt) @opt=opt end + def sisu_0_66 + <