cm-md-editor 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/MdEditor.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-md-editor",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "a simple markdown editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/MdEditor.js CHANGED
@@ -290,7 +290,7 @@ export class MdEditor {
290
290
  '<span style="color:rgba(' + c('colorEscape') + ',1)">\\</span>$1')
291
291
 
292
292
  // Unordered list markers with optional task list checkbox
293
- result = result.replace(/^(\t*)(- )(\[[ xX]\] )?/, (_, tabs, marker, task) => {
293
+ result = result.replace(/^((?:\t| )*)(- )(\[[ xX]\] )?/, (_, tabs, marker, task) => {
294
294
  let r = tabs + this.colorSpan('colorList', marker)
295
295
  if (task) {
296
296
  r += this.colorSpan('colorList', task)
@@ -299,7 +299,7 @@ export class MdEditor {
299
299
  })
300
300
 
301
301
  // Ordered list markers
302
- result = result.replace(/^(\t*)(\d+\. )/, (_, tabs, marker) =>
302
+ result = result.replace(/^((?:\t| )*)(\d+\. )/, (_, tabs, marker) =>
303
303
  tabs + this.colorSpan('colorList', marker))
304
304
 
305
305
  // Images ![alt](url) and Links [text](url)