aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/dal_syntax.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-07-09 11:19:48 +0100
committerRalph Amissah <ralph@amissah.com>2007-07-09 11:19:48 +0100
commitfdd1489c82a274615e46e3c67fc5707e3fb0465f (patch)
tree1241b19a94118352dbb16cbc3f02483a51919ce8 /lib/sisu/v0/dal_syntax.rb
parentsisu-0.55.2 + md5s (diff)
improved url matching, and texpdf tolerance and indentation levels set
Diffstat (limited to 'lib/sisu/v0/dal_syntax.rb')
-rw-r--r--lib/sisu/v0/dal_syntax.rb8
1 files changed, 6 insertions, 2 deletions
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!(/(<br \/>)/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