commonmark-extensions 0.2.5.6 → 0.2.6
raw patch · 6 files changed
+22/−14 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changelog.md +8/−0
- commonmark-extensions.cabal +2/−2
- src/Commonmark/Extensions/Wikilinks.hs +1/−1
- test/test-commonmark-extensions.hs +1/−1
- test/wikilinks_title_after_pipe.md +5/−5
- test/wikilinks_title_before_pipe.md +5/−5
changelog.md view
@@ -1,5 +1,13 @@ # Changelog for commonmark-extensions +## 0.2.6++ * Track wikilinks with a class instead of the title (Evan+ Silberman). The use of title="wikilink" in HTML output traces+ back to Pandoc's hijacking of the title attribute for this purpose+ back when Pandoc links didn't have Attrs. A coordinated change in+ Pandoc moves this more appropriately into a class.+ ## 0.2.5.6 * Autolink parser: track balanced brackets in path (improves
commonmark-extensions.cabal view
@@ -1,5 +1,5 @@ name: commonmark-extensions-version: 0.2.5.6+version: 0.2.6 synopsis: Pure Haskell commonmark parser. description: This library provides some useful extensions to core commonmark@@ -84,7 +84,7 @@ Commonmark.Extensions.RebaseRelativePaths Commonmark.Extensions.Wikilinks Commonmark.Extensions.Alerts- ghc-options: -Wall -fno-warn-unused-do-bind -funbox-small-strict-fields+ ghc-options: -Wall -fno-warn-deriving-typeable -fno-warn-unused-do-bind -funbox-small-strict-fields if impl(ghc >= 8.10) ghc-options: -Wunused-packages if impl(ghc >= 8.8)
src/Commonmark/Extensions/Wikilinks.hs view
@@ -23,7 +23,7 @@ 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
test/test-commonmark-extensions.hs view
@@ -61,7 +61,7 @@ spectests <- getSpecTests fp let spectestgroups = groupBy (\t1 t2 -> section t1 == section t2) spectests- let spectestsecs = [(section (head xs), xs) | xs <- spectestgroups]+ let spectestsecs = [(section x, x:xs) | x:xs <- spectestgroups] let parser = runIdentity . parseCommonmarkWith (syntaxspec <> defaultSyntaxSpec) return $ testGroup fp $
test/wikilinks_title_after_pipe.md view
@@ -10,25 +10,25 @@ ```````````````````````````````` example [[https://example.org]] .-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>+<p><a class="wikilink" href="https://example.org">https://example.org</a></p> ```````````````````````````````` ```````````````````````````````` example [[https://example.org|title]] .-<p><a href="https://example.org" title="wikilink">title</a></p>+<p><a class="wikilink" href="https://example.org">title</a></p> ```````````````````````````````` ```````````````````````````````` example [[Name of page]] .-<p><a href="Name%20of%20page" title="wikilink">Name of page</a></p>+<p><a class="wikilink" href="Name%20of%20page">Name of page</a></p> ```````````````````````````````` ```````````````````````````````` example [[Name of page|Title]] .-<p><a href="Name%20of%20page" title="wikilink">Title</a></p>+<p><a class="wikilink" href="Name%20of%20page">Title</a></p> ```````````````````````````````` HTML entities are recognized both in the name of page and in the link title.@@ -36,5 +36,5 @@ ```````````````````````````````` example [[Geschütztes Leerzeichen|Über &nbsp;]] .-<p><a href="Gesch%C3%BCtztes%20Leerzeichen" title="wikilink">Über &nbsp;</a></p>+<p><a class="wikilink" href="Gesch%C3%BCtztes%20Leerzeichen">Über &nbsp;</a></p> ````````````````````````````````
test/wikilinks_title_before_pipe.md view
@@ -10,25 +10,25 @@ ```````````````````````````````` example [[https://example.org]] .-<p><a href="https://example.org" title="wikilink">https://example.org</a></p>+<p><a class="wikilink" href="https://example.org">https://example.org</a></p> ```````````````````````````````` ```````````````````````````````` example [[title|https://example.org]] .-<p><a href="https://example.org" title="wikilink">title</a></p>+<p><a class="wikilink" href="https://example.org">title</a></p> ```````````````````````````````` ```````````````````````````````` example [[Name of page]] .-<p><a href="Name%20of%20page" title="wikilink">Name of page</a></p>+<p><a class="wikilink" href="Name%20of%20page">Name of page</a></p> ```````````````````````````````` ```````````````````````````````` example [[Title|Name of page]] .-<p><a href="Name%20of%20page" title="wikilink">Title</a></p>+<p><a class="wikilink" href="Name%20of%20page">Title</a></p> ```````````````````````````````` Regular links should still work!@@ -44,5 +44,5 @@ ```````````````````````````````` example [[Über &nbsp;|Geschütztes Leerzeichen]] .-<p><a href="Gesch%C3%BCtztes%20Leerzeichen" title="wikilink">Über &nbsp;</a></p>+<p><a class="wikilink" href="Gesch%C3%BCtztes%20Leerzeichen">Über &nbsp;</a></p> ````````````````````````````````