aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/shared_xml.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-10-16 01:14:51 +0100
committerRalph Amissah <ralph@amissah.com>2007-10-16 01:14:51 +0100
commit68c7e79f3873607339a2b199e5e85c1c21b4255b (patch)
tree3dbd08fec3f6d9259950c6ef49e4f635de1f2597 /lib/sisu/v0/shared_xml.rb
parentMerge branch 'upstream' into debian/sid (diff)
parentimage list, extracting conditions and regex visited (diff)
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib/sisu/v0/shared_xml.rb')
-rw-r--r--lib/sisu/v0/shared_xml.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sisu/v0/shared_xml.rb b/lib/sisu/v0/shared_xml.rb
index 11dead2d..d2897a1f 100644
--- a/lib/sisu/v0/shared_xml.rb
+++ b/lib/sisu/v0/shared_xml.rb
@@ -355,8 +355,8 @@ module SiSU_XML_munge
para.gsub!(/<0;\w\d+;[um]\d+><#@dp:#@dp>/,'')
if para !~/^<:code>/
#embeds a red-bullet image -->
- para.gsub!(/(^|\s)\{\s*(\S+?\.(?:jpg|png|gif))\s+(\d+)x(\d+)(\s+[^}]+)?\}(https?:\/\/\S+)/,%{\\1<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="#{@dir.url.images_local}/\\2" width="\\3" height="\\4" />[\\2] \\5})
- para.gsub!(/(^|\s)\{\s*(\S+?\.(?:jpg|png|gif))(\s+[^}]+)?\}(https?:\/\/\S+)/,%{\\1<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="#{@dir.url.images_local}/\\2"/>\\2})
+ para.gsub!(/(?:^|[^_\\])\{\s*(\S+?\.(?:jpg|png|gif))\s+(\d+)x(\d+)(\s+[^}]+)?\}(https?:\/\/\S+)/,%{<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="#{@dir.url.images_local}/\\1" width="\\2" height="\\3" />[\\1] \\4})
+ para.gsub!(/(?:^|[^_\\])\{\s*(\S+?\.(?:jpg|png|gif))(\s+[^}]+)?\}(https?:\/\/\S+)/,%{<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:actuate="onLoad" xlink:show="embed" xlink:href="#{@dir.url.images_local}/\\1"/>\\1})
para.gsub!(/(^|\s)\{([^}]+)\}(https?:\/\/[^"><]+?)([,.:;"><]?(?=\s|$))/,
'\1<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="\3">\2</link>\4') #watch, compare html_tune
para.gsub!(/(^|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,
@@ -381,7 +381,7 @@ module SiSU_XML_munge
para.gsub!(/<[-~]#>/,'')
para.gsub!(/(^|\s)&\s+/,'\1&amp; ') #sort
para.gsub!(/&([^;]{1,5})/,'&amp;\1') #sort, rough estimate, revisit #WATCH found in node not sax
- para.gsub!(/\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|file|ftp):\/\/\S+|image)/,
+ para.gsub!(/(?:^|[^_\\])\{(\S+?\.(?:png|jpg|gif)) .+?\}(?:(?:https?|file|ftp):\/\/\S+|image)/,
"<image.path>#{@dir.url.images_local}\/\\1</image.path>")
para.gsub!(/&nbsp;/,'&#160;')
#para.gsub!(/&nbsp;/,' ') #clean