cm-md-editor 2.3.0 → 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.
package/index.html CHANGED
@@ -17,6 +17,7 @@
17
17
  font-family: monospace;
18
18
  tab-size: 4;
19
19
  line-height: 1.3;
20
+ background-color: #111;
20
21
  }
21
22
  </style>
22
23
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-md-editor",
3
- "version": "2.3.0",
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
@@ -121,10 +121,13 @@ export class MdEditor {
121
121
  }
122
122
  syncStyles()
123
123
 
124
- // Make textarea background transparent so backdrop shows through
124
+ // Move textarea bg to backdrop, make textarea transparent so backdrop shows through
125
+ const originalBg = cs.getPropertyValue('background-color')
126
+ this.backdrop.style.background = originalBg
125
127
  this.element.style.overscrollBehavior = 'none'
126
128
  this.element.style.background = 'transparent'
127
129
  this.element.style.position = 'relative'
130
+ this.element.style.zIndex = '2'
128
131
  const originalColor = cs.color
129
132
  this.element.style.caretColor = originalColor
130
133
  this.element.style.color = 'transparent'
@@ -287,7 +290,7 @@ export class MdEditor {
287
290
  '<span style="color:rgba(' + c('colorEscape') + ',1)">\\</span>$1')
288
291
 
289
292
  // Unordered list markers with optional task list checkbox
290
- result = result.replace(/^(\t*)(- )(\[[ xX]\] )?/, (_, tabs, marker, task) => {
293
+ result = result.replace(/^((?:\t| )*)(- )(\[[ xX]\] )?/, (_, tabs, marker, task) => {
291
294
  let r = tabs + this.colorSpan('colorList', marker)
292
295
  if (task) {
293
296
  r += this.colorSpan('colorList', task)
@@ -296,7 +299,7 @@ export class MdEditor {
296
299
  })
297
300
 
298
301
  // Ordered list markers
299
- result = result.replace(/^(\t*)(\d+\. )/, (_, tabs, marker) =>
302
+ result = result.replace(/^((?:\t| )*)(\d+\. )/, (_, tabs, marker) =>
300
303
  tabs + this.colorSpan('colorList', marker))
301
304
 
302
305
  // Images ![alt](url) and Links [text](url)