]> git.lyx.org Git - features.git/blobdiff - src/output_xhtml.cpp
Write magic paragraph label to main paragraph tag.
[features.git] / src / output_xhtml.cpp
index e960e2c5d53ea0f8ba846e612b5c6dcd60cd26b0..cc43e62c08f3bd44dadfa9353f69a85b6c02141b 100644 (file)
@@ -135,16 +135,13 @@ docstring EndTag::writeEndTag() const
 }
 
 
-docstring ParTag::writeTag() const
+ParTag::ParTag(std::string const & tag, std::string attr,
+       std::string const & parid)
+  : StartTag(tag)
 {
-       docstring output = StartTag::writeTag();
-
-       if (parid_.empty())
-               return output;
-
-       string const pattr = "id='" + parid_ + "'";
-       output += html::CompTag("a", pattr).writeTag();
-       return output;
+       if (!parid.empty())
+               attr += " id='" + parid + "'";
+       attr_ = attr;
 }
 
 
@@ -1057,14 +1054,24 @@ void makeCommand(Buffer const & buf,
                    documentClass().counters().step(style.counter, OutputUpdate);
 
        bool const make_parid = !runparams.for_toc && runparams.html_make_pars;
+       
+       if (style.labeltype == LABEL_ABOVE)
+               xs << html::StartTag("div")
+                  << pbegin->params().labelString()
+                  << html::EndTag("div");
+       else if (style.labeltype == LABEL_CENTERED)
+               xs << html::StartTag("div", "style = \"text-align: center;\"")
+                  << pbegin->params().labelString()
+                  << html::EndTag("div");
 
        openParTag(xs, style, pbegin->params(),
                   make_parid ? pbegin->magicLabel() : "");
 
        // Label around sectioning number:
        // FIXME Probably need to account for LABEL_MANUAL
-       // FIXME Probably also need now to account for labels ABOVE and CENTERED.
-       if (style.labeltype != LABEL_NO_LABEL) {
+       if (style.labeltype != LABEL_NO_LABEL &&
+           style.labeltype != LABEL_ABOVE &&
+           style.labeltype != LABEL_CENTERED ) {
                openLabelTag(xs, style);
                xs << pbegin->params().labelString();
                closeLabelTag(xs, style);