add basic implementation for attributes

This commit is contained in:
Philipp Kühn
2020-10-21 23:32:28 +02:00
parent 7fffe97532
commit 6752d52541
6 changed files with 114 additions and 12 deletions

View File

@@ -65,6 +65,15 @@ export default createNode({
content: 'inline*',
createAttributes() {
return {
id: {
default: '123',
renderHTML: attributes => ({ class: `foo-${attributes.id}`, id: 'foo' }),
},
}
},
parseHTML() {
return [
{ tag: 'p' },