MathML

Naubel
Joined: 13. August 2016
Messages: 2
Any thoughts on a possible MathML integration for the BB code editor?

Posted 16. August 2016
N8boy
Joined: 10. August 2016
Messages: 55
What exactly is MathML? Is it somethning similar to LaTex? I planned to include a Math BBCode based on LaTex nut if MathML is better maybe I'll switch to that one.

Founder of IkoBB -  The new open source and free forum 
Posted 17. August 2016
N8boy
Joined: 10. August 2016
Messages: 55
Good news:
I have included MathJax with LaTeX and MathML.
LaTeX is already working:
[latex]x = {-b \pm \sqrt{b^2-4ac} \over 2a}[/latex]


$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$


MathML has some problems(Edit: Fixed):

[mathml]<mi>a</mi><msup><mi>x</mi><mn>2</mn></msup>
  <mo>+</mo> <mi>b</mi><mi>x</mi>
  <mo>+</mo> <mi>c</mi> <mo>=</mo> <mn>0</mn>[/mathml]


ax2+ bx+ c = 0

Founder of IkoBB -  The new open source and free forum 
Posted 17. August 2016
Naubel
Joined: 13. August 2016
Messages: 2
There is also a way to include it as AsciiMath input. I use it for one of my own forums, and the syntax is a lot easier (at least for most users).

In the <head>:


<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_CHTML"></script>


For example, when creating a new post I just use a JBBCode parser along the way, and it works fine so far if a user enters something like this:

AsciiMath:
  `x = (-b +- sqrt(b^2-4ac))/(2a) `


Posted 17. August 2016
N8boy
Joined: 10. August 2016
Messages: 55
Et voila:
`x = (-b +- sqrt(b^2-4ac))/(2a) ` OR
[asciimath]x = (-b +- sqrt(b^2-4ac))/(2a)[/asciimath]


`x = (-b +- sqrt(b^2-4ac))/(2a)`


Edit:
MathML Fixed

Founder of IkoBB -  The new open source and free forum 
Posted 17. August 2016