Bug Description
When an experience entry's position field contains Markdown italic markers (*...*), the generated Typst file has garbled #emph[/] brackets, causing the Typst compiler to fail with:
TypstError: missing argument: date-and-location-column
Steps to Reproduce
Use the sb2nov theme (or any theme with a similar template) and create an experience entry where the position field contains multiple italic spans:
cv:
name: John Doe
sections:
experience:
- company: Freelancing consultant by **Acme Corp**
position: Worked in resort *ProjectAlpha* and also on project *ProjectBeta*
start_date: 2020-01
end_date: 2021-01
highlights:
- Did some work
Then run:
Root Cause
The experience entry template for main_column is:
**POSITION**
*COMPANY*
SUMMARY
HIGHLIGHTS
After placeholder substitution, this becomes (for the example above):
**Worked in resort *ProjectAlpha* and also on project *ProjectBeta***
*Freelancing consultant by **Acme Corp***
These two lines are separated by a single \n, which means Python's markdown library treats them as one paragraph. The */** emphasis markers from the POSITION line interact with the * on the COMPANY line, and the parser misresolves the overlapping emphasis boundaries.
This produces garbled Typst output like:
#strong[Worked in resort #emph[ProjectAlpha#emph[ and also on project ]ProjectBeta#emph[)]#emph[
]Freelancing consultant by ...]]
instead of the correct:
#strong[Worked in resort #emph[ProjectAlpha] and also on project #emph[ProjectBeta]]
#emph[Freelancing consultant by ]#emph[Acme Corp]
The mismatched [/] brackets corrupt the #regular-entry() function call syntax, which is why Typst reports missing argument: date-and-location-column.
Proof
from rendercv.renderer.templater.markdown_parser import markdown_to_typst
# Single line — works fine:
markdown_to_typst('**Worked in resort *ProjectAlpha* and on *ProjectBeta***')
# → #strong[Worked in resort #emph[ProjectAlpha] and on #emph[ProjectBeta]] ✓
# Multi-line as produced by template — broken:
markdown_to_typst('**Worked in resort *ProjectAlpha* and on *ProjectBeta***\n*Freelancing consultant by **Acme Corp***')
# → garbled output with mismatched brackets ✗
Impact
- Any entry whose
position (or other first-row field) contains multiple Markdown italic spans will trigger this.
- It appears content-length-dependent because longer CVs are more likely to contain such entries, but it's purely a content pattern issue.
- Affects v2.6 and v2.7 (current main). v2.3 was not affected.
Suggested Fix
Either:
- Separate template lines with
\n\n so Markdown treats them as independent paragraphs, or
- Apply
markdown_to_typst() to each line independently before joining them into the multi-line field.
Environment
- rendercv v2.7 (also v2.6)
- Python 3.12
- macOS
Bug Description
When an experience entry's
positionfield contains Markdown italic markers (*...*), the generated Typst file has garbled#emph[/]brackets, causing the Typst compiler to fail with:Steps to Reproduce
Use the
sb2novtheme (or any theme with a similar template) and create an experience entry where thepositionfield contains multiple italic spans:Then run:
Root Cause
The experience entry template for
main_columnis:After placeholder substitution, this becomes (for the example above):
These two lines are separated by a single
\n, which means Python'smarkdownlibrary treats them as one paragraph. The*/**emphasis markers from the POSITION line interact with the*on the COMPANY line, and the parser misresolves the overlapping emphasis boundaries.This produces garbled Typst output like:
instead of the correct:
The mismatched
[/]brackets corrupt the#regular-entry()function call syntax, which is why Typst reportsmissing argument: date-and-location-column.Proof
Impact
position(or other first-row field) contains multiple Markdown italic spans will trigger this.Suggested Fix
Either:
\n\nso Markdown treats them as independent paragraphs, ormarkdown_to_typst()to each line independently before joining them into the multi-line field.Environment