diff options
Diffstat (limited to 'src/gui/text/qtextdocumentfragment.cpp')
-rw-r--r-- | src/gui/text/qtextdocumentfragment.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp index f0eff2d4f3..aef4ea1522 100644 --- a/src/gui/text/qtextdocumentfragment.cpp +++ b/src/gui/text/qtextdocumentfragment.cpp @@ -43,7 +43,6 @@ #include "qtextlist.h" #include <qdebug.h> -#include <qtextcodec.h> #include <qbytearray.h> #include <qdatastream.h> #include <qdatetime.h> @@ -543,8 +542,10 @@ void QTextHtmlImporter::import() } } - if (currentNode->charFormat.isAnchor() && !currentNode->charFormat.anchorName().isEmpty()) { - namedAnchors.append(currentNode->charFormat.anchorName()); + if (currentNode->charFormat.isAnchor()) { + const auto names = currentNode->charFormat.anchorNames(); + if (!names.isEmpty()) + namedAnchors.append(names.constFirst()); } if (appendNodeText()) @@ -1140,7 +1141,8 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processBlockNode() // #################### // block.setFloatPosition(node->cssFloat); - if (wsm == QTextHtmlParserNode::WhiteSpacePre) { + if (wsm == QTextHtmlParserNode::WhiteSpacePre + || wsm == QTextHtmlParserNode::WhiteSpaceNoWrap) { block.setNonBreakableLines(true); modifiedBlockFormat = true; } |