diff --git a/bibacid-utf8.bib b/bibacid-utf8.bib index 73c1e72..e0c088e 100755 --- a/bibacid-utf8.bib +++ b/bibacid-utf8.bib @@ -223,3 +223,4 @@ MRREVIEWER = {Jean-Fran{\c{c}}ois Clouet}, title = "Fancy accents bug", year = 2015 } + diff --git a/bibtexbrowser-test.php b/bibtexbrowser-test.php index 26fbe3b..ae041a6 100755 --- a/bibtexbrowser-test.php +++ b/bibtexbrowser-test.php @@ -462,6 +462,7 @@ class BTBTest extends PHPUnit_Framework_TestCase { function test_latex2html() { $this->assertEquals('é', latex2html("\'e")); + $this->assertEquals('é', latex2html("{\'e}")); } function test_homepage_link() { diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 04a8de7..a64c2f0 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -927,7 +927,8 @@ class BibDBBuilder extends ParserDelegate { $this->builtdb[$this->currentEntry->getKey()] = $this->currentEntry; } } - + + function entryValuePart($key, $value, $type) { if (preg_match('/^author$/i',trim($key)) && strlen($value)>0) { if ($type == 'CURLYTOP') { @@ -941,6 +942,7 @@ class BibDBBuilder extends ParserDelegate { } } } + } // end class BibDBBuilder @@ -973,11 +975,7 @@ function char2html($line,$latexmodifier,$char,$entitiyfragment) { } function char2html_case_sensitive($line,$latexmodifier,$char,$entitiyfragment) { -// old version -// $line = str_replace('\\'.$latexmodifier.$char,'&'.$char.''.$entitiyfragment.';', $line); -// $line = str_replace('\\'.$latexmodifier.' '.$char,'&'.$char.''.$entitiyfragment.';', $line); -// $line = str_replace('\\'.$latexmodifier.'{'.$char.'}','&'.$char.''.$entitiyfragment.';', $line); - $line = preg_replace('/\\\\'.preg_quote($latexmodifier,'/').' ?\\{?'.$char.'\\}?/','&'.$char.''.$entitiyfragment.';', $line); + $line = preg_replace('/\\{?\\\\'.preg_quote($latexmodifier,'/').' ?\\{?'.$char.'\\}?/','&'.$char.''.$entitiyfragment.';', $line); return $line; }