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

Text incorrectly renders bullet list points after a link

    XMLWordPrintable

Details

    • All

    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
          9 kB
          Martin Höher
        2. test.md
          0.0 kB
          Shawn Rutledge
        3. text-rich.qml
          0.2 kB
          Shawn Rutledge
        4. text-styled.qml
          0.2 kB
          Shawn Rutledge
        5. textedit.qml
          0.2 kB
          Shawn Rutledge
        6. text.qml
          0.1 kB
          Shawn Rutledge

        Issue Links

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              mhoeher Martin Höher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: