Skippy le Grand Gourou Posted July 21, 2014 Share Posted July 21, 2014 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> </math> 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. Link to comment Share on other sites More sharing options...
adrian Posted July 21, 2014 Share Posted July 21, 2014 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 Link to comment Share on other sites More sharing options...
Skippy le Grand Gourou Posted July 21, 2014 Author Share Posted July 21, 2014 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 Link to comment Share on other sites More sharing options...
diogo Posted July 21, 2014 Share Posted July 21, 2014 If you want to write raw html, you can even use ACE http://modules.processwire.com/modules/inputfield-ace-editor/ 2 Link to comment Share on other sites More sharing options...
Skippy le Grand Gourou Posted July 21, 2014 Author Share Posted July 21, 2014 Thanks for suggesting, adopted. Link to comment Share on other sites More sharing options...
adrian Posted August 6, 2014 Share Posted August 6, 2014 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now