Closed gldraphael closed 6 years ago
It works for me
const mdi = markdownIt()
mdi.use(markdownItRegex, {
name: 'spaces',
regex: /([ ]{2,})/,
replace: (match) => {
return ` `
}
})
console.log(mdi.render('Hey There'))
<p>Hey There</p>
I've added it to test case: https://github.com/tylingsoft/markdown-it-regex/blob/master/test/index.js#L37
The regex
/([ ]{2, })/
which should capture two or more consecutive spaces does not work.You may check this commit for an example and paste the following on your terminal to see it in action:
Typescript code for completeness: