From c4cc1e5ad2ff5e9a071c9d7d2005c141e83d8541 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 9 Jan 2008 06:10:06 +0000 Subject: odf bug (angle brackets) preliminary fix odf bug reported related to use of angle brackets in markup affects some odf output, preliminary fix --- lib/sisu/v0/odf.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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!(/^<([^<>][^<>][^<>][^<>]+?)>$/,'<\1>') #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+/,' ') #bullet para.gsub!(/^(<:i[1-9]>)\s+_\*\s+/,'\1 · ') #bullet - para.gsub!(/
/,'
') + para.gsub!(/<:?br>/,'
') para.gsub!(/<:p[bn]>/,' ') para.gsub!(/©/,'©') #too arbitrary para.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check -- cgit v1.2.3