Add CustomDiv extension to preserve div tags and attributes in Jeditor
This commit is contained in:
parent
ffc10a7089
commit
1cdcde7a9e
@ -73,6 +73,25 @@ const CustomDiv = Node.create({
|
||||
name: 'customDiv',
|
||||
group: 'block',
|
||||
content: 'block*',
|
||||
addAttributes() {
|
||||
return {
|
||||
class: {
|
||||
default: null,
|
||||
parseHTML: element => element.getAttribute('class'),
|
||||
renderHTML: attributes => attributes.class ? { class: attributes.class } : {},
|
||||
},
|
||||
style: {
|
||||
default: null,
|
||||
parseHTML: element => element.getAttribute('style'),
|
||||
renderHTML: attributes => attributes.style ? { style: attributes.style } : {},
|
||||
},
|
||||
id: {
|
||||
default: null,
|
||||
parseHTML: element => element.getAttribute('id'),
|
||||
renderHTML: attributes => attributes.id ? { id: attributes.id } : {},
|
||||
},
|
||||
}
|
||||
},
|
||||
parseHTML() {
|
||||
return [
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user