From 68683890e1cae270d4a592a2730329196de85910 Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Sun, 27 Mar 2005 18:32:26 +0000 Subject: [PATCH] Improved rendering of hyperlinks in TeX and PDF [sfoy] --- lib/redcloth_for_tex.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/redcloth_for_tex.rb b/lib/redcloth_for_tex.rb index fbf23688..c238ed7c 100644 --- a/lib/redcloth_for_tex.rb +++ b/lib/redcloth_for_tex.rb @@ -7,6 +7,7 @@ class String gsub!( '&', '\\\\&' ) gsub!( '%', '\%' ) gsub!( '$', '\$' ) + gsub!( '~', '$\sim$' ) end end @@ -459,14 +460,16 @@ class RedClothForTex < String (?=\s|$) /x ) do |m| pre,atts,text,title,url,slash,post = $~[1..7] - + + url.gsub!(/(\\)(.)/, '\2') url = check_refs( url ) atts = pba( atts ) atts << " title=\"#{ title }\"" if title atts = shelve( atts ) if atts - "#{ pre }#{ text }#{ post }" + "#{ pre }\\textit{#{ text }} \\footnote{\\texttt{\\textless #{ url }#{ slash }" + + "\\textgreater}#{ post }}" end end