Added transformation for TeX characters

---, --, \%, \&
This commit is contained in:
Klaus-Hendrik Wolf
2015-06-08 02:32:24 +02:00
parent c6eb52a63f
commit 8f05c25a10
+6
View File
@@ -886,6 +886,9 @@ function latex2html($line) {
$line = preg_replace('/([^\\\\])~/','\\1 ', $line);
$line = str_replace('---','—',$line);
$line = str_replace('--','–',$line);
// performance increases with this test
// bug found by Serge Barral: what happens if we have curly braces only (typically to ensure case in Latex)
// added && strpos($line,'{')===false
@@ -905,6 +908,9 @@ function latex2html($line) {
// in order not to mix with the HTML entities coming after (just in case)
$line = str_replace('\\&','&', $line);
$line = str_replace('\_','_',$line);
$line = str_replace('\%','%',$line);
// handling \url{....}
// often used in howpublished for @misc
$line = preg_replace('/\\\\url\{(.*)\}/U','<a href="\\1">\\1</a>', $line);