Update XHTML debugging code a bit.

This commit is contained in:
Richard Heck 2016-07-09 14:28:27 -04:00
parent db954caf8b
commit 2b87026bf9
2 changed files with 14 additions and 10 deletions

View File

@ -291,21 +291,27 @@ XHTMLStream::XHTMLStream(odocstream & os)
#ifdef XHTML_DEBUG
void XHTMLStream::dumpTagStack(string const & msg) const
void XHTMLStream::dumpTagStack(string const & msg)
{
writeError(msg + ": Tag Stack");
TagStack::const_reverse_iterator it = tag_stack_.rbegin();
TagStack::const_reverse_iterator en = tag_stack_.rend();
*this << html::CR();
writeError(msg);
*this << html::CR();
writeError("Tag Stack");
TagDeque::const_reverse_iterator it = tag_stack_.rbegin();
TagDeque::const_reverse_iterator en = tag_stack_.rend();
for (; it != en; ++it) {
writeError(it->tag_);
writeError(it->get()->tag_);
}
writeError("End Tag Stack");
*this << html::CR();
writeError("Pending Tags");
it = pending_tags_.rbegin();
en = pending_tags_.rend();
for (; it != en; ++it) {
writeError(it->tag_);
writeError(it->get()->tag_);
}
writeError("End Tag Stack");
writeError("End Pending Tags");
*this << html::CR();
}
#endif

View File

@ -241,12 +241,10 @@ public:
/// Sets what we are going to escape on the NEXT write.
/// Everything is reset for the next time.
XHTMLStream & operator<<(EscapeSettings);
#if 0
/// This routine is for debugging the tag stack, etc. Code
/// for it is disabled by default, however, so you will need
/// to enable it if you want to use it.
void dumpTagStack(std::string const & msg) const;
#endif
void dumpTagStack(std::string const & msg);
private:
///
void clearTagDeque();