Repository navigation
fix(docs): show the tutorials link on 2.39 - #32328
Conversation
The note inside the tutorials index's <children> block wraps its URL in angle brackets. The whole block is raw HTML, so Markdown isn't parsed there and the URL is read as an <https> tag, which the docs sanitizer deletes: the published 2.39 page drops the URL from the sentence. Plain text keeps it. docs-engine is adding a sync check that fails a strict build on such tags, and 2.39 is the strict line, so the next 2.39 docs build would stop here. Assisted-by: AI
|
👋 Hey @nickvigilante! This PR is targeting the Only bug fixes should be cherry-picked to release branches. If this is a bug fix, please update the PR title to match the conventional commit format: If this is not a bug fix, it likely should not target a release branch. |
|
|
||
| <children> | ||
| This page is rendered on <https://coder.com/docs/tutorials>. Refer to the other documents in the `docs/tutorials/` directory for specific employee-written guides. | ||
| This page is rendered on https://coder.com/docs/tutorials. Refer to the other documents in the `docs/tutorials/` directory for specific employee-written guides. |
There was a problem hiding this comment.
I think you can still use actual markup with rehypeSanitizeCoderDocs , at least by default. I haven't tried this out, but we may be able to make this an <a> tag (and perhaps even the backticks a <code> tag)
There was a problem hiding this comment.
Good call, tested and applied in d9d8137. Inside <children> the <a> and <code> both survive the sanitizer: rendered through the engine pipeline, the note now has a working link and the path as code, where before it read "rendered on ." with literal backticks (matching the live page). The strict 2.39 sync with the new placeholder check passes too.
The <children> block is raw HTML, so Markdown inside it isn't parsed: the URL in angle brackets was read as an <https> tag and deleted, and the backticks showed literally. HTML elements do survive there, so use an <a> for the URL and <code> for the path, which renders a working link instead of plain text. Assisted-by: AI
The tutorials index on 2.39 has a note inside its
<children>block with the URL written as<https://coder.com/docs/tutorials>. The whole block is raw HTML, so Markdown isn't parsed inside it: the URL is read as an HTML tag namedhttps, which the docs sanitizer deletes, and the backticks around the path show literally. The published page reads "This page is rendered on . Refer to the other documents in the `docs/tutorials/` directory…". HTML elements do survive in that block (thanks to Jeremy for the suggestion), so this uses an<a>for the URL and<code>for the path. The file no longer exists onmain, so this change is forrelease/2.39only.It also unblocks coder/docs-engine#357, which adds a sync check that fails a strict docs build when prose contains a tag the sanitizer would silently delete. 2.39 is the current release and builds strictly, so without this fix the next 2.39 docs publish would stop on this line once that check lands. 2.38 has the same line but builds leniently, so there it's only a warning.
Testing:
release/2.39. Before this change, it fails with1 unknown tag(s) in prose that the sanitizer deletes ... tutorials/index.md:9 <https>. After, it passes.https://coder.com/docs/tutorialsand the path as code.🤖 Built with AI assistance.