manually merge HTMLAttributes

This commit is contained in:
Philipp Kühn
2020-11-25 09:50:54 +01:00
parent 7a058b9c2f
commit ddc71f792a
21 changed files with 88 additions and 41 deletions

View File

@@ -51,10 +51,7 @@ export default function getSchema(extensions: Extensions): Schema {
if (extension.config.renderHTML) {
schema.toDOM = node => (extension.config.renderHTML as Function)?.bind(context)({
node,
HTMLAttributes: mergeAttributes(
extension.options.HTMLAttributes,
getRenderedAttributes(node, extensionAttributes),
),
HTMLAttributes: getRenderedAttributes(node, extensionAttributes),
})
}
@@ -83,10 +80,7 @@ export default function getSchema(extensions: Extensions): Schema {
if (extension.config.renderHTML) {
schema.toDOM = mark => (extension.config.renderHTML as Function)?.bind(context)({
mark,
HTMLAttributes: mergeAttributes(
extension.options.HTMLAttributes,
getRenderedAttributes(mark, extensionAttributes),
),
HTMLAttributes: getRenderedAttributes(mark, extensionAttributes),
})
}