This commit is contained in:
Martin Monperrus
2017-10-27 22:44:19 +02:00
parent cb0424fd89
commit fa4e80bbab
2 changed files with 6 additions and 4 deletions
+3 -3
View File
@@ -527,7 +527,7 @@ class BTBTest extends PHPUnit_Framework_TestCase {
function test_homepage_link() {
bibtexbrowser_configure('USE_COMMA_AS_NAME_SEPARATOR_IN_OUTPUT', false);
bibtexbrowser_configure('USE_FIRST_THEN_LAST', false);
$bibtex = "@string{hp_MartinMonperrus={http://www.monperrus.net/martin},hp_FooAcé={http://example.net/}},@article{aKey61,title={An article Book},author = {Martin Monperrus and Foo Acé and Monperrus, Martin}}\n";
$bibtex = "@string{hp_MartinMonperrus={http://www.monperrus.net/~martin},hp_FooAcé={http://example.net/}},@article{aKey61,title={An article Book},author = {Martin Monperrus and Foo Acé and Monperrus, Martin}}\n";
$test_data = fopen('php://memory','x+');
fwrite($test_data, $bibtex);
fseek($test_data,0);
@@ -535,9 +535,9 @@ class BTBTest extends PHPUnit_Framework_TestCase {
$db->update_internal("inline", $test_data);
$entry = $db->getEntryByKey('aKey61');
$authors = $entry->getFormattedAuthorsArray();
$this->assertEquals('<a href="http://www.monperrus.net/martin">Martin Monperrus</a>', $authors[0]);
$this->assertEquals('<a href="http://www.monperrus.net/~martin">Martin Monperrus</a>', $authors[0]);
$this->assertEquals('<a href="http://example.net/">Foo Acé</a>', $authors[1]);
$this->assertEquals('<a href="http://www.monperrus.net/martin">Monperrus, Martin</a>', $authors[2]);
$this->assertEquals('<a href="http://www.monperrus.net/~martin">Monperrus, Martin</a>', $authors[2]);
}
function test_author_index() {
+3 -1
View File
@@ -1226,7 +1226,9 @@ class BibEntry {
// we assume that "comment" is never latex code
// but instead could contain HTML code (with links using the character "~" for example)
// so "comment" is not transformed too
if ($name!='url' && $name!='comment') {
if ($name!='url' && $name!='comment'
&& !preg_match('/^hp_/',$name) // homepage links should not be transformed with latex2html
) {
$value = $this->transformValue($value);
// 4. transform existing encoded character in the new format