]> git.lyx.org Git - lyx.git/commitdiff
Add i, ii, iii, iv suffixes to CSS class as well in the case of itemizations
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 4 Dec 2022 19:34:29 +0000 (14:34 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 4 Dec 2022 19:34:29 +0000 (14:34 -0500)
src/Layout.cpp
src/output_xhtml.cpp

index 7578d155afb48451ce789302cee69f1fff7bfa77..88d5539d96bfefa2d93e30c3a4bb6c3e1ec93e78 100644 (file)
@@ -1825,9 +1825,9 @@ string const & Layout::htmlattr() const
 
 string const & Layout::htmlclass() const
 {
-       // If it's an enumeration, then we recalculate the class each time through
-       // unless it has been given explicitly. So we do nothing here.
-       if (htmlclass_.empty() && labeltype != LABEL_ENUMERATE)
+       // If it's an enumeration or itemize list, then we recalculate the class each
+       // time through (unless it has been given explicitly). So we do nothing here.
+       if (htmlclass_.empty() && labeltype != LABEL_ENUMERATE && labeltype != LABEL_ITEMIZE)
                htmlclass_ = defaultCSSClass();
        return htmlclass_;
 }
index 0c4bdb97176a35848a7cdb108e2efd2d6d278601..c812966b2ad9101e8752d24ef58b8fef219cb9fc 100644 (file)
@@ -408,16 +408,19 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
        depth_type const origdepth = pbegin->params().depth();
 
        // open tag for this environment
-       if (bstyle.labeltype == LABEL_ENUMERATE && bstyle.htmlclass().empty()) {
+       if ((bstyle.labeltype == LABEL_ENUMERATE || bstyle.labeltype == LABEL_ITEMIZE)
+               && bstyle.htmlclass().empty()) {
                // In this case, we have to calculate the CSS class ourselves, each time
                // through
-               // FIXME We assume in these cases that the standard enumeration counter
-               // is being used. (We also do not deal with 'resume' counters, though I'm
-               // not sure that can be done at all.)
+               // FIXME We assume in these cases that the standard counters are being used.
+               // (We also do not deal with 'resume' counters, though I'm not sure that can
+               // be done at all in HTML.)
 
-               // Code borrowed from Buffer::Impl::setLabel
+               // Code adapated from Buffer::Impl::setLabel
                docstring enumcounter = bstyle.counter.empty() ?
-                                       from_ascii("enum") : bstyle.counter;
+                                       (bstyle.labeltype == LABEL_ENUMERATE ?
+                                               from_ascii("lyxenum") : from_ascii("lyxitem") ) :
+                                       bstyle.counter;
                switch (par->itemdepth) {
                case 2:
                        enumcounter += 'i';