Tech
Your LLM Writes \(x\), Your Markdown Parser Wants $x$
TL;DR — LLMs love \(...\) and \[...\] . Most Markdown math plugins only speak $...$ and $$...$$ . I tried to bridge that with a regex, failed in interesting ways, and ended up teaching the tokenizer instead. Two packages came out of it: micromark-extension-math-extended and remark-math-extended .
The setup
Sometimes the hard part of rendering math isn't the equation. It's agreeing on where the equation starts and stops .
I was piping Markdown from some OpenAI...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to