rename attributes to HTMLAttributes
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export interface MarkExtensionSpec<Options = {}, Commands = {}> extends Overwrit
|
||||
},
|
||||
props: {
|
||||
mark: Mark,
|
||||
attributes: { [key: string]: any },
|
||||
HTMLAttributes: { [key: string]: any },
|
||||
}
|
||||
) => DOMOutputSpec) | null,
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ export interface NodeExtensionSpec<Options = {}, Commands = {}> extends Overwrit
|
||||
},
|
||||
props: {
|
||||
node: Node,
|
||||
attributes: { [key: string]: any },
|
||||
HTMLAttributes: { [key: string]: any },
|
||||
}
|
||||
) => DOMOutputSpec) | null,
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user