Extend Wiky to parse <math> tag
Closed, ResolvedPublic

Description

As far as I know, Wiky doesn't parse the <math> tag, but as the doc says, it should be simple to extend and implement it (http://goessner.net/articles/wiky/)

So we need to parse both the inline <math> tag and the block <math display="block"> tag and change them to $ for inline and $$ for block

For the math tag, I need to do this right. I have to parse <math> to $ ?

What exactly should be displayed in the display pane then?

Example:

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

Okay. Got it.

I added this code to wiky.js to parse <math> tag

{ rex:/<math>(.*?)<\/math>/mgi, tmplt:"$$$1$$" },
{ rex:/<math *display *= *"?block"?>(.*?)<\/math>/mgi, tmplt:"$$$$$1$$$$" },

<math>Some Expression</math> Is parsing to $Some Expression$ perfectly, but having issues with <math display="block">Some Expression</math> is not parsing to $$Some Expression$$ but parsing to $Some Expression$.

Check the TestPage here.

srijancse closed this task as Resolved.Jul 18 2016, 10:31 AM
{ rex:/<math>(.*?)<\/math>/mgi, tmplt:"$$ $1 $$" },
{ rex:/<math *display *= *"?block"?>(.*?)<\/math>/mgi, tmplt:"$$$$ $1 $$$$" },

The code works now. This is the commit.