From 237fa21feef63884043bd6cf32682b2b08c78454 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 20 May 2019 12:58:36 +0200 Subject: Markdown and HTML: support image alt text and title It's a required CommonMark feature: https://spec.commonmark.org/0.29/#images and alt text is also required in HTML: https://www.w3.org/wiki/Html/Elements/img#Requirements_for_providing_text_to_act_as_an_alternative_for_images Now we are able to read these attributes from either html or markdown and rewrite either an html or markdown document that preserves them. This patch does not add viewing or editing support in QTextEdit etc. Change-Id: I51307389f8f9fc00809808390e583a83111a7b33 Reviewed-by: Gatis Paeglis --- tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp') diff --git a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp index acc74a9060..1935e58dec 100644 --- a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp +++ b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp @@ -416,6 +416,9 @@ void tst_QTextMarkdownWriter::fromHtml_data() QTest::newRow("block quote") << "

In 1958, Mahatma Gandhi was quoted as follows:

The Earth provides enough to satisfy every man's need but not for every man's greed.
" << "In 1958, Mahatma Gandhi was quoted as follows:\n\n> The Earth provides enough to satisfy every man's need but not for every man's\n> greed.\n\n"; + QTest::newRow("image") << + "\"foo\"" << + "![foo](/url \"title\")\n\n"; // TODO // QTest::newRow("escaped number and paren after double newline") << // "

(The first sentence of this paragraph is a line, the next paragraph has a number

13) but that's not part of an ordered list" << -- cgit v1.2.3