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

markdown fenced code blocks end with unnecessary blank lines

    XMLWordPrintable

Details

    • ff153d9874 (qt/qtbase/dev) 567340e122 (qt/qtbase/6.3) 567340e122 (qt/tqtc-qtbase/6.3) ff153d9874 (qt/tqtc-qtbase/dev) 567340e122 (qt/qtbase/6.3.1)

    Description

      You can read markdown like this

      ```
      one line only
      ```
      

      and in the QTextBrowser/QTextEdit, there is already an extra blank line, which is an extra QTextBlock. It's visible if there is any special highlighting of code blocks in the editor (which can be done by making a subclass of QSyntaxHighlighter, as in https://github.com/ec1oud/nettebook/commit/ececcd6d04f22e3764ee6b90e5520495a18e9f48 ). And when you rewrite the markdown, this comes through as an extra blank line before the ending fence, but in html it's worse: something like

      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'monospace';">one line only</span></pre>
      <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'monospace';"><br /></pre>
      

      that is, a whole extra <pre> tag with all the cruft that comes with it. The blank line should be treated as part of the single <pre> if it's there; but in fact it shouldn't be there at all.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews