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

QTextDocument fragments change when HTML id attribute is present

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Invalid
    • Affects Version/s: 5.15.2, 6.1
    • Fix Version/s: None
    • Component/s: GUI: Text handling
    • Labels:
      None
    • Environment:
      Windows 10
    • Platform/s:
      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
        For Gerrit Dashboard: QTBUG-95041
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            hurlevent Oliver Eftevaag
            Reporter:
            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