-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow child nodes to be added to format API objects #29962
Comments
@ellatrix, @talldan any possibility of getting this feature on a developer's radar? Speaking as a humble plugin author and not a core developer, I think it is probably relatively straightforward to implement for someone more familiar with Gutenberg than me and it would unlock a whole class of inline styling possibilities not currently allowed by the lack of ability to add child nodes. The particular feature I'd love to solve is the ability to add inline mathematical markup to paragraph blocks, which a lot of my users at my science institute are hoping to be able to do. Is there a possibility to fund a core developer's time for this, if I can convince my institute to pay? |
@SeanDS Apologies for the delay responding, I've been away on vacation. The formatting API is a bit outside of my area of experience. It sounds like you already know more than me when it comes to
I'm not sure. I guess you'd be seeking someone who is looking for sponsorship and isn't already employed full-time, and also has some relevant skill and knowledge of this part of the codebase. It could be worth discussing this issue at a core-editor meeting if you can make the time. Here are the details of the next meeting - https://make.wordpress.org/core/2022/06/20/editor-chat-agenda-june-22-2022/. If you can't make it you could also add an item to the agenda by commenting on that post. |
This will be possible if we can pull off #41655. You'd be able to render anything in rich text with React. |
Has anyone found any way around this? |
@rafaucau Not as far as I know. It would be great to get this implemented. |
What problem does this address?
I was asked to open this issue by @ellatrix following the discussion here. It's currently impossible to insert nested HTML in format types with
object: true
. Thisobject: true
switch is currently only used in vanilla Gutenberg for inline images where adding a single<img>
tag is sufficient, but I'd like to register a format for embedding inline MathML which is deeply nested HTML and cannot be represented by a single entity. Embedding MathML is trivial in the old editor using shortcodes but the formatting API currently limits this type of use.What is your proposed solution?
It seems sensible to allow format types with
object: true
to replace the text with arbitrary HTML. This would provide maximum flexibility for whatever developers want to do with their formats, rather than the current requirement that anobject: true
format simply replaces the wrapped text with a single HTML entity (in the case of inline images, a single<img>
tag).The text was updated successfully, but these errors were encountered: