diff options
Diffstat (limited to 'lib/sisu/v0/param.rb')
-rw-r--r-- | lib/sisu/v0/param.rb | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb index f4bf6a3f..446c2d46 100644 --- a/lib/sisu/v0/param.rb +++ b/lib/sisu/v0/param.rb @@ -459,12 +459,12 @@ module SiSU_Param when /^(?:0~links|@links:)\s+(.+?)$/m #% processing doc_links_str=$1 @lnk=[] - if doc_links_str=~/\{.+?\}(?:(?:https?|ftp):\/|\.\.)\/\S+(?:\s|$)/ - doc_links=doc_links_str.scan(/\{.+?\}(?:(?:https?|ftp):\/|\.\.)\/\S+/) + if doc_links_str=~/\{.+?\}(?:(?:https?|file|ftp):\/|\.\.)\/\S+(?:\s|$)/ + doc_links=doc_links_str.scan(/\{.+?\}(?:(?:https?|file|ftp):\/|\.\.)\/\S+/) count=1 doc_links.each do |x| @lnk[count]={} - @lnk[count][:say],@lnk[count][:url]=/\{\s*(.+?)\s*\}((?:(?:https?|ftp):\/|\.\.)\/\S+)/im.match(x)[1,2] + @lnk[count][:say],@lnk[count][:url]=/\{\s*(.+?)\s*\}((?:(?:https?|file|ftp):\/|\.\.)\/\S+)/im.match(x)[1,2] count +=1 end else @@ -473,7 +473,7 @@ module SiSU_Param count=1 lnks.each do |x| @lnk[count]={} - if x =~/^\s*(?:(?:https?|ftp):\/\/|\.\.\/)/; @lnk[count][:url]=x + if x =~/^\s*(?:(?:https?|file|ftp):\/\/|\.\.\/)/; @lnk[count][:url]=x else @lnk[count][:say]=x count +=1 @@ -536,14 +536,16 @@ module SiSU_Param end end end - case para - when /~\{\s+.+?\}~/ #% processing - en=para.scan(/~\{.+?\}~/) - en.each { |e| @en[:sum] +=1 } - when /~\^(?:\s|$)/ #% processing - mk=para.scan(/~\^(?:\s|$)/) - mk.each { |e| @en[:mark] +=1 } - when /^\^~\s+\S/; @en[:note] +=1 #% processing + unless @code_flag + case para + when /~\{\s+.+?\}~/ #% processing + en=para.scan(/~\{.+?\}~/) + en.each { |e| @en[:sum] +=1 } + when /~\^(?:\s|$)/ #% processing + mk=para.scan(/~\^(?:\s|$)/) + mk.each { |e| @en[:mark] +=1 } + when /^\^~\s+\S/; @en[:note] +=1 #% processing + end end if para =~/~\{|\^~ |~\^|<:ee>/; @flag_auto_endnotes,@flag_endnotes=true,true end |