Opened 10 years ago

Last modified 10 years ago

#11902 confirmed Bug

Math plugin doesn't work when used in inline editor created on Paragraph. — at Version 3

Reported by: Bram Owned by:
Priority: Normal Milestone:
Component: Core : Editable Version: 4.3 Beta
Keywords: Cc:

Description (last modified by Jakub Ś)

Edit: Please see comment:3[[BR]] Math plugin is disabled when inline editor is created on paragraph.

When using the inline editor on phrased contenthttps://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content the option to add math with the Mathematical Content plugin is disabled.

According to the specs the <math> element is considered valid phrased content. I guess there is some unnecessary content filtering going on that prevents me from using the plugin? If so, is there a list where I can check which elements/plugins are allowed for each content type (flow or phrased)?

Change History (3)

comment:1 Changed 10 years ago by Jakub Ś

Keywords: inline math phrased disabled removed
Resolution: invalid
Status: newclosed
Version: 4.4.0

There is ACF that might be blocking math tags. You can configure ACF to allow math tags but please note there are problems in native contenteditable fields and math formulas. What it means is that you can't freely use mathML in editable elements. It doesn't matter whether this is CKEditor, some other editor or native contenteditable div. You won't be able to use formulas in all browsers.

For that purpouse a plugin has to be created. You can check out our Add-ons repository for such plugins. One of such plugins is: http://ckeditor.com/addon/mathjax.


NOTE: I see you are not familiar with ACF. You can read more about it here:
http://ckeditor.com/blog/Upgrading-to-CKEditor-4.1
http://ckeditor.com/blog/CKEditor-4.1-RC-Released
http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
http://docs.ckeditor.com/#!/api/CKEDITOR.filter-method-addTransformations
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent
http://nightly.ckeditor.com/14-03-20-07-05/full/samples/datafiltering.html

comment:2 Changed 10 years ago by Bram

I'm already using the Mathematical Formulas add-on and it works fine when I use it with the inline editor on flow content like a <div>. The problem is the add-on button is greyed out when I use the inline editor on phrased content like a <p>.

Why would ACF block math in one type of content and not the other? Is there an exhaustive list of which content is allowed where by the default configuration or how can I debug this behaviour. Also worth mentioning, is that when I do use the inline editor on flow content I can freely use math in a paragraph created with CKEditor.

The Mathematical Formulas add-on uses LateX notation, not MathML. LaTeX just uses a special delimiter \( and \) and its own syntax so there can be no markup conflict because of element tags.

comment:3 Changed 10 years ago by Jakub Ś

Description: modified (diff)
Resolution: invalid
Status: closedreopened
Summary: Mathematical content not available for phrased contenteditable fields.Math plugin doesn't work when used in inline editor created on Paragraph.

Couple of notes:

Why would ACF block math in one type

I didn't understand your description the first time. This is not ACF.

According to the specs the <math> element is considered valid phrased content

It actually falls under 3 categories http://www.whatwg.org/specs/web-apps/current-work/multipage/the-map-element.html#mathml but as you have already mentioned MathML is not used with this plugin so let's leave this part.

when I use the inline editor on phrased content like a <p>.

This is flow element.


Now the problem.
Paragraph is flow element that can only have phrasing elements inside it. When you initialize inline editor on Paragraph element, plugins like Format Dropdown, Table or Blockquote are completely removed so that tags like Div or H1 weren't inserted into Paragraph (not allowed in HTML).
Mathematics plugin inserts images and spans so it should work but for some reason it is disabled. This plugins isn't removed but it may be missing some code to make it enabled in elements like Paragraphs (just me guessing).

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy