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

Markdown text is rendered outside of Text bounding box

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.8.0
    • None
    • macBookPro 2017 15'', Ventura 13.7.4
    • macOS

    Description

      If a Text element has `textFormat` set to `Text.MarkdownText` and `pixelSize` set to `80px` with the following text:

      ```

      1. Header

      1. List

      2. List

      ```

      the list items will be partially rendered outside of their bounding box, but the header will remain within bounds.
      Attached is a minimal reproduction code that contains a `Rectangle` with a child `Text` item. The rectangle's width and height are bound to `Text.contentWidth` and `Text.contentHeight`, respectively, along with a `TextEdit` to set the text on the `Text` item. There is also a slider to control the `pixelSize`. By moving the slider, the text size increases, causing some parts of the text to extend beyond the content size of the `Text` item.

      One possible workaround is to set the pixel size to a constant value (e.g., 35px) and use `scale` to change the size. But I think is kind of not a right way to control the font size.

      Attachments

        1. MarkdownTest.zip
          5 kB
          Siarhei Darhel
        2. Screenshot 2025-03-31 at 18.33.59.png
          66 kB
          Siarhei Darhel
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            duodargel.cordeperil Siarhei Darhel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes