From 0607a1bd8727ed7c482fcfb0e4c4002cd24eca72 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 13 Dec 2011 22:05:41 -0500 Subject: v3: odf:odt, codeblocks, a match fix, affects e.g. "<<" --- data/doc/sisu/CHANGELOG_v3 | 2 ++ lib/sisu/v3/odf.rb | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 146d7786..427561d1 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -21,6 +21,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.8.orig.tar.xz sisu_3.1.8-1.dsc sisu_3.1.8-1.debian.tar.gz + * odf:odt, codeblocks, a match fix, affects e.g. "<<" + %% 3.1.7.orig.tar.xz (2011-12-08:49/4) http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.7 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.7-1 diff --git a/lib/sisu/v3/odf.rb b/lib/sisu/v3/odf.rb index b7b747ee..7d4fa309 100644 --- a/lib/sisu/v3/odf.rb +++ b/lib/sisu/v3/odf.rb @@ -535,10 +535,12 @@ module SiSU_ODF unless dob =~/^(?:#{Rx[:meta]}|%+ )/m w.gsub!(/&#(?:126|152);/,'~') #126 usual w.gsub!(/ /,' ') - if w !~/&\S{2,7}?;/ + if w !~/(?:&\S{2,7}?;)+/ w.gsub!(/&/,'&') end - w.gsub!(/(&\S{1,7};)+&/,'\1&') #could break things + if w !~/&\S{1,7}?;(?:&\S{1,7}?;)+/ #imperfect + w.gsub!(/(&\S{1,7};)+&/,'\1&') + end end para_array << w end -- cgit v1.2.3