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

XML DOM lost spaces in QDomText/HTML

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.1, 5.6.0, 5.7.0
    • XML: DOM
    • None
    • windows, mac os.
    • macOS

    Description

      When I parse text data from xml like:
      <pp PX="0" CX="0">
      <tp CX="1">Hello</tp>
      <tp CX="0"> </tp>
      <tp CX="2">Moon</tp>
      </pp>
      In second tp node, there are three spaces, but in XML Dom, it's empty.
      QDomElement tpNode,
      tpNode.firstChild().toText().isNull() is true.

      This issue also exists in html parse.
      If use QTextDocument.setHtml("<p>Hello</p><p> </p><p>Moon</p>"),
      you will find there only two lines.

      All the spaces are ignored, maybe I missed something, anybody can help me?

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            ethan998 Ethan Huang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes