From e56e2b0e0be9256ddef798d28f5d2af6e756508d Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Wed, 7 Jul 2021 01:06:29 +0200 Subject: Recognize data-external when reading HTML img tags (#7429) Preserve all attributes in img tags. If attributes have a `data-` prefix, it will be stripped. In particular, this preserves a `data-external` attribute as an `external` attribute in the pandoc AST. --- test/Tests/Readers/HTML.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index 9bf567194..4ed1e44af 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -74,6 +74,12 @@ tests = [ testGroup "base tag" [ test html "anchor without href" $ "" =?> plain (spanWith ("anchor",[],[]) mempty) ] + , testGroup "img" + [ test html "data-external attribute" $ "" =?> + plain (imageWith ("", [], [("external", "1")]) "http://example.com/stickman.gif" "" "") + , test html "title" $ "" =?> + plain (imageWith ("", [], []) "http://example.com/stickman.gif" "The title" "") + ] , testGroup "lang" [ test html "lang on " $ "hola" =?> setMeta "lang" (text "es") (doc (plain (text "hola"))) -- cgit v1.2.3