aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-01-23 21:27:53 -0500
committerRalph Amissah <ralph@amissah.com>2012-01-23 21:28:50 -0500
commit7e9a59cab2283aea8155fca3187e58011851bf6f (patch)
treeb73a4fcca3b6f50196b25ea98d7cf3a0a5e047bf
parentv3 v3dv: urls, odt maintenance path fix (diff)
v3 v3dv: texpdf, tampering with "safe" special character transformations, a fix
* could introduce new issues, watch * [reported by Timothy Hume, pdf title bug "&" not represented]
-rw-r--r--data/doc/sisu/CHANGELOG_v34
-rw-r--r--lib/sisu/v3/texpdf_format.rb9
-rw-r--r--lib/sisu/v3dv/texpdf_format.rb9
3 files changed, 22 insertions, 0 deletions
diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3
index 0d931167..5451ae2f 100644
--- a/data/doc/sisu/CHANGELOG_v3
+++ b/data/doc/sisu/CHANGELOG_v3
@@ -21,6 +21,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.12.orig.tar.xz
sisu_3.1.12-1.dsc
sisu_3.1.12-1.debian.tar.gz
+* texpdf, tampering with "safe" special character transformations, a fix (that
+ may introduce new issues, watch) [in response to report of a pdf title bug
+ "&" not represented, Timothy Hume]
+
* urls, odt maintenance path fix
%% 3.1.11.orig.tar.xz (2012-01-10:02/2)
diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb
index 43008c3d..76fc5d37 100644
--- a/lib/sisu/v3/texpdf_format.rb
+++ b/lib/sisu/v3/texpdf_format.rb
@@ -1366,6 +1366,14 @@ WOK
'^\copyright \textnormal{\1} \2') # watch likely to be problematic
str
end
+ def special_characters_safe_close(str)
+ str.gsub!(/<=tilde>/,'{$\tilde$}')
+ str.gsub!(/<=hash>/,'{\#}')
+ str.gsub!(/<=amp>/,'{\\\&}') #changed ... 2005
+ str.gsub!(/<=copymark>\s*(.+)/,
+ '^\copyright \textnormal{\1} \2') # watch likely to be problematic
+ str
+ end
def special_characters_code_fix(str)
str.gsub!(/<=tilde>/,'{$\tilde$}')
str
@@ -1398,6 +1406,7 @@ WOK
str,is=@txt,@is
str=xetex_special_characters_1(str,is) unless str.nil?
str=xetex_special_characters_2(str,is) unless str.nil? # remove this to start with, causes issues
+ str=special_characters_safe_close(str) unless str.nil?
@txt=str
end
def characters_code_listings #special characters - some substitutions are sequence sensitive, rearrange with care.
diff --git a/lib/sisu/v3dv/texpdf_format.rb b/lib/sisu/v3dv/texpdf_format.rb
index d059934d..a4b590a1 100644
--- a/lib/sisu/v3dv/texpdf_format.rb
+++ b/lib/sisu/v3dv/texpdf_format.rb
@@ -1366,6 +1366,14 @@ WOK
'^\copyright \textnormal{\1} \2') # watch likely to be problematic
str
end
+ def special_characters_safe_close(str)
+ str.gsub!(/<=tilde>/,'{$\tilde$}')
+ str.gsub!(/<=hash>/,'{\#}')
+ str.gsub!(/<=amp>/,'{\\\&}') #changed ... 2005
+ str.gsub!(/<=copymark>\s*(.+)/,
+ '^\copyright \textnormal{\1} \2') # watch likely to be problematic
+ str
+ end
def special_characters_code_fix(str)
str.gsub!(/<=tilde>/,'{$\tilde$}')
str
@@ -1398,6 +1406,7 @@ WOK
str,is=@txt,@is
str=xetex_special_characters_1(str,is) unless str.nil?
str=xetex_special_characters_2(str,is) unless str.nil? # remove this to start with, causes issues
+ str=special_characters_safe_close(str) unless str.nil?
@txt=str
end
def characters_code_listings #special characters - some substitutions are sequence sensitive, rearrange with care.