Ejemplo n.º 1
0
 /** Sets a field of this bib entry. */
 function setField($name, $value)
 {
     $name = strtolower($name);
     // fields that should not be transformed
     if ($name != 'url') {
         $value = xtrim($value);
         $value = latex2html($value);
     } else {
         //echo "xx".$value."xx\n";
     }
     $this->fields[$name] = $value;
 }
 /** Sets a field of this bib entry. */
 function setField($name, $value)
 {
     $name = strtolower($name);
     // fields that should not be transformed
     // 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') {
         // 1. trim space
         $value = xtrim($value);
         if (c('BIBTEXBROWSER_USE_LATEX2HTML')) {
             // 2. transform Latex markup to HTML entities (easier than a one to one mapping to each character)
             // HTML entity is an intermediate format
             $value = latex2html($value);
             // 3. transform to the target output encoding
             $value = html_entity_decode($value, ENT_QUOTES | ENT_XHTML, OUTPUT_ENCODING);
         }
         // 4. transform existing encoded character in the new format
         if (function_exists('mb_convert_encoding') && OUTPUT_ENCODING != BIBTEX_INPUT_ENCODING) {
             $vaue = mb_convert_encoding($value, OUTPUT_ENCODING, BIBTEX_INPUT_ENCODING);
         }
     } else {
         //echo "xx".$value."xx\n";
     }
     $this->fields[$name] = $value;
 }
Ejemplo n.º 3
0
 /** Sets a field of this bib entry. */
 function setField($name, $value)
 {
     $name = strtolower($name);
     // fields that should not be transformed
     // 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') {
         $value = xtrim($value);
         $value = latex2html($value);
     } else {
         //echo "xx".$value."xx\n";
     }
     $this->fields[$name] = $value;
 }