Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
605 views
in Plugins by
edited by

I'm struggling to find solutions to fix MathJax confluct with pagedown mardown editor plugin:
Underscores "_" should stay underscores when between math deliminators ($ $ or \(\}, etc) and not get converted to <em> and </em> tags

Look, I've got no real understanding of how this works, but trying to fix it myself led me to look at the function

_DoItalicsAndBold(text)

in Markdown.Converter.js

Look, again, I have no idea what I'm doing, but I edited

text = text.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g, "$1<em>$3</em>$4");

to 

text = text.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g, "$1_$3_$4");

with the pathetic hope it would do what I want ("Replace "_" with "_", not "<em>")

Not surprisingly, it didn't do what I wanted, but more surprisingly this edit didn't seem to DO ANYTHING.

Do you know 

a) Is there any easy solution to force the Markdown editor to NOT replace "_" with "<em>" ?

b) Why my edit to _DoItalicsAndBold did nothing?

Thanks

by
+1
What's wrong with putting the LaTeX code in code segments (<pre>...</pre> or ```...```)?
by
Thanks for the suggestion. I'm using my QA site for teaching math. My students are young and just learning Latex. So, I don't want to complicate their learning with "extra" html tags.

A simple solution is to use "\_" instead of "_" to escape the Markdown italics, but even that will confuse my students

Please log in or register to answer this question.

...