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

Qt Quick TextEdit.insert() does not process Markdown text

    XMLWordPrintable

    Details

    • Commits:
      2118b7eb42 (qt/qtdeclarative/6.4) 7e6db64d43 (qt/qtdeclarative/dev) 2118b7eb42 (qt/tqtc-qtdeclarative/6.4) 7e6db64d43 (qt/tqtc-qtdeclarative/dev)

      Description

      Issue

      // Works: Text is rendered as rich text
      TextEdit {
          id: te1
          textFormat: TextEdit.RichText
          Component.onCompleted: te1.insert(te1.length, "<b>Hello</b> World")
      }

       

      // Does not work: Text is rendered as literal plaintext
      TextEdit {
          id: te2
          textFormat: TextEdit.MarkdownText
          Component.onCompleted: te2.insert(te2.length, "# Hello\n\nWorld")
      }

       

      Workaround

      Instead of calling insert(), use

      te2.text = te2.text + "# Hello\n\nWorld"

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              srutledg Shawn Rutledge
              Reporter:
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes