Rather than do checks for empty tags elsewhere, accept them and ignore them.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32092 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2009-11-19 20:39:07 +00:00
parent 021f51e19b
commit 95a8e89e04

View File

@ -201,6 +201,8 @@ XHTMLStream & XHTMLStream::operator<<(char_type c)
XHTMLStream & XHTMLStream::operator<<(StartTag const & tag) XHTMLStream & XHTMLStream::operator<<(StartTag const & tag)
{ {
if (tag.tag_.empty())
return *this;
pending_tags_.push_back(tag); pending_tags_.push_back(tag);
if (tag.keepempty_) if (tag.keepempty_)
clearTagDeque(); clearTagDeque();
@ -210,6 +212,8 @@ XHTMLStream & XHTMLStream::operator<<(StartTag const & tag)
XHTMLStream & XHTMLStream::operator<<(CompTag const & tag) XHTMLStream & XHTMLStream::operator<<(CompTag const & tag)
{ {
if (tag.tag_.empty())
return *this;
clearTagDeque(); clearTagDeque();
// tabs? // tabs?
os_ << tag.asTag(); os_ << tag.asTag();
@ -236,6 +240,8 @@ bool XHTMLStream::isTagOpen(string const & stag)
// best to make things work. // best to make things work.
XHTMLStream & XHTMLStream::operator<<(EndTag const & etag) XHTMLStream & XHTMLStream::operator<<(EndTag const & etag)
{ {
if (etag.tag_.empty())
return *this;
// first make sure we're not closing an empty tag // first make sure we're not closing an empty tag
if (!pending_tags_.empty()) { if (!pending_tags_.empty()) {
StartTag const & stag = pending_tags_.back(); StartTag const & stag = pending_tags_.back();