XMLStream xs(os);
if (output_preamble) {
- // XML preamble, no doctype needed.
+ // XML preamble, no doctype needed.
// Not using XMLStream for this, as the root tag would be in the tag stack and make troubles with the error
// detection mechanisms (these are called before the end tag is output, and thus interact with the canary
// parsep in output_docbook.cpp).
- os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
<< "<!-- This DocBook file was created by LyX " << lyx_version
<< "\n See http://www.lyx.org/ for more information -->\n";
// Directly output the root tag, based on the current type of document.
- string languageCode = params().language->code();
+ string languageCode = params().language->code();
string params = "xml:lang=\"" + languageCode + '"'
+ " xmlns=\"http://docbook.org/ns/docbook\""
+ " xmlns:xlink=\"http://www.w3.org/1999/xlink\""
+ " xmlns:m=\"http://www.w3.org/1998/Math/MathML\""
- + " xmlns:xi=\"http://www.w3.org/2001/XInclude\""
- + " version=\"5.2\"";
+ + " xmlns:xi=\"http://www.w3.org/2001/XInclude\""
+ + " version=\"5.2\"";
os << "<" << from_ascii(tclass.docbookroot()) << " " << from_ascii(params) << ">\n";
}
os << "<title>"
<< (doctitle.empty() ?
from_ascii("LyX Document") :
- xml::xmlize(doctitle, XMLStream::ESCAPE_ALL))
+ xml::escapeString(doctitle, XMLStream::ESCAPE_ALL))
<< "</title>\n";
docstring styles = features.getTClassHTMLPreamble();
// to resolve macros in it.
parit.text()->setMacrocontextPosition(parit);
- // Reset bibitem counter in master (#8499)
- Buffer const * const master = masterBuffer();
- if (master == this && !d->ignore_parent)
- master->params().documentClass().counters().reset(from_ascii("bibitem"));
-
depth_type maxdepth = 0;
pit_type const lastpit = parit.lastpit();
bool changed = false;
++word_count_;
inword = true;
}
- if (ins && ins->isLetter())
- ++char_count_;
+ if (ins && ins->isLetter()) {
+ odocstringstream os;
+ ins->toString(os);
+ char_count_ += os.str().length();
+ }
else if (ins && ins->isSpace())
++blank_count_;
else {