-
Is there a way to substitute a Variable in a Code block? This works: My Version: ${project.version} -> My Version: 1.2.3 The same as Code does not (``):
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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. |
Beta Was this translation helpful? Give feedback.
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.