aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/odf.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-09-03 22:25:03 -0400
committerRalph Amissah <ralph@amissah.com>2008-09-03 22:36:10 -0400
commit2a738f528cb87793ff7f8312099666af1e21f44c (patch)
treee3d58f4118689a0d353dc04775652c83fc40b65e /lib/sisu/v0/odf.rb
parenthtml segments; sql db field lengths increased (diff)
xml character encoding adjusted; xml image match; odf issue with '@' symbol in url
Diffstat (limited to 'lib/sisu/v0/odf.rb')
-rw-r--r--lib/sisu/v0/odf.rb7
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!(/&lt;(~\d+;(?:\w|[0-6]:)\d+;\w\d+)&gt;&lt;(#@dp:#@dp)&gt;/,'<\1><\2>')
para='' if para =~/#{Mx[:lv_o]}\d+:.*?#{Mx[:lv_c]}.+?#{Mx[:pa_non_object_dummy_heading]}/
para_array=[]
+ para.gsub!(/</,'&lt;'); para.gsub!(/>/,'&gt;')
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