*
* \author Asger Alstrup
* \author Lars Gullik Bjønnes
+ * \author Richard Heck (XHTML output)
* \author Jean-Marc Lasgouttes
* \author Angus Leeming
* \author John Levon
}
-pos_type Paragraph::firstWordLyXHTML(odocstream & os, OutputParams const & runparams)
+pos_type Paragraph::firstWordLyXHTML(XHTMLStream & xs, OutputParams const & runparams)
const
{
pos_type i;
for (i = 0; i < size(); ++i) {
if (Inset const * inset = getInset(i)) {
- inset->xhtml(os, runparams);
+ inset->xhtml(xs, runparams);
} else {
char_type c = d->text_[i];
if (c == ' ')
break;
- os << html::escapeChar(c);
+ xs << html::escapeChar(c);
}
}
return i;
docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
- odocstream & os,
+ XHTMLStream & xs,
OutputParams const & runparams,
Font const & outerfont,
pos_type initial) const
// emphasis
if (font_old.emph() != font.fontInfo().emph()) {
if (font.fontInfo().emph() == FONT_ON) {
- os << "<em>";
+ xs << StartTag("em");
emph_flag = true;
} else if (emph_flag && i != initial) {
- os << "</em>";
+ xs << EndTag("em");
emph_flag = false;
}
}
// bold
if (font_old.series() != font.fontInfo().series()) {
if (font.fontInfo().series() == BOLD_SERIES) {
- os << "<strong>";
+ xs << StartTag("strong");
bold_flag = true;
} else if (bold_flag && i != initial) {
- os << "</strong>";
+ xs << EndTag("strong");
bold_flag = false;
}
}
OutputParams np = runparams;
if (!il.htmlisblock())
np.html_in_par = true;
- retval += inset->xhtml(os, np);
+ retval += inset->xhtml(xs, np);
} else {
char_type c = d->text_[i];
if (style.pass_thru)
- os.put(c);
+ xs << c;
else if (c == '-') {
docstring str;
int j = i + 1;
}
else
str += c;
- os << str;
+ xs << str;
} else
- os << html::escapeChar(c);
+ xs << c;
}
font_old = font.fontInfo();
}
- // FIXME This could be out of order. See above.
- if (emph_flag)
- os << "</em>";
- if (bold_flag)
- os << "</strong>";
-
+ xs.closeFontTags();
return retval;
}