simplemde-markdown-editor
simplemde-markdown-editor copied to clipboard
Please don't format text within $$ $$ delimiters which are used for math
I use $$ as delimiters for math equations which are then processed by MathJax. But the underscores in LaTex confuse the editor to italicize parts of the equations. Please add a configuration to exclude the text within given delimiters from the rendering engine. Also any underscores within html tags should be ignored. Thanks
So .... what's your solution, It seems that they don't care? I'm using markdown-it and markdown-it-katex for render math equations, but it's not working
It's almost one year later. Since I haven't found any workaround so far, I made myself one. I hope it will help who are still looking for a solution.
Wrap your math scripts with triple ticks and math
right after first triple ticks. For example:
```math
$$
h_v^0 = x_v
$$
``(one more tick)
Now after converting these to markdown: Use the following jQuery script to for replacing pre
and code
blocks with only p
tag. For example, in my case I did the following-
var content = SimpleMDE.prototype.markdown($('#content').text());
$('#content').text('');
$('#content').html(content);
$("pre > code.lang-math" ).each(function( index ) {
$(this).parent().replaceWith("<p>"+this.innerText+"</p>")
});
If you have code highlighting JS, please put that after this. It works flawless.