summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-01-31 14:32:24 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-02-03 14:58:06 +0100
commit2d265dce58d26047f196d79eabfe41edab45c799 (patch)
treeadc89bf20f21399a2e0709c24382deea0d0c9778 /tests/auto
parentc29fac453f3eaac73b29eb0a66d130220d073fc6 (diff)
Markdown importer: properly set hyperlinks
The "title" in markdown is the tooltip, not the name attribute of a link. Also, tell the char format that it's an anchor. Change-Id: I2978848ec6705fe16376d6fe17f31007cce4b801 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/data/links.md25
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp1
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/data/links.md b/tests/auto/gui/text/qtextmarkdownwriter/data/links.md
new file mode 100644
index 0000000000..33cdb2b3ab
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownwriter/data/links.md
@@ -0,0 +1,25 @@
+A series of links.
+
+[link](/uri)
+
+[link]()
+
+[link](/uri "title")
+
+[link](/uri "àbcdè")
+
+[link](/uri "title title \" title title")
+
+[link](/url "title \"&quot;")
+
+[link](/url "title
+title
+title title
+\"title\" title \"
+title")
+
+* [link](/url "title")
+* [link](/url)
+* [link](/url "title
+title title")
+* nonlink
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
index d15e856a20..31592c7f0f 100644
--- a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
+++ b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
@@ -368,6 +368,7 @@ void tst_QTextMarkdownWriter::rewriteDocument_data()
QTest::newRow("example") << "example.md";
QTest::newRow("list items after headings") << "headingsAndLists.md";
QTest::newRow("word wrap") << "wordWrap.md";
+ QTest::newRow("links") << "links.md";
}
void tst_QTextMarkdownWriter::rewriteDocument()