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

QTextCursor::insertHtml("<a name='1.2'>anchor</a>") produces <a name='1.2'></a>anchor instead of <a name='1.2'>anchor</a>

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.8.1, 5.3.1, 5.4.0 Alpha
    • GUI: Text handling
    • None
    • Windows 7 x64, MSVC 2013 x64 (qt 5.3.1)
      Gentoo Linux, x64, gcc 4.7.3 r1 p1.4, (qt 5.4 alpha, 4.8.1)

    Description

      Inserting an anchor into a QTextDocument using QTextCursor does not work as expected:
      QTextCursor::insertHtml("<a name='1.2'>anchor</p>") should result in a piece of html like the one input or eventually merged with <span>:
      [more html in doc]<a name='1.2'><span ... >anchor</span></a>[more html]
      but I get
      [more html in doc]<a name='1.2'></a><span ... >anchor</span>[more html]
      The closing tag is moved before the text to be embraced.
      This does work fine and as expected if <a href=..> is used instead of <a name=..>.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            pebu Peter Buttgereit
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes