Closed rachfop closed 1 year ago
Hey @rachfop, funny, I just ran into this myself today while trying to format https://github.com/google/comprehensive-rust :smile:
Yeah, it's the [T]
.
Hey @dsherret,
I tried to read (eh, skim) of the CommonMark spec and it only mentions percent-encoding briefly:
Note that not every feature of the HTML samples is mandated by the spec. For example, the spec says what counts as a link destination, but it doesn’t mandate that non-ASCII characters in the URL be percent-encoded. To use the automatic tests, implementers will need to provide a renderer that conforms to the expectations of the spec examples (percent-encoding non-ASCII characters in URLs). But a conforming implementation can use a different renderer and may choose not to percent-encode non-ASCII characters in URLs.
I think this says files with both encoded and non-encoded URLs are okay in the sense that they're valid CommonMark files (and further, a "renderer" should probably percent-encode things like [T]
in a URL so that it's useful for people).
Based on this, I think it would be great if the plugin could accept and pretty-print URLs that are not percent-encoded.
I had a condition that would error when the link reference definition had a [
in it in order to notify me about unexpected scenarios. I just removed it in #73.
This is fixed now in 0.15.2. I also opened a downstream PR in Deno with this fix https://github.com/denoland/deno/pull/17352
Thank you!
Wow, that was fast!
Describe the bug When using a Rust link as a footnote (described below), the formatter believes that it is formatted incorrectly. I believe it has to do with the
[T]
– but that is a valid URL.dprint-plugin-markdown version: x.x.x
Input Code
Expected Output
Actual Output