We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 59e8ea9 commit 48d7848Copy full SHA for 48d7848
packages/cherry-markdown/src/toolbars/PreviewerBubble.js
@@ -246,11 +246,11 @@ export default class PreviewerBubble {
246
let targetCh = -1;
247
contents.forEach((lineContent, lineIdx) => {
248
const tmp = lineContent.trim(); // 去掉句首的空格和制表符
249
- if (tmp.startsWith('- [ ]') || tmp.startsWith('- [x]')) {
+ if (/^-\s+\[[ x]\]/i.test(tmp)) {
250
// 如果是个checkbox
251
if (editorCheckboxCount === this.checkboxIdx) {
252
targetLine = lineIdx;
253
- targetCh = lineContent.indexOf('- [') + 3;
+ targetCh = lineContent.indexOf('[') + 1;
254
}
255
editorCheckboxCount += 1;
256
0 commit comments