From 02bc0dc3bf366e66a9ad10a7cd9d5d7257962c06 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 26 Oct 2009 02:37:31 +0000 Subject: [PATCH] Don't wrap empty labels. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31745 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/output_xhtml.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index 58e4a5c64f..90204b2e82 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -136,7 +136,7 @@ bool openLabelTag(odocstream & os, Layout const & lay) { string const tag = lay.htmllabel().empty() ? "span" : lay.htmllabel(); - string const attr = lay.htmlattr().empty() + string const attr = lay.htmllabelattr().empty() ? "class=\"" + to_utf8(lay.name()) + "label\"" : lay.htmllabelattr(); return html::openTag(os, tag, attr); } @@ -312,10 +312,14 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf, // paragraph (as in a theorem). item_tag_opened = openItemTag(os, style); if (par == pbegin) { - bool const label_tag_opened = openLabelTag(os, style); - os << pbegin->expandLabel(style, buf.params(), false); - if (label_tag_opened) - closeLabelTag(os, style); + docstring const lbl = + pbegin->expandLabel(style, buf.params(), false); + if (!lbl.empty()) { + bool const label_tag_opened = openLabelTag(os, style); + os << lbl; + if (label_tag_opened) + closeLabelTag(os, style); + } os << '\n'; } } else { // some kind of list -- 2.39.5