md-to-pdf icon indicating copy to clipboard operation
md-to-pdf copied to clipboard

feature: Allow use of markdown-it as the markdown parser

Open danishcake opened this issue 5 months ago • 0 comments

Problem:

Marked is a fine markdown parser, but markdown-it is the parser used by Visual Studio Code, so there's a much larger number of plugins available.

When authoring markdown using Visual Studio Code, rendering using markdown-it would allow the preview to be a close approximation for the output pdf.

Solution:

  1. Add options for markdown-it in BasicConfig:
	markdown_parser: 'marked' | 'markdown-it';
	markdown_it_options: MarkdownIt.Options;
	markdown_it_plugins: MarkdownIt.PluginSimple[];
  1. Add a new file get-markdown-it-with-highlighter.ts that returns a markdown-it instance that is roughly comparable to the default marked instance. Call this from getHtml when configured with markdown-it.
  2. Add required plumbing, tests and examples for how to use markdown-it extensions.

danishcake avatar Sep 12 '24 05:09 danishcake