Skip to content

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.

2 participants