aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/odf.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-01-09 06:10:06 +0000
committerRalph Amissah <ralph@amissah.com>2008-01-09 06:10:06 +0000
commitc4cc1e5ad2ff5e9a071c9d7d2005c141e83d8541 (patch)
tree6036b64a67a4b68d367fd8f777ac563d15ad1c2c /lib/sisu/v0/odf.rb
parentcorrect a date (diff)
odf bug (angle brackets) preliminary fix
odf bug reported related to use of angle brackets in markup affects some odf output, preliminary fix
Diffstat (limited to 'lib/sisu/v0/odf.rb')
-rw-r--r--lib/sisu/v0/odf.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb
index aa514a90..874f87e1 100644
--- a/lib/sisu/v0/odf.rb
+++ b/lib/sisu/v0/odf.rb
@@ -474,6 +474,9 @@ module SiSU_ODF
word=para.scan(/\S+|\n/)
if word
word.each do |w| # _ - / # | : ! ^ ~
+ unless w =~/<~\S+?;\S+?;\S+?><#@dp:#@dp>|<[:!][^<>]+?>|^<\/?(?:del|ins|sub|sup|cite)>$/
+ w.gsub!(/^<([^<>][^<>][^<>][^<>]+?)>$/,'&lt;\1&gt;') #refix
+ end
unless para =~/^(?:0~|%+ )/m
w.gsub!(/&#(?:126|152);/,'~') #126 usual
if w !~/&\S{1,7};/ \
@@ -495,7 +498,7 @@ module SiSU_ODF
#para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1● ') # bullet utf8, make smaller if used
#para.gsub!(/^_\*\s+/,'<text:span text:style-name="T6">●</text:span> ') #bullet
para.gsub!(/^(<:i[1-9]>)\s+_\*\s+/,'\1 <text:span text:style-name="T6">·</text:span> ') #bullet
- para.gsub!(/<br>/,'<br />')
+ para.gsub!(/<:?br>/,'<br />')
para.gsub!(/<:p[bn]>/,'<text:p text:style-name="P8"> </text:p>')
para.gsub!(/&#169;/,'©') #too arbitrary
para.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check