Skip to content

feat: add enableLatex, and enableAsciimath & enableNemeth options#34

Merged
wendyyuchensun merged 3 commits into
coseeing:mainfrom
wendyyuchensun:delimiter
May 1, 2026
Merged

feat: add enableLatex, and enableAsciimath & enableNemeth options#34
wendyyuchensun merged 3 commits into
coseeing:mainfrom
wendyyuchensun:delimiter

Conversation

@wendyyuchensun
Copy link
Copy Markdown
Collaborator

@wendyyuchensun wendyyuchensun commented May 1, 2026

Summary

Adds three new boolean options to both createMarkdownToReactParser and createTableOfContents for selectively disabling math parsing extensions. All options default to true (existing behavior unchanged).

  • enableLatex — controls LaTeX math parsing (\(…\), $…$)
  • enableAsciimath — controls AsciiMath parsing (backtick delimited)
  • enableNemeth — controls the Nemeth braille math extension (@…@ syntax)

When both enableLatex and enableAsciimath are false, the math extension is skipped entirely at the processor level. math.js also includes a defensive early return for the same case.

Usage

// Disable LaTeX only — AsciiMath still parsed
createMarkdownToReactParser({
  options: { enableLatex: false },
  components: {},
})(markdown);

// Disable Nemeth braille only
createMarkdownToReactParser({
  options: { enableNemeth: false },
  components: {},
})(markdown);

// Disable all math parsing
createMarkdownToReactParser({
  options: { enableLatex: false, enableAsciimath: false, enableNemeth: false },
  components: {},
})(markdown);

// Same options are available on createTableOfContents
createTableOfContents(markdown, { enableLatex: false, enableNemeth: false });

@wendyyuchensun wendyyuchensun changed the title Delimiter feat: add enableLatex, and enableAsciimath & enableNemeth options May 1, 2026
@wendyyuchensun wendyyuchensun merged commit 71664f1 into coseeing:main May 1, 2026
1 check passed
@wendyyuchensun wendyyuchensun deleted the delimiter branch May 1, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants