]> git.lyx.org Git - lyx.git/blobdiff - src/output_xhtml.cpp
Fix yet another thinko in the math grid paste code
[lyx.git] / src / output_xhtml.cpp
index 428e6c7f72608186c6728d84a0dc4d6aa0acc4d8..3f8c0a43b1c7e484ec4fb241dea12616abfba9dd 100644 (file)
@@ -161,15 +161,18 @@ namespace {
 // convenience functions
 
 inline void openParTag(XMLStream & xs, Layout const & lay,
-                       std::string parlabel)
+                       const std::string & parlabel)
 {
-       xs << xml::ParTag(lay.htmltag(), lay.htmlattr(), parlabel);
+       string attrs = lay.htmlattr();
+       if (!parlabel.empty())
+               attrs += " id='" + parlabel + "'";
+       xs << xml::ParTag(lay.htmltag(), attrs);
 }
 
 
 void openParTag(XMLStream & xs, Layout const & lay,
                 ParagraphParameters const & params,
-                std::string parlabel)
+                const std::string & parlabel)
 {
        // FIXME Are there other things we should handle here?
        string const align = alignmentToCSS(params.align());
@@ -178,7 +181,9 @@ void openParTag(XMLStream & xs, Layout const & lay,
                return;
        }
        string attrs = lay.htmlattr() + " style='text-align: " + align + ";'";
-       xs << xml::ParTag(lay.htmltag(), attrs, parlabel);
+       if (!parlabel.empty())
+               attrs += " id='" + parlabel + "'";
+       xs << xml::ParTag(lay.htmltag(), attrs);
 }