diff --git a/commonmark-extensions/src/Commonmark/Extensions/Wikilinks.hs b/commonmark-extensions/src/Commonmark/Extensions/Wikilinks.hs index a17b711..01f64aa 100644 --- a/commonmark-extensions/src/Commonmark/Extensions/Wikilinks.hs +++ b/commonmark-extensions/src/Commonmark/Extensions/Wikilinks.hs @@ -23,7 +23,7 @@ class HasWikilinks il where wikilink :: Text -> il -> il instance Rangeable (Html a) => HasWikilinks (Html a) where - wikilink url il = link url "wikilink" il + wikilink url il = addAttribute ("class", "wikilink") $ link url "" il instance (HasWikilinks il, Semigroup il, Monoid il) => HasWikilinks (WithSourceMap il) where diff --git a/commonmark-extensions/test/wikilinks_title_after_pipe.md b/commonmark-extensions/test/wikilinks_title_after_pipe.md index efa783c..bc4186b 100644 --- a/commonmark-extensions/test/wikilinks_title_after_pipe.md +++ b/commonmark-extensions/test/wikilinks_title_after_pipe.md @@ -10,25 +10,25 @@ With this version of wikilinks, the title comes after the pipe. ```````````````````````````````` example [[https://example.org]] . -
+ ```````````````````````````````` ```````````````````````````````` example [[https://example.org|title]] . - + ```````````````````````````````` ```````````````````````````````` example [[Name of page]] . - + ```````````````````````````````` ```````````````````````````````` example [[Name of page|Title]] . - + ```````````````````````````````` HTML entities are recognized both in the name of page and in the link title. @@ -36,5 +36,5 @@ HTML entities are recognized both in the name of page and in the link title. ```````````````````````````````` example [[Geschütztes Leerzeichen|Über ]] . - + ```````````````````````````````` diff --git a/commonmark-extensions/test/wikilinks_title_before_pipe.md b/commonmark-extensions/test/wikilinks_title_before_pipe.md index 40e036f..cba385c 100644 --- a/commonmark-extensions/test/wikilinks_title_before_pipe.md +++ b/commonmark-extensions/test/wikilinks_title_before_pipe.md @@ -10,25 +10,25 @@ With this version of wikilinks, the title comes before the pipe. ```````````````````````````````` example [[https://example.org]] . - + ```````````````````````````````` ```````````````````````````````` example [[title|https://example.org]] . - + ```````````````````````````````` ```````````````````````````````` example [[Name of page]] . - + ```````````````````````````````` ```````````````````````````````` example [[Title|Name of page]] . - + ```````````````````````````````` Regular links should still work! @@ -44,5 +44,5 @@ HTML entities are recognized both in the name of page and in the link title. ```````````````````````````````` example [[Über |Geschütztes Leerzeichen]] . - + ```````````````````````````````` diff --git a/commonmark-pandoc/src/Commonmark/Pandoc.hs b/commonmark-pandoc/src/Commonmark/Pandoc.hs index dddac2b..a3eb108 100644 --- a/commonmark-pandoc/src/Commonmark/Pandoc.hs +++ b/commonmark-pandoc/src/Commonmark/Pandoc.hs @@ -120,7 +120,7 @@ instance HasEmoji (Cm b B.Inlines) where $ B.text t instance HasWikilinks (Cm b B.Inlines) where - wikilink t il = Cm $ B.link t "wikilink" $ unCm il + wikilink t il = Cm $ B.linkWith (mempty, ["wikilink"], mempty) t "" $ unCm il instance HasPipeTable (Cm a B.Inlines) (Cm a B.Blocks) where pipeTable aligns headerCells rows =