@@ -34,7 +34,10 @@ testBareLink (inp, ils) =
3434 inp (inp, doc $ para ils)
3535
3636autolink :: String -> Inlines
37−autolink s = link s "" (str s)
37+autolink = autolinkWith nullAttr
38+
39+autolinkWith :: Attr -> String -> Inlines
40+autolinkWith attr s = linkWith attr s "" (str s)
3841
3942bareLinkTests :: [(String, Inlines)]
4043bareLinkTests =
@@ -217,6 +220,12 @@ tests = [ testGroup "inline code"
217220 , "a partial URL (#2277)" =:
218221 "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>" =?>
219222 para (text "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>")
223+ , "with some attributes" =:
224+ "<http://foo.bar>{#i .j .z k=v}" =?>
225+ para (autolinkWith ("i", ["j", "z"], [("k", "v")]) "http://foo.bar")
226+ , "with some attributes and spaces" =:
227+ "<http://foo.bar> {#i .j .z k=v}" =?>
228+ para (autolink "http://foo.bar" <> space <> text "{#i .j .z k=v}")
220229 ]
221230 , testGroup "links"
222231 [ "no autolink inside link" =: