Skip to content

Commit 0db0419

Browse files
committed
rustdoc: add comment for why playground URLs have unencoded angle brackets
1 parent e500c44 commit 0db0419

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustdoc/html/markdown.rs

+9
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,15 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
323323
|| c == b';'
324324
|| c == b':'
325325
|| c == b'?'
326+
// While these would be encoded if we used the URL
327+
// serializer algorithm, they don't actually need to be
328+
// encoded for the [query mode parser] to give the correct
329+
// result. The HTML [attribute parser] does the right
330+
// thing with them as well, as long as the attribute is
331+
// quoted (which it is).
332+
//
333+
// [query mode parser]: https://url.spec.whatwg.org/#query-state
334+
// [attribute parser]: https://html.spec.whatwg.org/#attribute-value-(double-quoted)-state
326335
|| c == b'<'
327336
|| c == b'>'
328337
// As described in urlencoded-parsing, the

0 commit comments

Comments
 (0)