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

QTextDocument fragments change when HTML id attribute is present

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.15.2, 6.1
    • GUI: Text handling
    • None
    • Windows 10
    • All, Windows

    Description

      We are parsing HTML content in order to sanitize the HTML for our application. We iterate over the QTextBlock items in the QTextDocument and then for each QTextBlock, we iterate over the QTextFragment items. When the HTML contains id attributes, the fragments are not broken down correctly. For example:

      <h1 id="header">Header</h1>

      Will produce two fragments with "H" and "eader" and the "H" fragment will be marked as an anchor element.

      Attachments

        1. HTMLParse.cpp
          2 kB
        2. HTMLParse.txt
          2 kB
        3. qtdiag.txt
          8 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hurlevent Oliver Eftevaag
            davesm David Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes