]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - doc/bugs/discount_stopped_rendering_markdown_links.mdwn
New upstream version 3.20180311
[git.ikiwiki.info.git] / doc / bugs / discount_stopped_rendering_markdown_links.mdwn
diff --git a/doc/bugs/discount_stopped_rendering_markdown_links.mdwn b/doc/bugs/discount_stopped_rendering_markdown_links.mdwn
new file mode 100644 (file)
index 0000000..cfe544b
--- /dev/null
@@ -0,0 +1,41 @@
+# What I did
+
+Upgraded from 3.20180105 to 3.20180228 (from pkgsrc).
+No change to installed Text::Markdown::Discount (0.11nb4 from pkgsrc, using upstream's bundled Discount library).
+
+# What I expected to happen
+
+Markdown-style links to continue being rendered as before.
+
+# What actually happened
+
+Markdown-style links stopped being links.
+Instead, they render the part in square brackets as ordinary text.
+
+# Proximate cause
+
+In [f46e429](http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=f46e429d96ead32943cb2670d7686df8c77de361), if I comment out the `MKD_GITHUBTAGS` if block, the problem goes away.
+
+# Further causes and possible solutions
+
+Some guesses:
+
+- Sufficiently old versions of the Discount library may break when passed unrecognized flags, in which case ikiwiki might want to version-check before passing flags
+- The version of the Discount library bundled with upstream Text::Markdown::Discount may be extremely old, in which case pkgsrc might want to make it depend instead on an external Discount package
+
+> This appears to be because `MKD_GITHUBTAGS` and `MKD_LATEX` both have numeric values that
+> were previously used for the internal flag `IS_LABEL`, which strips HTML (its value has
+> changed a couple of times).
+>
+> Having thought about this a bit, I realise I can probe for the values of these flags by
+> processing HTML that should have different results with the flag set or unset, which
+> would be safer than just blindly using them.
+>
+> Orthogonally, pkgsrc should probably use an up-to-date version of Discount, and
+> [we already know that Text::Markdown::Discount needs updating](https://rt.cpan.org/Public/Bug/Display.html?id=124188).
+> --[[smcv]]
+
+>> This should be [[fixed|done]] in current git. The mdwn module now
+>> detects what your version of Discount supports by trying several
+>> short HTML fragments that render differently under the different
+>> flags. --[[smcv]]