Use markdown-it for rendering markdown#499
Conversation
|
huh, it appears the vscode does not use typings for markdown-it: https://github.com/Microsoft/vscode/blob/master/extensions/markdown/src/extension.ts |
|
You can make the bottom of the markdown-it.d.ts file this to get it working: declare module "markdown-it" {
export = MarkdownIt;
} |
|
@jasongrout Thanks. |
|
I believe what is happening is this: The original repo had typescript looking for the filename So instead of relying on ts to find a 'markdown-it.d.ts' file, we explicitly declare the module in the file which we are including. |
|
Turns out we do need to have some delay for updating markdown during model changes. Mathjax rendering is done for every keypress, which can really slow things down a lot. #445 should help out with reducing redundant renders. |
|
|
||
| import { | ||
| MarkdownWidgetFactory | ||
| MarkdownWidgetFactory, MarkdownItWidgetFactory |
There was a problem hiding this comment.
Ha! Dueling implementations, I like it!
|
Makes sense. I just merged #445. |
|
The most recent commits allow you to render markdown documents with either marked or markdown-it. This should help with comparing how documents are rendered. |
|
What is the status of this PR? |
|
Thinking a bit more about how we render markdown in the browser. While I am in favor of using CommonMark, I don't think we should do that only in JupyterLab as it may break notebooks. We would want to change this in both JLab and the classic notebook in a parallel major release. I am going to work on fixing the marked support in JupyterLab for now. Because of these factors, I am going to close this PR. We can revisit later as we get closer to transitioning to CommonMark in all of our apps. |
Markdown typings from https://github.com/rapropos/typed-markdown-it
This PR provides an alternative markdown renderer, markdown-it, intended for easy, side-by-side comparisons with marked.