Skip to content

Commit 2ae3454

Browse files
ElyDotDevAlireza Dabirinejad
and
Alireza Dabirinejad
authored
fix: Fix mismatched ordered list and unordered list (#196)
Co-authored-by: Alireza Dabirinejad <alirezad@pragmateam.dev>
1 parent 5ac5474 commit 2ae3454

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/commands/olist.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export const olist: ICommand = {
1515
execute: ({ state, view }) => {
1616
if (!state || !view) return;
1717
const lineInfo = view.state.doc.lineAt(view.state.selection.main.from);
18-
let mark = '- ';
19-
const matchMark = lineInfo.text.match(/^-/);
18+
let mark = '1. ';
19+
const matchMark = lineInfo.text.match(/^\1\./);
2020
if (matchMark && matchMark[0]) {
2121
mark = '';
2222
}

src/commands/ulist.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export const ulist: ICommand = {
1616
execute: ({ state, view }) => {
1717
if (!state || !view) return;
1818
const lineInfo = view.state.doc.lineAt(view.state.selection.main.from);
19-
let mark = '1. ';
20-
const matchMark = lineInfo.text.match(/^\1\./);
19+
let mark = '- ';
20+
const matchMark = lineInfo.text.match(/^-/);
2121
if (matchMark && matchMark[0]) {
2222
mark = '';
2323
}

0 commit comments

Comments
 (0)