Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds two core blocks beyond generic blocks
Adds image and quote blocks. Meant for experimenting with possible parse ideas. This directly embeds certain core block types into the spec parser. The benefit is that we have tight coupling and integration of those block types. The cost is that we have tight coupling and integration of those block types. There's a bit more flexibility in integrating this higher-level parser into the string parser, but I think it may be just as easy to include a JS pass over the parse tree to convert generic into more specific nodes. This is pretty verbose now but I could imagine a basic DSL (or an existing one) to compare tree structure and (choke) load data from HTML ``` [ 'core/image', or( !! caption, [ [ 'img', { src: [ 'url', types.url ] } ] ], [ [ 'figure', [ [ 'img', { src: [ 'url', types.url ] } ], [ 'figcaption', 'caption' ] ] ] ] ) ] >>> { type: 'core/image', url: '...', caption: [ // subtree inside of caption tag, maybe blocks ] } ``` ^^^ that's just playing around, but the idea could be used to both load and generate the serialized data
- Loading branch information