Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.15.7, 6.3.0 Beta2
-
None
-
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.