last changes to get @string and crossref 100% right
This commit is contained in:
+7
-12
@@ -655,8 +655,9 @@ class BibDBBuilder {
|
|||||||
foreach ($entryvalue_array as $k=>$v) {
|
foreach ($entryvalue_array as $k=>$v) {
|
||||||
// spaces are allowed when using #, they are not taken into account
|
// spaces are allowed when using #, they are not taken into account
|
||||||
// however # is not istself replaced by a space
|
// however # is not istself replaced by a space
|
||||||
|
// warning: @strings are not case sensitive
|
||||||
// see http://newton.ex.ac.uk/tex/pack/bibtex/btxdoc/node3.html
|
// see http://newton.ex.ac.uk/tex/pack/bibtex/btxdoc/node3.html
|
||||||
$stringKey=trim($v);
|
$stringKey=strtolower(trim($v));
|
||||||
if (isset($this->stringdb[$stringKey]))
|
if (isset($this->stringdb[$stringKey]))
|
||||||
{
|
{
|
||||||
// this field will be formated later by xtrim and latex2html
|
// this field will be formated later by xtrim and latex2html
|
||||||
@@ -665,17 +666,11 @@ class BibDBBuilder {
|
|||||||
// we keep a trace of this replacement
|
// we keep a trace of this replacement
|
||||||
// so as to produce correct bibtex snippets
|
// so as to produce correct bibtex snippets
|
||||||
$this->currentEntry->constants[$stringKey]=$this->stringdb[$stringKey];
|
$this->currentEntry->constants[$stringKey]=$this->stringdb[$stringKey];
|
||||||
} else {
|
|
||||||
// we simply trim the entry
|
|
||||||
$entryvalue_array[$k]=trim($v); // trimmed value
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$entryvalue=implode('',$entryvalue_array);
|
$entryvalue=implode('',$entryvalue_array);
|
||||||
|
|
||||||
if ($finalkey!='url') $formatedvalue = latex2html(xtrim($entryvalue));
|
$this->currentEntry->setField($finalkey,$entryvalue);
|
||||||
else $formatedvalue = trim($entryvalue);
|
|
||||||
|
|
||||||
$this->currentEntry->setField($finalkey,$formatedvalue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setEntryType($entrytype) {
|
function setEntryType($entrytype) {
|
||||||
@@ -765,6 +760,7 @@ function latex2html($line) {
|
|||||||
$line = char2html($line,"'",'o',"acute");
|
$line = char2html($line,"'",'o',"acute");
|
||||||
$line = char2html($line,"'",'u',"acute");
|
$line = char2html($line,"'",'u',"acute");
|
||||||
$line = char2html($line,"'",'y',"acute");
|
$line = char2html($line,"'",'y',"acute");
|
||||||
|
$line = char2html($line,"'",'n',"acute");
|
||||||
|
|
||||||
$line = char2html($line,'`','a',"grave");
|
$line = char2html($line,'`','a',"grave");
|
||||||
$line = char2html($line,'`','e',"grave");
|
$line = char2html($line,'`','e',"grave");
|
||||||
@@ -849,10 +845,9 @@ class BibEntry {
|
|||||||
|
|
||||||
/** Sets a field of this bib entry. */
|
/** Sets a field of this bib entry. */
|
||||||
function setField($name, $value) {
|
function setField($name, $value) {
|
||||||
// only @string keeps the cases
|
$name = strtolower($name);
|
||||||
if ($this->getType()!='string') {
|
$value = xtrim($value);
|
||||||
$name = strtolower($name);
|
if ($name!='url') $value = latex2html($value);
|
||||||
}
|
|
||||||
$this->fields[$name] = $value;
|
$this->fields[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user