}
else if (scanning_key)
key += char(thischar);
- else if (richtext || !scanning_rich)
+ else if (richtext) {
+ if (scanning_rich)
+ ret += thischar;
+ else {
+ // we need to escape '<' and '>'
+ if (thischar == '<')
+ ret += "<";
+ else if (thischar == '>')
+ ret += ">";
+ else
+ ret += thischar;
+ }
+ } else if (!scanning_rich /* && !richtext */)
ret += thischar;
// else the character is discarded, which will happen only if
// richtext == false and we are scanning rich text
/// \return formatted BibTeX data associated with a given key.
/// Empty if no info exists.
/// Note that this will retrieve data from the crossref as needed.
+ /// If \param richtext is true, then it will output any richtext tags
+ /// marked in the citation format and escape < and > elsewhere.
docstring const getInfo(docstring const & key, Buffer const & buf,
bool richtext = false) const;
/// Is this a reference from a bibtex database
// which will give us all the cross-referenced info. But for every
// entry, so there's a lot of repitition. This should be fixed.
xs << html::StartTag("span", "class='bibtexinfo'")
+ << XHTMLStream::NextRaw()
<< bibinfo.getInfo(entry.key(), buffer(), true)
<< html::EndTag("span")
<< html::EndTag("div");