diff options
author | Ralph Amissah <ralph@amissah.com> | 2010-05-26 17:42:36 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2010-05-26 17:42:36 -0400 |
commit | 2f5a240e08899f6f800244a15ed599005424eae8 (patch) | |
tree | e1fc4a0fccfb003872a1a199b6a758885ab6d171 | |
parent | epub & odf, regex matches for http: to include https: (diff) |
texpdf_format, https: url match with tilde, fix
-rw-r--r-- | lib/sisu/v2/texpdf_format.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb index 68190407..32ac7aa5 100644 --- a/lib/sisu/v2/texpdf_format.rb +++ b/lib/sisu/v2/texpdf_format.rb @@ -72,7 +72,7 @@ module SiSU_TeX_Pdf end def bare_urls_in_code @dob.tmp.gsub!(/(^|[^\\])_/m,'\1\_') #watch may not work - @dob.tmp.gsub!(/(http:\/\/\S+?)([{]|[.,;)\]]?(?: |$))/m, + @dob.tmp.gsub!(/(https?:\/\/\S+?)([{]|[.,;)\]]?(?: |$))/m, '\begin{scriptsize}\url{\1}\end{scriptsize}\2') @dob end @@ -1060,18 +1060,18 @@ WOK str.gsub!(/<=lt>/m,'{\UseTextSymbol{OML}{<}}') str.gsub!(/<=gt>/m,'{\UseTextSymbol{OML}{>}}') str.gsub!(/<=underscore>/,'\_') - while str =~/(http:\/\/\S+?)(?:<=tilde>\S+)+/ #tilde in urls \href treated differently from text #FIX - str.gsub!(/(http:\/\/\S+?)(?:<=tilde>(\S+))+/,'\1~\2') + while str =~/(https?:\/\/\S+?)(?:<=tilde>\S+)+/ #tilde in urls \href treated differently from text #FIX + str.gsub!(/(https?:\/\/\S+?)(?:<=tilde>(\S+))+/,'\1~\2') end str.gsub!(/<=tilde>/,'{$\tilde$}') str.gsub!(/<=pipe>/,'{\textbar}') str.gsub!(/<=caret>/,'{\^{~}}') str.gsub!(/<=exclaim>/,'\Verbatim{!}') - str.gsub!(/(http:\/\/\S+?)(?:(?:<=hash>)(\S+))+/,'\1#\2') #hash in urls \href treated differently from text #FIX + str.gsub!(/(https?:\/\/\S+?)(?:(?:<=hash>)(\S+))+/,'\1#\2') #hash in urls \href treated differently from text #FIX str.gsub!(/<=hash>/,'{\#}') str.gsub!(/<=hardspace>/,'{~}') #changed ... 2005 - while str =~/(http:\/\/\S+?)(?:<=amp>\S+)+/ #amp in urls \href treated differently from text #FIX - str.gsub!(/(http:\/\/\S+?)(?:<=amp>(\S+))+/,'\1&\2') + while str =~/(https?:\/\/\S+?)(?:<=amp>\S+)+/ #amp in urls \href treated differently from text #FIX + str.gsub!(/(https?:\/\/\S+?)(?:<=amp>(\S+))+/,'\1&\2') end str.gsub!(/<=amp>/,'{\\\&}') #changed ... 2005 str.gsub!(/<=slash>/,'{/}') |