rename attributes to HTMLAttributes

This commit is contained in:
Philipp Kühn
2020-11-13 16:07:20 +01:00
parent 5bccbacf32
commit c840a562de
25 changed files with 55 additions and 51 deletions

View File

@@ -122,14 +122,14 @@ export default class ExtensionManager {
getPos: (() => number) | boolean,
decorations: Decoration[],
) => {
const attributes = getRenderedAttributes(node, extensionAttributes)
const HTMLAttributes = getRenderedAttributes(node, extensionAttributes)
return renderer({
editor,
node,
getPos,
decorations,
attributes,
HTMLAttributes,
})
}

View File

@@ -45,7 +45,7 @@ export interface MarkExtensionSpec<Options = {}, Commands = {}> extends Overwrit
},
props: {
mark: Mark,
attributes: { [key: string]: any },
HTMLAttributes: { [key: string]: any },
}
) => DOMOutputSpec) | null,

View File

@@ -80,7 +80,7 @@ export interface NodeExtensionSpec<Options = {}, Commands = {}> extends Overwrit
},
props: {
node: Node,
attributes: { [key: string]: any },
HTMLAttributes: { [key: string]: any },
}
) => DOMOutputSpec) | null,

View File

@@ -49,7 +49,7 @@ export type NodeViewRendererProps = {
node: Node,
getPos: (() => number) | boolean,
decorations: Decoration[],
attributes: AnyObject,
HTMLAttributes: { [key: string]: any },
}
export type NodeViewRenderer = (props: NodeViewRendererProps) => NodeView

View File

@@ -50,7 +50,7 @@ export default function getSchema(extensions: Extensions): Schema {
if (extension.renderHTML) {
schema.toDOM = node => (extension.renderHTML as Function)?.bind(context)({
node,
attributes: getRenderedAttributes(node, extensionAttributes),
HTMLAttributes: getRenderedAttributes(node, extensionAttributes),
})
}
@@ -79,7 +79,7 @@ export default function getSchema(extensions: Extensions): Schema {
if (extension.renderHTML) {
schema.toDOM = mark => (extension.renderHTML as Function)?.bind(context)({
mark,
attributes: getRenderedAttributes(mark, extensionAttributes),
HTMLAttributes: getRenderedAttributes(mark, extensionAttributes),
})
}