Markdown emphasis markers in POSITION field break Typst compilation when interacting with COMPANY line · Issue #685 · rendercv/rendercv · GitHub
Skip to content

Markdown emphasis markers in POSITION field break Typst compilation when interacting with COMPANY line #685

Description

@sinaatalay

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:

rendercv render cv.yaml

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:

  1. Separate template lines with \n\n so Markdown treats them as independent paragraphs, or
  2. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions