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

Text incorrectly renders bullet list points after a link

    XMLWordPrintable

Details

    • All
    • 41a1ff4e3 (dev)

    Description

      Consider the following simple QML file:

      import QtQuick
      Text {
          width: 800
          height: 600
          textFormat: Text.MarkdownText
          text: "- Foo\n- [Bar](https://qt.io)\n- Baz\n"
      }
       

      It basically works, however, the bullet point of the last list entry is incorrectly rendered in blue (i.e. the link color with which the text in the previous list item ended):

      Interestingly, using TextEdit does not yield this effect, i.e. the following works:

      import QtQuick
      import QtQuick.Controls
      
      TextEdit {
          width: 800
          height: 600
          textFormat: TextEdit.MarkdownText
          text: "- Foo\n- [Bar](https://qt.io)\n- Baz\n"
      }
       

      By the way, this issue is probably not tied to Markdown format. See also this bug report against my app: https://gitlab.com/rpdev/opentodolist/-/issues/575

      In my app, I am currently using another library to convert Markdown to HTML first and then use rich text rendering - which shows the same effect. I am currently working on this and trying to migrate to using Qt's internal Markdown rendering. When I use e.g. QTextDocument to convert Markdown to HTML first and then render it using a label, I also get the strange bullet point rendering, so it seems to be inherently in the rendering code of (read only) rich text.

      Attachments

        1. image-2023-02-20-21-56-54-687.png
          image-2023-02-20-21-56-54-687.png
          9 kB
        2. test.md
          0.0 kB
        3. text.qml
          0.1 kB
        4. textedit.qml
          0.2 kB
        5. text-rich.qml
          0.2 kB
        6. text-styled.qml
          0.2 kB

        Issue Links

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

          Activity

            People

              sami.shalayel Sami Shalayel
              mhoeher Martin Höher
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes