Skip to content

Variable Substitution in Code Block #665

Answered by jenshalm
pme123 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, this is a known limitation and expected behaviour. The variable substitutions run late in the processing pipeline and the integrated syntax highlighter cannot process those blocks before knowing what content the substitution will hold. The common workaround that most projects use is doing those substitutions with mdoc.

It is theoretically possible to support this, but it would be some effort as it would require a two-phase parser for the code block that first looks for substitutions only and then applies the highligthing parser. Since most users use mdoc anyway this has never been prioritized previously.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pme123
Comment options

Answer selected by pme123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants