]> git.lyx.org Git - features.git/commitdiff
Allow the suppression of LyX's own labels.
authorRichard Heck <rgheck@comcast.net>
Mon, 26 Oct 2009 02:51:51 +0000 (02:51 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 26 Oct 2009 02:51:51 +0000 (02:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31746 a592a061-630c-0410-9148-cb99ea01b6c8

lib/layouts/stdlists.inc
src/Layout.h
src/output_xhtml.cpp

index 1cbf2cb94dc997c5e7c275f86fe62cfcbf13f36e..8829529649d8b667c5f0a164912bf630e14b4024 100644 (file)
@@ -27,6 +27,7 @@ Style Itemize
        LabelString           "*"
        HTMLTag               ul
        HTMLItem              li
+       HTMLLabel             NONE
 End
 
 
index 787342de776a43f62af9f170e9ed7a0a7c278d3a..28085dbd6b1c1823267f06f8750c58f4bd17e83e 100644 (file)
@@ -302,6 +302,7 @@ private:
        /// descriptions, in which case it would be: dt. Another use is to
        /// customize the display of, say, the auto-generated label for 
        /// sections. Defaults to "span".
+       /// If set to "NONE", this suppresses the printing of the label.
        std::string htmllabel_;
        /// Attributes for the label. Defaults to: class="layoutnamelabel".
        std::string htmllabelattr_;
index 90204b2e82046327a83fea41a05c558812dc58bf..a27a9f4bf74d72752817e138eb3c42e942dce053 100644 (file)
@@ -307,11 +307,12 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
                                }
                                bool item_tag_opened = false;
                                bool const labelfirst = style.htmllabelfirst();
+                               bool madelabel = false;
                                if (isNormalEnv(style)) {
                                        // in this case, we print the label only for the first 
                                        // paragraph (as in a theorem).
                                        item_tag_opened = openItemTag(os, style);
-                                       if (par == pbegin) {
+                                       if (par == pbegin && style.htmllabel() != "NONE") {
                                                docstring const lbl = 
                                                                pbegin->expandLabel(style, buf.params(), false);
                                                if (!lbl.empty()) {
@@ -325,28 +326,30 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
                                }       else { // some kind of list
                                        if (!labelfirst)
                                                item_tag_opened = openItemTag(os, style);
-                                       if (style.labeltype == LABEL_MANUAL) {
-                                               bool const label_tag_opened = openLabelTag(os, style);
+                                       if (style.labeltype == LABEL_MANUAL
+                                           && style.htmllabel() != "NONE") {
+                                               madelabel = openLabelTag(os, style);
                                                sep = par->firstWordLyXHTML(os, runparams);
-                                               if (label_tag_opened)
+                                               if (madelabel)
                                                        closeLabelTag(os, style);
                                                os << '\n';
                                        }
-                                       else if (style.labeltype != LABEL_NO_LABEL) {
-                                               bool const label_tag_opened = openLabelTag(os, style);
+                                       else if (style.labeltype != LABEL_NO_LABEL
+                                                && style.htmllabel() != "NONE") {
+                                               madelabel = openLabelTag(os, style);
                                                os << par->expandLabel(style, buf.params(), false);
-                                               if (label_tag_opened)
+                                               if (madelabel)
                                                        closeLabelTag(os, style);
                                                os << '\n';
                                        }
                                        if (labelfirst)
                                                item_tag_opened = openItemTag(os, style);
-                                       else
-                                               os << "<span class='item'>";
+                                       else if (madelabel)
+                                               os << "<span class='" << style.name() << "inneritem'>";
                                }
                                par->simpleLyXHTMLOnePar(buf, os, runparams, 
                                        text.outerFont(distance(begin, par)), sep);
-                               if (!isNormalEnv(style) && labelfirst)
+                               if (!isNormalEnv(style) && !labelfirst && madelabel)
                                        os << "</span>";
                                ++par;
                                if (item_tag_opened) {