Commit 86699f7a authored by hewenhao's avatar hewenhao

feat: 去掉空格

parent be1d099e
......@@ -78,7 +78,13 @@ const formatContent = (str: string): FormatContentRet => {
}
}
const list = genNewNode(str)
const list = genNewNode(str).filter(c => {
if (c.type === 'text') {
return !/\s/.test(c.content)
}
return true
})
let signIndex = list.findIndex(c => c.type === 'text' && c.content === '+')
let signal: FormatContentRet['sign'] = 'ADD'
......
......@@ -78,7 +78,13 @@ const formatContent = (str: string): FormatContentRet => {
}
}
const list = genNewNode(str)
const list = genNewNode(str).filter(c => {
if (c.type === 'text') {
return !/\s/.test(c.content)
}
return true
})
let signIndex = list.findIndex(c => c.type === 'text' && c.content === '+')
let signal: FormatContentRet['sign'] = 'ADD'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment