Skip to content

Commit

Permalink
Merge pull request #50 from yandex-cloud/fix-wrong-depth-loop
Browse files Browse the repository at this point in the history
fix: blockquote button breaks when selection has 0 depth
  • Loading branch information
smsochneg authored Dec 16, 2022
2 parents ea279cc + 2a38575 commit eaf0574
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 eaf0574

Please sign in to comment.