-1

I need to parse <math> tag to $ and <math display ="block"> to $$ using wiky.js. This javascript is mainly using regex to do that.

For eg :

<math> x^2 + 1 = 0 </math> becomes: $ x^2 + 1 = 0 $.

And <math display="block"> x^2 + 1 = 0 </math> becomes: $$ x^2 + 1 = 0 $$

1 Answers1

0
{ rex:/<math>(.*?)<\/math>/mgi, tmplt:"$$$1$$" }
{ rex:/<math *display *= *"?block"?>(.*?)<\/math>/mgi, tmplt:"$$$$$1$$$$" }
logi-kal
  • 7,107
  • 6
  • 31
  • 43