mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-23 19:19:03 +08:00
remove unused options in template and directly return attributes in helper fns
This commit is contained in:
parent
a2d810f446
commit
3fa56e779e
@ -10,6 +10,8 @@ import React from 'react'
|
||||
const MenuBar = () => {
|
||||
const { editor } = useCurrentEditor()
|
||||
|
||||
window.editor = editor
|
||||
|
||||
if (!editor) {
|
||||
return null
|
||||
}
|
||||
@ -230,6 +232,6 @@ const content = `
|
||||
|
||||
export default () => {
|
||||
return (
|
||||
<EditorProvider slotBefore={<MenuBar />} extensions={extensions} content={content} rendering={{ addTypeAttributes: true }}></EditorProvider>
|
||||
<EditorProvider slotBefore={<MenuBar />} extensions={extensions} content={content}></EditorProvider>
|
||||
)
|
||||
}
|
||||
|
@ -20,13 +20,11 @@ export function getAttributes(
|
||||
state.schema,
|
||||
)
|
||||
|
||||
let attributes: Record<string, any> = {}
|
||||
|
||||
if (schemaType === 'node') {
|
||||
attributes = getNodeAttributes(state, typeOrName as NodeType)
|
||||
} else if (schemaType === 'mark') {
|
||||
attributes = getMarkAttributes(state, typeOrName as MarkType)
|
||||
return getNodeAttributes(state, typeOrName as NodeType)
|
||||
} if (schemaType === 'mark') {
|
||||
return getMarkAttributes(state, typeOrName as MarkType)
|
||||
}
|
||||
|
||||
return attributes
|
||||
return {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user