diff options
Diffstat (limited to 'lib/sisu/v0/odf.rb')
-rw-r--r-- | lib/sisu/v0/odf.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb index 6b1491c2..bf23f91f 100644 --- a/lib/sisu/v0/odf.rb +++ b/lib/sisu/v0/odf.rb @@ -267,7 +267,7 @@ module SiSU_ODF #para.gsub!(/\b((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/, also works #%{#{@url_brace.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{@url_brace.xml_close}\\2}) #http ftp matches with decoration para.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{@url_brace.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@url_brace.xml_close}}) + %{#{@url_brace.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@url_brace.xml_close}}) if para !~/http:\/\// # improve upon, document crash where url contains '@' symbol para=case para when /^#{Mx[:pa_o]}:i([1-9])#{Mx[:pa_c]}/m m=$1 @@ -443,6 +443,7 @@ module SiSU_ODF #para.gsub!(/<(~\d+;(?:\w|[0-6]:)\d+;\w\d+)><(#@dp:#@dp)>/,'<\1><\2>') para='' if para =~/#{Mx[:lv_o]}\d+:.*?#{Mx[:lv_c]}.+?#{Mx[:pa_non_object_dummy_heading]}/ para_array=[] + para.gsub!(/</,'<'); para.gsub!(/>/,'>') word=para.scan(/\S+|\n/) if word word.each do |w| # _ - / # | : ! ^ ~ @@ -487,8 +488,10 @@ module SiSU_ODF para.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'<text:span text:style-name="T3">\1</text:span>') para.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'<text:span text:style-name="T4">\1</text:span>') para.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'<text:span text:style-name="T5">\1</text:span>') - para.gsub!(/`/,"'") + para.gsub!(/[`’]/,"'") para.gsub!(//u,'-') + para.gsub!(/ /u, ' ') # space identify + para.gsub!(/ /u, ' ') # space identify para.gsub!(/·/u,'*') para.gsub!(/[“”]/u,'""') para.gsub!(/[–—]/u,'-') #— – chk |