marked 8.0.0 → 9.0.0

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/lib/marked.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * marked v8.0.0 - a markdown parser
2
+ * marked v9.0.0 - a markdown parser
3
3
  * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
4
4
  * https://github.com/markedjs/marked
5
5
  */
@@ -374,7 +374,7 @@ class _Tokenizer {
374
374
  let indent = 0;
375
375
  if (this.options.pedantic) {
376
376
  indent = 2;
377
- itemContents = line.trimLeft();
377
+ itemContents = line.trimStart();
378
378
  }
379
379
  else {
380
380
  indent = cap[2].search(/[^ ]/); // Find first non-space char
@@ -479,9 +479,9 @@ class _Tokenizer {
479
479
  list.raw += raw;
480
480
  }
481
481
  // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic
482
- list.items[list.items.length - 1].raw = raw.trimRight();
483
- list.items[list.items.length - 1].text = itemContents.trimRight();
484
- list.raw = list.raw.trimRight();
482
+ list.items[list.items.length - 1].raw = raw.trimEnd();
483
+ list.items[list.items.length - 1].text = itemContents.trimEnd();
484
+ list.raw = list.raw.trimEnd();
485
485
  // Item child tokens handled here at end because we needed to have the final item to trim it first
486
486
  for (let i = 0; i < list.items.length; i++) {
487
487
  this.lexer.state.top = false;
@@ -1885,12 +1885,12 @@ class _Parser {
1885
1885
  else {
1886
1886
  item.tokens.unshift({
1887
1887
  type: 'text',
1888
- text: checkbox
1888
+ text: checkbox + ' '
1889
1889
  });
1890
1890
  }
1891
1891
  }
1892
1892
  else {
1893
- itemBody += checkbox;
1893
+ itemBody += checkbox + ' ';
1894
1894
  }
1895
1895
  }
1896
1896
  itemBody += this.parse(item.tokens, loose);