@@ -344,6 +344,26 @@ tests =
344344 ] =?>
345345 blockQuote (para "* Hi")
346346 ]
347+ , testGroup "Anchors"
348+ [ "Anchor" =:
349+ T.unlines [ "; A comment to make sure anchor is not parsed as a directive"
350+ , "#anchor Target"
351+ ] =?>
352+ para (spanWith ("anchor", [], []) mempty <> "Target")
353+ , "Anchor cannot start with a number" =:
354+ T.unlines [ "; A comment to make sure anchor is not parsed as a directive"
355+ , "#0notanchor Target"
356+ ] =?>
357+ para "#0notanchor Target"
358+ , "Not anchor if starts with a space" =:
359+ " #notanchor Target" =?>
360+ para "#notanchor Target"
361+ , "Anchor inside a paragraph" =:
362+ T.unlines [ "Paragraph starts here"
363+ , "#anchor and ends here."
364+ ] =?>
365+ para ("Paragraph starts here " <> spanWith ("anchor", [], []) mempty <> "and ends here.")
366+ ]
347367 , testGroup "Footnotes"
348368 [ "Simple footnote" =:
349369 T.unlines [ "Here is a footnote[1]."