Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-92445

Markdown smashes nested formatting inside lists

    XMLWordPrintable

Details

    • Linux/X11
    • f1e60de665 (qt/qtbase/dev) f28570b2b7 (qt/qtbase/6.3) f28570b2b7 (qt/tqtc-qtbase/6.3) 32213f0043 (qt/qtbase/6.2) 32213f0043 (qt/tqtc-qtbase/6.2) fddb3358a3 (qt/tqtc-qtbase/5.15)

    Description

      The same sequence as in QTBUG-91222 (calling QTextDocument::setMarkdown and then QTextDocument::toHtml) fails on the following Markdown:

      List:
      1. **Bold** and plain
      2. `code` and plain
      

      producing the following HTML:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
      <html><head><meta name="qrichtext" content="1" /><style type="text/css">
      p, li { white-space: pre-wrap; }
      </style></head><body style=" font-family:'DejaVu Sans Semi-Condensed'; font-size:11pt; font-weight:400; font-style:normal;">
      <p style=" margin-top:7px; margin-bottom:7px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">List:</p>
      <ol style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-weight:600;" style=" margin-top:7px; margin-bottom:7px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Bold and plain</li>
      <li style=" font-family:'monospace';" style=" margin-top:7px; margin-bottom:7px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">code and plain</li></ol></body></html>
      

      Apparently, the nested formatting that starts in the beginning of the bullet gets added as the style of the bullet itself, even when it's not the entire bullet formatted; moreover, it leads to redefinition of the `style` attribute which is not even valid HTML. Can be reproduced with both ordered and unordered lists. Quotes (`>`) are unaffected, producing correctly nested span elements inside indented p elements (why those are not blockquote elements is a separate question).

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-92445
          # Subject Branch Project Status CR V

          Activity

            People

              srutledg Shawn Rutledge
              alexey.rusakov Alexey Rusakov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: