Skip to content
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

TinyMCE per block: Having a more controlled output markup #170

Merged
merged 1 commit into from
Mar 3, 2017

Conversation

youknowriad
Copy link
Contributor

In this PR I'm adding a serialize/parse methods to the block API to ease working with the block and generating the final markup.

parse: takes a raw block (the output of the grammar parser) and returns a simpler block object to be used by the form. The only requirement, it should have a blockType attribute.

serialize: takes the parsed black and should return the grammar block to be serialized to HTML

--
This PR adds a fallback mechanism where we fallback to the default text block if the parse method returns false, which means the content can not be parsed.

@youknowriad youknowriad added the [Type] Enhancement A suggestion for improvement. label Mar 3, 2017
@youknowriad youknowriad self-assigned this Mar 3, 2017
@youknowriad youknowriad merged commit 8f3e669 into master Mar 3, 2017
@youknowriad youknowriad deleted the update/per-block/controlled-markup branch March 3, 2017 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant