From 094fefb909529122302219ac78d1a00e1de3feed Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 20 Sep 2010 16:12:33 -0400 Subject: identify markup, update ... revisit --- lib/sisu/v2/sst_identify_markup.rb | 67 ++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 14 deletions(-) diff --git a/lib/sisu/v2/sst_identify_markup.rb b/lib/sisu/v2/sst_identify_markup.rb index 61b4ee11..a6f2a550 100644 --- a/lib/sisu/v2/sst_identify_markup.rb +++ b/lib/sisu/v2/sst_identify_markup.rb @@ -110,7 +110,7 @@ WOK or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/ @declared_markup=$1 end - @flag_66,@flag_57,@flag_38=false,false,false + @flag_2_0,@flag_1_0,@flag_69,@flag_66,@flag_57,@flag_38=false,false,false,false,false,false cont.each_with_index do |y,i| if y =~/^(?:0\{?~links?|@links?:)\s/ \ and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/ @@ -118,6 +118,13 @@ WOK else ' (post 0.20.4 header links)' end end + if @flag_2_0 \ + or y =~/^@make:|^@classify|^\s\s?:[a-z_-]+?:\s+\S/ + version=2.0.to_f + markup=Markup_inform.new(version,'2.0' + oldlinks,@declared_markup,@declared_type) + @flag_2_0=true + break + end unless @flag_38 if (y =~/^:?A~/ and f =~/(?:\.sst|\.ssm|\.ssi)/) version='0.38' @@ -126,11 +133,11 @@ WOK end end if @flag_38 - if @flag_69 \ + if @flag_1_0 \ or y =~/^=\{.+?\}\s*$/ version='0.69' markup=Markup_inform.new(version,'0.69' + oldlinks,@declared_markup,@declared_type) - @flag_69=true + @flag_1_0=true break end if @flag_66 \ @@ -142,7 +149,9 @@ WOK end end end - unless @flag_66 or @flag_69 + unless @flag_2_0 \ + or @flag_1_0 \ + or @flag_66 cont.each_with_index do |y,i| if y =~/^(?:0\{?~links?|@links?:)\s/ \ and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/ @@ -246,9 +255,34 @@ WOK def initialize(opt) @opt=opt end + def sisu_2_0 + <