# Mathml Support ?

## Recommended Posts

Hi,

When I try to insert a MathML formula through the HTML editor, it gets transformed into the raw formula and all MathML tags disappear.  I'm new both to ProcessWire and to MathML though, so maybe I missed something.  I copypasted the following lines as a test :

<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'>
<msup>
<mi>e</mi>
<mrow>
<mn>2</mn>
<mi>x</mi>
<mo>+</mo>
<mn>1</mn>
</mrow>
</msup>
[/itex]

After saving the page it becomes simply "e2x+1" in the HTML page.

So, is there something (e.g. automatic HTML tag checking) preventing the insertion of MathML code ?  If so, how can I work it around ?

Thanks.

##### Share on other sites

Assuming you are using TinyMCE and not the CKEditor module, take a look at some of these links:

http://www.imathas.com/editordemo/demo.html

http://www.tinymce.com/forum/viewtopic.php?id=13917

http://www.fmath.info/plugins/TinyMCE/demo.jsp

https://github.com/rochecompaan/tinymce-asciimath-plugin

http://mathmlflash.blogspot.com/2010/08/plugin-for-mathematics-for-tinymce.html

I haven't used any of these, so no recommendations as to what is better, but hopefully should get you going.

EDIT: You might also be able to achieve what you want by editing the valid elements on the field's input tab > tinymce advanced settings.

• 4

##### Share on other sites

Thanks.  I understood from your post and a bit of search that ProcessWire was using TinyMCE by default, and found out I could switch to raw textarea through "setup > fields > body > details" in the admin panel — which is for the better, since I'm not fond of rich text editor and prefer writing HTML.

Indeed the stripping is done by TinyCME, so not using it obviously enables rendering of MathML without further action.

Adding MathML valid elements as suggested in your edit should also work (didn't test), but I guess people willing to use a rich text editor would prefer to use one of the plugins you linked to — though most are quite old, not sure they still work ?

Thanks again !

• 1

##### Share on other sites

If you want to write raw html, you can even use ACE http://modules.processwire.com/modules/inputfield-ace-editor/

• 2

##### Share on other sites

There is also this plugin for CKEditor: http://ckeditor.com/addon/mathjax

As of yesterday's PW dev version, external CKEditor plugins are supported and very easy to manage: https://github.com/ryancramerdesign/ProcessWire/commit/4b12d2e4f2ceb7eebb52261e723a847e08c8a569

• 2

## Create an account

Register a new account