fix tests
This commit is contained in:
@@ -11,26 +11,6 @@ import Document from '@tiptap/extension-document'
|
|||||||
import Paragraph from '@tiptap/extension-paragraph'
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
|
|
||||||
const CustomParagraph = Paragraph.extend({
|
|
||||||
addAttributes() {
|
|
||||||
return {
|
|
||||||
color: {
|
|
||||||
default: null,
|
|
||||||
parseHTML: element => {
|
|
||||||
return {
|
|
||||||
color: element.getAttribute('data-color'),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
renderHTML: attributes => {
|
|
||||||
return {
|
|
||||||
style: `color: ${attributes.color}`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
EditorContent,
|
EditorContent,
|
||||||
@@ -46,11 +26,11 @@ export default {
|
|||||||
this.editor = new Editor({
|
this.editor = new Editor({
|
||||||
extensions: [
|
extensions: [
|
||||||
Document(),
|
Document(),
|
||||||
CustomParagraph(),
|
Paragraph(),
|
||||||
Text(),
|
Text(),
|
||||||
],
|
],
|
||||||
content: `
|
content: `
|
||||||
<p data-color="blue">The Paragraph extension is not required, but it’s very likely you want to use it. It’s needed to write paragraphs of text. 🤓</p>
|
<p>The Paragraph extension is not required, but it’s very likely you want to use it. It’s needed to write paragraphs of text. 🤓</p>
|
||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user