fix: don’t check for active node in wrapIn command, fix #1059
This commit is contained in:
@@ -8,13 +8,18 @@ import './styles.scss'
|
||||
|
||||
export default () => {
|
||||
const editor = useEditor({
|
||||
extensions: [Document, Paragraph, Text, Blockquote],
|
||||
extensions: [
|
||||
Document,
|
||||
Paragraph,
|
||||
Text,
|
||||
Blockquote,
|
||||
],
|
||||
content: `
|
||||
<blockquote>
|
||||
Nothing is impossible, the word itself says “I’m possible!”
|
||||
</blockquote>
|
||||
<p>Audrey Hepburn</p>
|
||||
`,
|
||||
<blockquote>
|
||||
Nothing is impossible, the word itself says “I’m possible!”
|
||||
</blockquote>
|
||||
<p>Audrey Hepburn</p>
|
||||
`,
|
||||
})
|
||||
|
||||
if (!editor) {
|
||||
@@ -31,13 +36,13 @@ export default () => {
|
||||
</button>
|
||||
<button
|
||||
onClick={() => editor.chain().focus().setBlockquote().run()}
|
||||
disabled={editor.isActive('blockquote')}
|
||||
disabled={!editor.can().setBlockquote()}
|
||||
>
|
||||
setBlockquote
|
||||
</button>
|
||||
<button
|
||||
onClick={() => editor.chain().focus().unsetBlockquote().run()}
|
||||
disabled={!editor.isActive('blockquote')}
|
||||
disabled={!editor.can().unsetBlockquote()}
|
||||
>
|
||||
unsetBlockquote
|
||||
</button>
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<button @click="editor.chain().focus().toggleBlockquote().run()" :class="{ 'is-active': editor.isActive('blockquote') }">
|
||||
toggleBlockquote
|
||||
</button>
|
||||
<button @click="editor.chain().focus().setBlockquote().run()" :disabled="editor.isActive('blockquote')">
|
||||
<button @click="editor.chain().focus().setBlockquote().run()" :disabled="!editor.can().setBlockquote()">
|
||||
setBlockquote
|
||||
</button>
|
||||
<button @click="editor.chain().focus().unsetBlockquote().run()" :disabled="!editor.isActive('blockquote')">
|
||||
<button @click="editor.chain().focus().unsetBlockquote().run()" :disabled="!editor.can().unsetBlockquote()">
|
||||
unsetBlockquote
|
||||
</button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user