diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2020-12-05 22:05:37 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2020-12-05 22:37:48 +0100 |
commit | acf932825bfe40d9a18046c9d304f4f14363a88a (patch) | |
tree | 09e97e7db12f06801548f1c93e7f05bb26fd6f68 /test/Tests/Readers/Org | |
parent | c161893f442a3e001b64af1421e9f62376d71c92 (diff) | |
download | pandoc-acf932825bfe40d9a18046c9d304f4f14363a88a.tar.gz |
Org reader: preserve targets of spurious links
Links with (internal) targets that the reader doesn't know about are
converted into emphasized text. Information on the link target is now
preserved by wrapping the text in a Span of class `spurious-link`, with
an attribute `target` set to the link's original target. This allows to
recover and fix broken or unknown links with filters.
See: #6916
Diffstat (limited to 'test/Tests/Readers/Org')
-rw-r--r-- | test/Tests/Readers/Org/Meta.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/Tests/Readers/Org/Meta.hs b/test/Tests/Readers/Org/Meta.hs index 041016f64..bc167f2a5 100644 --- a/test/Tests/Readers/Org/Meta.hs +++ b/test/Tests/Readers/Org/Meta.hs @@ -270,7 +270,8 @@ tests = , "Search links are read as emph" =: "[[Wally][Where's Wally?]]" =?> - para (emph $ "Where's" <> space <> "Wally?") + para (spanWith ("", ["spurious-link"], [("target", "Wally")]) + (emph $ "Where's" <> space <> "Wally?")) , "Link to nonexistent anchor" =: T.unlines [ "<<link-here>> Target." @@ -278,5 +279,6 @@ tests = , "[[link$here][See here!]]" ] =?> (para (spanWith ("link-here", [], []) mempty <> "Target.") <> - para (emph ("See" <> space <> "here!"))) + para (spanWith ("", ["spurious-link"], [("target", "link$here")]) + (emph ("See" <> space <> "here!")))) ] |