Added transformation for TeX characters
---, --, \%, \&
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user