aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2/odf.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-10-09 22:51:24 -0400
committerRalph Amissah <ralph@amissah.com>2010-10-09 22:51:27 -0400
commit7010772e78d181be3a8ba304387d94b8f4825ea7 (patch)
treee698b32b5e0f2a970e585bf092585d2f5f8c0ee5 /lib/sisu/v2/odf.rb
parentsha256 (2.7.4) (diff)
odt fix cornercase breakage matching and representing "&nbsp", "&" and urls
(+changelog) * odf, "&nbsp" and "&" (prior to this fix, odt for viral_spiral is broken in sisu-markup-samples) * shared_metadata, "&nbsp", "&" and urls in metadata more consistent open document text results
Diffstat (limited to 'lib/sisu/v2/odf.rb')
-rw-r--r--lib/sisu/v2/odf.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sisu/v2/odf.rb b/lib/sisu/v2/odf.rb
index 41229249..ad1f45d1 100644
--- a/lib/sisu/v2/odf.rb
+++ b/lib/sisu/v2/odf.rb
@@ -461,9 +461,9 @@ module SiSU_ODF
word.each do |w| # _ - / # | : ! ^ ~
unless dob =~/^(?:#{Rx[:meta]}|%+ )/m
w.gsub!(/&#(?:126|152);/,'~') #126 usual
- if w !~/&\S{1,7};/ \
- or w =~/&nbsp;/
- w.gsub!(/&/,'&amp;') #watch &nbsp;
+ w.gsub!(/&nbsp;/,'&#160;')
+ if w !~/&\S{2,7}?;/
+ w.gsub!(/&/,'&amp;')
end
w.gsub!(/(&\S{1,7};)+&/,'\1&amp;') #could break things
end