You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
markdownRenderFieldDoc escapes { and } as \{ and \} throughout field and validation text, including inside code spans (backtick-quoted strings). In CommonMark, backslash escaping is not processed inside code spans, so the backslashes are rendered literally instead of being consumed.
The \{ and \} sequences appear literally inside the code span because CommonMark does not process backslash escapes inside code spans (spec §6.3).
The same issue affects markdownRenderFieldDoc calls in type_members.tpl when field descriptions contain inline code with {/}.
Context
Encountered while generating API reference docs for kubernetes-sigs/kro. Worked around it with a custom template helper that replaces markdownRenderFieldDoc and skips brace escaping entirely (kro PR: kubernetes-sigs/kro#1476).
Suggested fix
In markdownRenderFieldDoc, avoid escaping { and } that appear inside code spans (text surrounded by backticks). A simpler alternative is to not escape braces at all in the Markdown renderer — CommonMark does not require brace escaping in table cells, unlike MDX/JSX where {...} is a JSX expression. The escaping appears to have been added for MDX compatibility but breaks standard CommonMark.
Activity