Skip to content

Tool for markdown-it to escape the necessary characters in markdown so I can try autorender #3362

Answered by edemaine
universemaster asked this question in Q&A
Discussion options

You must be logged in to vote

OK, makes sense now; you want to render only when the equation becomes visible.

The timing numbers you give lack some context: could you summarize how big the DOM is, how many equations, average DOM size per equation, etc.? This would help put the parse times into perspective.

I think the way to do this would be to use a plugin like markdown-it-texmath, but give it a fake KaTeX engine like so (untested code):

const markdown = require('markdown-it')({html: true})
.use(require('markdown-it-texmath'), {
  engine: {
    renderToString: (tex, options) => `<div class="math-todo" data-display="${options.displayMode}">${tex}</div>`
  }
})

Then you could write some JavaScript to build an Intersect…

Replies: 8 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by universemaster
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@universemaster
Comment options

@edemaine
Comment options

@universemaster
Comment options

@kelvindi
Comment options

@universemaster
Comment options

Comment options

You must be logged in to vote
1 reply
@universemaster
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants