Skip to content

Commit

Permalink
fix: blockquote button breaks when selection has 0 depth
Browse files Browse the repository at this point in the history
  • Loading branch information
smsochneg committed Dec 15, 2022
1 parent ea279cc commit 2a38575
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/extensions/markdown/Blockquote/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const toggleQuote: Command = (state, dispatch) => {
if (!isTextSelection(selection) || !selection.$cursor) return wrapIn(qType)(state, dispatch);
const {$cursor} = selection;
let {depth} = $cursor;
while (depth >= 0) {
while (depth > 0) {
const node = $cursor.node(depth);
const nodeSpec = node.type.spec;
if (!nodeSpec.complex || nodeSpec.complex === 'root') {
Expand Down

0 comments on commit 2a38575

Please sign in to comment.