-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
Description
Problem
Grammar terms using the \grammarterm{} macro are not being italicized in code blocks, appearing as plain text instead of indicating they're placeholder grammar elements.
Location
File: n4950/except.md
Line: 82
Current Behavior
if (condition)
goto lab;The word "condition" appears as plain text, not distinguished as a grammar placeholder.
Expected Behavior
if (*condition*)
goto lab;The grammar term should be italicized to indicate it's a placeholder, not a literal identifier.
Source Context
File: cplusplus-draft/source/exceptions.tex
Line: 120
if (@\grammarterm{condition}@)
goto lab;The @\grammarterm{condition}@ syntax (using @ delimiters) embeds a grammar term within a code block. This should be converted to *condition* in markdown.
Impact
- Severity: MAJOR
- Grammar placeholders are indistinguishable from regular code
- Makes it unclear that "condition" is meant to be replaced with an actual condition
- Reduces the instructional value of the code example
- This is likely a systematic issue affecting all code blocks with embedded grammar terms
Root Cause
The code block filter (cpp-code-blocks.lua) is not properly handling @\grammarterm{...}@ sequences within code blocks. It should:
- Detect the
@...\grammarterm{...}...@pattern - Convert it to
*...*markdown italic syntax - This requires processing the code content for these patterns before outputting
Reproduction
- Open
n4950/except.md - Navigate to line 82
- Observe "condition" is not italicized
- Compare with the source showing it should be a grammar term
Related Files
src/cpp_std_converter/filters/cpp-code-blocks.lua- Code block processing- Need to add handling for
@\grammarterm{...}@within code content