aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/xml_shared.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-07-15 19:03:56 -0400
committerRalph Amissah <ralph@amissah.com>2014-07-15 19:03:56 -0400
commitd325316ca6328472bd462cfc49e33e3ae207a512 (patch)
tree6fac2c53e85a00ce88d79be9baa0f2c85ae40236 /lib/sisu/v5/xml_shared.rb
parentdebian/changelog (5.5.0-1) (diff)
parentv5 v6: document images (more to clean up) (diff)
Merge tag 'sisu_5.5.1' into debian/sid
SiSU 5.5.1
Diffstat (limited to 'lib/sisu/v5/xml_shared.rb')
-rw-r--r--lib/sisu/v5/xml_shared.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/sisu/v5/xml_shared.rb b/lib/sisu/v5/xml_shared.rb
index f1113495..77df1a30 100644
--- a/lib/sisu/v5/xml_shared.rb
+++ b/lib/sisu/v5/xml_shared.rb
@@ -477,15 +477,21 @@ module SiSU_XML_Munge
gsub(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'<cite>\1</cite>').
gsub(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'<del>\1</del>').
gsub(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'<tt>\1</tt>'). # tt, kbd
- gsub(/#{Mx[:lnk_o]}\s*(\S+?\.(?:png|jpg|gif)).+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}|image)/m,
- %{#{Xx[:split]}:spaces0:<figure id="\\1">\n:spaces1:<title></title>\n:spaces1:<graphic fileref="images/\\1" align="center" width="50%"></graphic>\n:spaces0:</figure>#{Xx[:split]}}).
- gsub(/#{Mx[:url_o]}(.+?)#{Mx[:url_c]}/,"#{Dx[:url_o]}\\1#{Dx[:url_c]}").
+ gsub(/#{Mx[:lnk_o]}\s*(\S+?)\.(png|jpg|gif).+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}|image)/m,
+ %{#{Xx[:split]}:spaces0:<figure id="fig-\\1">\n:spaces1:<title></title>\n:spaces1:<graphic fileref="../../_sisu/image/\\1.\\2" align="center" width="50%"></graphic>\n:spaces0:</figure>#{Xx[:split]}}). # common image location, else use ./images
+ gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:url_o]}(.+?)#{Mx[:url_c]}/,
+ '<ulink url="\2">\1</ulink>').
+ gsub(/#{Mx[:url_o]}(.+?)#{Mx[:url_c]}/,
+ '<ulink url="\1">\1</ulink>').
gsub(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,'<a name="\1"></a>').
gsub(/#{Mx[:gl_bullet]}/m,'● '). #&nbsp; not available
gsub(/#{Mx[:nbsp]}/,' '). #&nbsp; not available
gsub(/<(p|br)>/,'<\1 />')
dob.obj=clean(dob.obj)
- else # codeblock
+ elsif dob.is == :code
+ dob.obj=dob.obj.gsub(/&/m,'&amp;'). #sort
+ gsub(/</,'&lt;').gsub(/>/,'&gt;')
+ else # p dob.is ??
end
dob
end