1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Fix regular expression related checkbox logic

This commit is contained in:
Ryota Kusano
2019-05-11 00:44:55 +09:00
committed by Junyoung Choi
parent 052fb3df5b
commit e402929cca
4 changed files with 11 additions and 6 deletions

View File

@@ -159,8 +159,8 @@ class MarkdownEditor extends React.Component {
e.preventDefault()
e.stopPropagation()
const idMatch = /checkbox-([0-9]+)/
const checkedMatch = /^\s*[\+\-\*] \[x\]/i
const uncheckedMatch = /^\s*[\+\-\*] \[ \]/
const checkedMatch = /^\s*>?\s*[\+\-\*] \[x\]/i
const uncheckedMatch = /^\s*>?\s*[\+\-\*] \[ \]/
const checkReplace = /\[x\]/i
const uncheckReplace = /\[ \]/
if (idMatch.test(e.target.getAttribute('id'))) {