aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/param_identify_markup.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/param_identify_markup.rb')
-rw-r--r--lib/sisu/v0/param_identify_markup.rb61
1 files changed, 44 insertions, 17 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