fix: fix tiptap extension

This commit is contained in:
fantasticit 2022-03-12 18:32:59 +08:00
parent 242afc277d
commit c9c5badbb5
9 changed files with 10 additions and 5 deletions

View File

@ -32,6 +32,7 @@ export const Attachment = Node.create({
name: 'attachment', name: 'attachment',
group: 'block', group: 'block',
draggable: true, draggable: true,
atom: true,
addOptions() { addOptions() {
return { return {

View File

@ -33,6 +33,7 @@ const DocumentChildrenExtension = Node.create({
group: 'block', group: 'block',
defining: true, defining: true,
draggable: true, draggable: true,
atom: true,
addAttributes() { addAttributes() {
return { return {

View File

@ -23,6 +23,7 @@ const DocumentReferenceExtension = Node.create({
group: 'block', group: 'block',
defining: true, defining: true,
draggable: true, draggable: true,
atom: true,
addAttributes() { addAttributes() {
return { return {

View File

@ -10,6 +10,7 @@ const IframeNode = Node.create({
marks: '', marks: '',
group: 'block', group: 'block',
draggable: true, draggable: true,
atom: true,
addOptions() { addOptions() {
return { return {

View File

@ -23,6 +23,7 @@ const KatexExtension = Node.create({
group: 'block', group: 'block',
defining: true, defining: true,
draggable: true, draggable: true,
atom: true,
addAttributes() { addAttributes() {
return { return {

View File

@ -25,6 +25,7 @@ const MindNode = Node.create({
marks: '', marks: '',
group: 'block', group: 'block',
draggable: true, draggable: true,
atom: true,
addOptions() { addOptions() {
return { return {

View File

@ -16,6 +16,7 @@ const StatusExtension = Node.create({
content: 'text*', content: 'text*',
group: 'inline', group: 'inline',
inline: true, inline: true,
atom: true,
addAttributes() { addAttributes() {
return { return {

View File

@ -17,18 +17,18 @@ const Title = Node.create({
parseHTML() { parseHTML() {
return [ return [
{ {
tag: 'div[class=title]', tag: 'h1[class=title]',
}, },
]; ];
}, },
renderHTML({ HTMLAttributes }) { renderHTML({ HTMLAttributes }) {
return ['div', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]; return ['h1', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
}, },
}); });
const TitledDocument = Document.extend({ const TitledDocument = Document.extend({
content: 'title block*', content: 'title block+',
}); });
export { Document, Title, TitledDocument }; export { Document, Title, TitledDocument };

View File

@ -63,9 +63,7 @@ const Component = ({ editor }) => {
export const Toc = Node.create({ export const Toc = Node.create({
name: 'tableOfContents', name: 'tableOfContents',
group: 'block', group: 'block',
atom: true, atom: true,
parseHTML() { parseHTML() {