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

Tags in CSS comments break formatting

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.2
    • None

    Description

      If a tag (e.g. "<b/>") is used within a CSS comment in a "style"-section of the text set in TextEdit, the CSS formatting doesn't work anymore.

      import QtQuick
      
      Rectangle {
          TextEdit {
              id: myTextEdit
              textFormat: Text.RichText
              Component.onCompleted: {
                  // if "b" of "<b/>" is removed, the background color is working.
                  myTextEdit.text = '<style type="text/css">/*<b/>*/span { background: #1d2331; color: #d4d2c8 }</style><span>bug</span>'
          }
      }
      

      If the related CSS code is loaded from a separate CSS file, the bug doesn't occur.
      E.g.

      myTextEdit.text = '<link rel="stylesheet" type="text/css" href="bug.css"/><span>bug</span>'

      and bug.css containing:

      /*<b/>*/span { background: #1d2331; color: #d4d2c8 } 

      Attachments

        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
            qtackler John Devel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes