aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Hoffmann <brennan.brisad@gmail.com>2021-07-07 01:06:29 +0200
committerGitHub <noreply@github.com>2021-07-06 16:06:29 -0700
commite56e2b0e0be9256ddef798d28f5d2af6e756508d (patch)
treec2b5645a48f2cac569c990eef8659dfd8e0f79c1 /test
parente7f8cc57866b61ed354c4c3812aaced33832a0e0 (diff)
downloadpandoc-e56e2b0e0be9256ddef798d28f5d2af6e756508d.tar.gz
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.
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Readers/HTML.hs6
1 files changed, 6 insertions, 0 deletions
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" $ "<a name=\"anchor\"/>" =?>
plain (spanWith ("anchor",[],[]) mempty)
]
+ , testGroup "img"
+ [ test html "data-external attribute" $ "<img data-external=\"1\" src=\"http://example.com/stickman.gif\">" =?>
+ plain (imageWith ("", [], [("external", "1")]) "http://example.com/stickman.gif" "" "")
+ , test html "title" $ "<img title=\"The title\" src=\"http://example.com/stickman.gif\">" =?>
+ plain (imageWith ("", [], []) "http://example.com/stickman.gif" "The title" "")
+ ]
, testGroup "lang"
[ test html "lang on <html>" $ "<html lang=\"es\">hola" =?>
setMeta "lang" (text "es") (doc (plain (text "hola")))