Mathpix / mathpix-markdown-it

Markdown rendering + Latex extras (equations, tables, ...), with conversion features, for the scientific community
MIT License
539 stars 45 forks source link

PR into master from dev/olga/add-applyMathpixMarkdownPlugins #350

Open OlgaRedozubova opened 1 month ago

OlgaRedozubova commented 1 month ago

branch: dev/olga/add-applyMathpixMarkdownPlugins

import { applyMathpixMarkdownPlugins } from 'mathpix-markdown-it';

const md = applyMathpixMarkdownPlugins({
  htmlTags: true,
});

// We use a configured instance for Parsing Markdown
const renderedHtml = md.render('Your **Markdown** text with \\textbf{mathpix-markdown-it} support!');
console.log(renderedHtml);

renderedHtml:

<div>Your <strong>Markdown</strong> text with <strong>mathpix-markdown-it</strong> support!</div>
sylee957 commented 1 month ago

I'm okay with the implementation. But user-facing documentation may be added to readme.

OlgaRedozubova commented 1 month ago

I'm okay with the implementation. But user-facing documentation may be added to readme.

Sure, I'll do it.

sylee957 commented 1 month ago

Can you add type MarkdownIt for function output?

OlgaRedozubova commented 1 month ago

Can you add type MarkdownIt for function output?

Done.

sylee957 commented 1 month ago

I still have problem for inferring the types for markdown-it. Maybe you should add @types/markdown-it and add import import type MarkdownIt from "markdown-it";