Stage 2: Text Preprocessing¶
obsidian_export.pipeline.stage2_preprocess
¶
Stage 2: Text-level pre-processing before Pandoc parses the document.
escape_dollar_signs
¶
Escape currency dollar signs to \$.
Skips fenced code blocks, display math ($$...$$), and patterns that look like intentional inline math (no digit immediately after $). Belt-and-suspenders alongside --from=gfm-tex_math_dollars.
Source code in obsidian_export/pipeline/stage2_preprocess.py
convert_callouts
¶
Transform Obsidian callout blocks to Pandoc fenced divs.
[!NOTE] Title
[!NOTE] Title
content line
Output: :::{.note title="Title"} content line :::
Source code in obsidian_export/pipeline/stage2_preprocess.py
process_urls
¶
Handle bare URLs in text according to strategy.
Strategies
keep — leave as-is footnote_long — move URLs longer than threshold to footnotes footnote_all — move all URLs to footnotes strip — remove bare URLs entirely
Source code in obsidian_export/pipeline/stage2_preprocess.py
normalize_line_endings
¶
Normalize line endings to LF and strip trailing whitespace per line.
Source code in obsidian_export/pipeline/stage2_preprocess.py
strip_variation_selectors
¶
Remove Unicode variation selectors (U+FE0F) that TeX cannot render.
preprocess
¶
Apply all Stage 2 transforms in order.