mmark-md / mmark-ext Goto Github PK
View Code? Open in Web Editor NEWCommonly useful extensions for the MMark markdown processor
License: Other
Commonly useful extensions for the MMark markdown processor
License: Other
This package fails to build with nix, which also makes mmark
fail, and thus rib
, and thus my website. Here is the output of cabal test
:
Failures:
tests/Text/MMark/Extension/TestUtils.hs:30:3:
1) Text.MMark.Extension.LinkTarget.linkTarget, when link title starts with a target, when there is nothing but the target in title, works as intended, no title attribute produced
expected: "<p><a href=\"/url\" target=\"_blank\">link</a></p>\n"
but got: "<p><a target=\"_blank\" href=\"/url\">link</a></p>\n"
To rerun use: --match "/Text.MMark.Extension.LinkTarget/linkTarget/when link title starts with a target/when there is nothing but the target in title/works as intended, no title attribute produced/"
tests/Text/MMark/Extension/TestUtils.hs:30:3:
2) Text.MMark.Extension.LinkTarget.linkTarget, when link title starts with a target, when there is also a title, works as intended, target is stripped from the title
expected: "<p><a href=\"/url\" title=\"something\" target=\"_blank\">link</a></p>\n"
but got: "<p><a target=\"_blank\" href=\"/url\" title=\"something\">link</a></p>\n"
To rerun use: --match "/Text.MMark.Extension.LinkTarget/linkTarget/when link title starts with a target/when there is also a title/works as intended, target is stripped from the title/"
tests/Text/MMark/Extension/TestUtils.hs:30:3:
3) Text.MMark.Extension.ObfuscateEmail.obfuscateEmail, when URI has the mailto scheme, produces the correct HTML
expected: "<p><a href=\"javascript:void(0)\" data-email=\"[email protected]\" class=\"foo\">Enable JavaScript to see this email</a></p>\n"
but got: "<p><a class=\"foo\" data-email=\"[email protected]\" href=\"javascript:void(0)\">Enable JavaScript to see this email</a></p>\n"
To rerun use: --match "/Text.MMark.Extension.ObfuscateEmail/obfuscateEmail/when URI has the mailto scheme/produces the correct HTML/"
Randomized with seed 1167889213
Finished in 0.4321 seconds
39 examples, 3 failures
Test suite tests: FAIL
Test suite logged to:
/home/jon/Code/mmark-ext/dist-newstyle/build/x86_64-linux/ghc-8.10.7/mmark-ext-0.2.1.3/t/tests/test/mmark-ext-0.2.1.3-tests.log
0 of 1 test suites (0 of 1 test cases) passed.
cabal: Tests failed for test:tests from mmark-ext-0.2.1.3.
I'm not sure which dependency changed, but in Stackage I noticed this failure:
Failures:
tests/Text/MMark/Extension/TestUtils.hs:30:10:
1) Text.MMark.Extension.ObfuscateEmail.obfuscateEmail, when URI has the mailto scheme, produces the correct HTML
expected: "<p><a class=\"foo\" data-email=\"[email protected]\" href=\"javascript:void(0)\">Enable JavaScript to see this email</a></p>\n"
but got: "<p><a class=\"foo\" data-email=\"me%40example.org\" href=\"javascript:void%280%29\">Enable JavaScript to see this email</a></p>\n"
To rerun use: --match "/Text.MMark.Extension.ObfuscateEmail/obfuscateEmail/when URI has the mailto scheme/produces the correct HTML/"
Since this seems to be a non-breaking change, I'm going to temporarily mark this as an expected test failure. If/when you fix the test suite, if you could send a ping so we can change that back that would be great!
In the Stackage Nightly build with ghc-8.10.4, seeing some testsuite failures for mmark-ext-0.2.1.2:
tests/Text/MMark/Extension/TestUtils.hs:26:3:
1) Text.MMark.Extension.FontAwesome.fontAwesome, when URI has some other scheme, produces the correct HTML
expected: "<p><a href=\"https://example.org/\">https://example.org/</a></p>\n"
but got: "<p><a href=\"https://example.org\">https://example.org</a></p>\n"
To rerun use: --match "/Text.MMark.Extension.FontAwesome/fontAwesome/when URI has some other scheme/produces the correct HTML/
"
tests/Text/MMark/Extension/TableOfContentsSpec.hs:25:7:
2) Text.MMark.Extension.TableOfContents.toc works
expected: "<h1 id=\"lorem-ipsum\">Lorem ipsum</h1>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer varius mi\norci, rhoncus ornare nunc tincidunt nec. Aliquam cursus posuere ornare.\nQuisque posuere euismod nunc, sed pellentesque metus hendrerit eu. Donec\nscelerisque accumsan ante quis interdum. Nullam nec mauris dolor. Lorem\nipsum dolor sit amet, consectetur ....
:
:
It should just add target="_blank"
attribute.
Ping @mrkkrp
tests/Text/MMark/Extension/CommonSpec.hs:101:
1) Text.MMark.Extension.Common.toc works
The expected/actual diff is huge so not included here. When I repro'd locally, though, I did notice that the "actual" section had some \n
characters which the "expected" section did not.
<!-- expected -->
...
<ul>\n<li><a href=\"#nullam-luctus\">Nullam luctus</a><ul>\n<li><a href=\"#sed-euismod\">Sed euismod</a><ul>\n<li><a href=\"#curabitur-ullamcorper\">Curabitur ullamcorper</a><ul>\n<li><a href=\"#ut-dictum-quis\">Ut dictum quis</a><ul>\n<li><a href=\"#mauris-efficitur\">Mauris efficitur</a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li><a href=\"#aenean-auctor-nec\">Aenean auctor nec</a></li>\n</ul>
...
<!-- actual -->
...
<ul>\n<li>\n<a href=\"#nullam-luctus\">Nullam luctus</a>\n<ul>\n<li>\n<a href=\"#sed-euismod\">Sed euismod</a>\n<ul>\n<li>\n<a href=\"#curabitur-ullamcorper\">Curabitur ullamcorper</a>\n<ul>\n<li>\n<a href=\"#ut-dictum-quis\">Ut dictum quis</a>\n<ul>\n<li>\n<a href=\"#mauris-efficitur\">Mauris efficitur</a>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>\n<a href=\"#aenean-auctor-nec\">Aenean auctor nec</a>\n</li>\n</ul>
...
Here's how I reproduced locally:
$ stack unpack mmark-ext-0.0.1.0 && cd mmark-ext-0.0.1.0
$ vi stack.yaml # added the following stack.yaml
$ stack test
# stack.yaml
resolver: nightly-2017-12-07
extra-deps:
- mmark-0.0.2.0
Probably take the context as Aeson's Value
and do something similar to what we do in stache
.
$ mmark --ext-punctuation
*Hello...*
<p><em>Hello...</em></p>
$ mmark --ext-punctuation
Hello...
<p>Hello…</p>
cabal test --constraint 'hashable<1.3.1.0'
1) Text.MMark.Extension.ObfuscateEmail.obfuscateEmail, when URI has the mailto scheme, produces the correct HTML
expected: "<p><a href=\"javascript:void(0)\" data-email=\"[email protected]\" class=\"foo\">Enable JavaScript to see this email</a></p>\n"
but got: "<p><a href=\"javascript:void(0)\" class=\"foo\" data-email=\"[email protected]\">Enable JavaScript to see this email</a></p>\n"
To rerun use: --match "/Text.MMark.Extension.ObfuscateEmail/obfuscateEmail/when URI has the mailto scheme/produces the correct HTML/"
I'm not sure what is going on here. https://www.stackage.org/nightly-2021-03-14 uses hashable-1.3.0.0, mmark-ext-0.2.1.3, mmark-0.0.7.2. Did some other dependency get updated to cause this?
Similar to what anchor.js does.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.