bool XHTMLStream::closeFontTags()
{
+ if (isTagPending(parsep_tag))
+ // we haven't had any content
+ return true;
+
+ // this may be a useless check, since we ought at least to have
+ // the parsep_tag. but it can't hurt too much to be careful.
if (tag_stack_.empty())
return true;
+
// first, we close any open font tags we can close
html::StartTag curtag = tag_stack_.back();
while (html::isFontTag(curtag.tag_)) {
}
+bool XHTMLStream::isTagPending(string const & stag) const
+{
+ TagStack::const_iterator sit = pending_tags_.begin();
+ TagStack::const_iterator const sen = pending_tags_.end();
+ for (; sit != sen; ++sit)
+ if (sit->tag_ == stag)
+ return true;
+ return false;
+}
+
+
// this is complicated, because we want to make sure that
// everything is properly nested. the code ought to make
// sure of that, but we won't assert (yet) if we run into
///
bool isTagOpen(std::string const &) const;
///
+ bool isTagPending(std::string const &) const;
+ ///
void writeError(std::string const &) const;
///
odocstream & os_;