Neutralize Hugo shortcode delimiters in generated code examples#11206
Neutralize Hugo shortcode delimiters in generated code examples#11206rgharris wants to merge 1 commit into
Conversation
Registry Review — PR #11206Scope: SummarySolid, surgical fix for the Hugo shortcode-parsing failure described in #11205. The approach — neutralize Findings1.
|
Stop Hugo from misreading shortcode delimiters inside generated fenced code examples, which was aborting the entire site build.
resourcedocsgen now neutralizes Hugo shortcode delimiters ({{% and {{<) that appear inside fenced code blocks when emitting .md files. Hugo parses shortcodes even inside code fences, so an example snippet like {{%s|token}} (Dynatrace credential-vault syntax plus a Java String.format placeholder) was read as a call to a shortcode named "s", failing the build with 'template for shortcode "s" not found'.
The rewrite is restricted to fence interiors, so legitimate hand-authored shortcodes ({{< chooser >}} / {{% choosable %}}, which only wrap fences from the outside) are untouched. Inline code spans and 4-space-indented code blocks are intentionally outside this change because the current generator surface emits fenced examples.
Neutralization inserts a single space after {{. It needs no delimiter pairing (the offending text often has no matching %}}) and is idempotent. Tradeoff: the inserted space changes the rendered example, so a copied snippet carries an extra space (Bearer {{ %s|token}}). That is harmless to the Java String.format call, but Dynatrace would not accept the resulting vault reference if pasted verbatim. We accept this cosmetic cost over a failing build.
Surfaced by #11191 (auto-filed workflow failure for the dynatrace@v0.35.2 bump, PR #11190). The offending {{%s|token}} examples are new in that version (0 occurrences in v0.34.0, 8 in v0.35.2), so the build fails deterministically until this lands on master.
Closes #11205
0aef8cf to
2e4dca4
Compare
|
@claude review again |
|
Claude finished @rgharris's task in 2m 34s —— View job Re-review — PR #11206Re-read both files at HEAD
No new issues surfaced on a fresh read. A few small observations worth recording, none blocking: Logic spot-checks (all correct)
Optional follow-ups (not blocking)
VerdictLGTM as-is. The scope (fence interiors only, opt-in via
|
|
Your site preview for commit 0aef8cf is ready! 🎉 http://registry--origin-pr-11206-0aef8cfa.s3-website.us-west-2.amazonaws.com/registry. |
|
Your site preview for commit 2e4dca4 is ready! 🎉 http://registry--origin-pr-11206-2e4dca42.s3-website.us-west-2.amazonaws.com/registry. |
Stop Hugo from misreading shortcode delimiters inside generated fenced code examples, which was aborting the entire site build.
resourcedocsgen now neutralizes Hugo shortcode delimiters ({{% and {{<) that appear inside fenced code blocks when emitting .md files. Hugo parses shortcodes even inside code fences, so an example snippet like {{%s|token}} (Dynatrace credential-vault syntax plus a Java String.format placeholder) was read as a call to a shortcode named "s", failing the build with 'template for shortcode "s" not found'.
The rewrite is restricted to fence interiors, so legitimate hand-authored shortcodes ({{< chooser >}} / {{% choosable %}}, which only wrap fences from the outside) are untouched. Inline code spans and 4-space-indented code blocks are intentionally outside this change because the current generator surface emits fenced examples.
Neutralization inserts a single space after {{. It needs no delimiter pairing (the offending text often has no matching %}}) and is idempotent. Tradeoff: the inserted space changes the rendered example, so a copied snippet carries an extra space (Bearer {{ %s|token}}). That is harmless to the Java String.format call, but Dynatrace would not accept the resulting vault reference if pasted verbatim. We accept this cosmetic cost over a failing build.
Surfaced by #11191 (auto-filed workflow failure for the dynatrace@v0.35.2 bump, PR #11190). The offending {{%s|token}} examples are new in that version (0 occurrences in v0.34.0, 8 in v0.35.2), so the build fails deterministically until this lands on master.
Closes #11205