zig
zig copied to clipboard
std docs: bare urls are not linkified
Zig Version
0.12.0-dev.3212+40e64245f
Steps to Reproduce and Observed Behavior
https://ziglang.org/documentation/master/std/#std.ascii
Expected Behavior
https://en.wikipedia.org/wiki/ASCII#Character_set should be clickable.
- The file seems to be here: https://github.com/ziglang/zig/blob/master/lib/std/ascii.zig
- Zig seems to use commonmark: https://github.com/ziglang/zig/commit/d3eaa75c07aaac09d9dd74aa2a175ba799159faa
- The docs are here: https://spec.commonmark.org/0.31.2/#autolinks
- The syntax is:
<http://foo.bar.baz>
that implementation was deleted and replaced
edit: it seems that syntax is more widely supported anyway so we should update both the docs and the new parser
The new Autodoc Markdown implementation isn't Commonmark, it's a custom implementation that lives here: https://github.com/ziglang/zig/tree/master/lib/docs/wasm/markdown The syntax using <
should not be very hard to implement; the "raw URL" syntax probably isn't either, but there are some more questions about how to avoid ambiguity with trailing punctuation and parentheses. The GitHub flavored Markdown spec specifies this: https://github.github.com/gfm/#autolinks-extension- However, in my opinion, this is overcomplicated.
Personally, I think the <
syntax is probably fine, and it's sufficiently minimal while still being explicit and not accidentally linkifying things that shouldn't be. I should have some time later this weekend to try implementing that, unless someone else would like to do it first.
Upon further consideration (and considering the existing standard library doc comments as examples of what doc authors want), I decided to implement the "plain text" style as well in #19402.