Browse Source

refactored toEntryUnformatted:\n * changed from echo to return\n * bulletproof HTML content ('<' -> '&lt;')

hg/35a367e65a464cf6cdf277c73f977a6828b723fe/bookmarks/master
Martin Monperrus 15 years ago
parent
commit
6fbab50525
  1. 10
      bibtexbrowser.php

10
bibtexbrowser.php

@ -1292,16 +1292,18 @@ class BibEntry {
* URLs are replaced by HTML links.
*/
function toEntryUnformatted() {
echo '<pre class="purebibtex">'; // pre is nice when it is embedded with no CSS available
$entry = $this->getFullText();
$result = "";
$result .= '<pre class="purebibtex">'; // pre is nice when it is embedded with no CSS available
$entry = str_replace('<','&lt;',$this->getFullText());
if ($this->hasField('url')) {
$url = $this->getField('url');
// this is not a parsing but a simple replacement
$entry = str_replace($url,'<a href="'.$url.'">'.$url.'</a>', $entry);
}
echo $entry;
echo '</pre>';
$result .= $entry;
$result .= '</pre>';
return $result;
}
/**

Loading…
Cancel
Save