From fdd1489c82a274615e46e3c67fc5707e3fb0465f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 9 Jul 2007 11:19:48 +0100 Subject: improved url matching, and texpdf tolerance and indentation levels set --- lib/sisu/v0/dal_syntax.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/sisu/v0/dal_syntax.rb') diff --git a/lib/sisu/v0/dal_syntax.rb b/lib/sisu/v0/dal_syntax.rb index 42e911e5..a882a2c9 100644 --- a/lib/sisu/v0/dal_syntax.rb +++ b/lib/sisu/v0/dal_syntax.rb @@ -191,7 +191,7 @@ module Syntax # # #numbered (list) level 1 # _# #numbered (list) level 2 line=line.dup - unless line =~/^0~|<:codeline>|<:code-end>/ + if line !~/^0~|<:codeline>|<:code-end>/ #special characters: ~ { } < > - _ / also used : ^ ! # line_array=[] line.gsub!(/^%{1,4} .+/mi,'') #remove comments @@ -282,7 +282,9 @@ module Syntax if line =~/(<:(?:verse|group)>)/; line.gsub!(/(<:(?:verse|group)>)/i,"\\1\n") #cosmetic else line.gsub!(/(
)/i,"\\1\n") end - else + else #code blocks + line.gsub!(/(^|\s)(http:\/\/\S+)/,'\1_\2') #line.gsub!(/(^|\s)(http:\/\/\S+)/,"\\1\\\\\\2") #escape urls + line.gsub!(/(^|\s)<(http:\/\/\S+)>([\s,.]|$)/,'\1\2\3') #clean/unescape urls with decoration, re-apply decoration later line.gsub!(/<:codeline>/,"\n") end line @@ -337,3 +339,5 @@ module Syntax end end __END__ +NOTE: +downstream code blocks are not currently/yet honoured, e.g. stuff within angle brackets are removed -- cgit v1.2.3