securemark 0.287.0 → 0.288.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/index.js +56 -62
  3. package/markdown.d.ts +13 -36
  4. package/package.json +1 -1
  5. package/src/combinator/control/manipulation/convert.ts +4 -4
  6. package/src/combinator/control/manipulation/trim.ts +3 -3
  7. package/src/parser/autolink.test.ts +4 -2
  8. package/src/parser/autolink.ts +2 -1
  9. package/src/parser/block/blockquote.test.ts +2 -0
  10. package/src/parser/block/blockquote.ts +4 -4
  11. package/src/parser/block/codeblock.test.ts +2 -0
  12. package/src/parser/block/extension/fig.ts +2 -1
  13. package/src/parser/block/extension/figure.ts +1 -1
  14. package/src/parser/block/extension/table.ts +2 -2
  15. package/src/parser/block/paragraph.test.ts +4 -5
  16. package/src/parser/block/reply/cite.test.ts +8 -10
  17. package/src/parser/block/reply/cite.ts +24 -11
  18. package/src/parser/block/reply/quote.test.ts +18 -17
  19. package/src/parser/block/reply/quote.ts +15 -30
  20. package/src/parser/block/reply.test.ts +14 -1
  21. package/src/parser/block/reply.ts +12 -24
  22. package/src/parser/block/sidefence.test.ts +2 -0
  23. package/src/parser/block/sidefence.ts +2 -2
  24. package/src/parser/header.ts +1 -1
  25. package/src/parser/inline/autolink/account.ts +2 -1
  26. package/src/parser/inline/autolink/anchor.ts +2 -1
  27. package/src/parser/inline/autolink/hashnum.ts +2 -1
  28. package/src/parser/inline/autolink/hashtag.ts +2 -1
  29. package/src/parser/inline/autolink/url.ts +12 -10
  30. package/src/parser/inline/media.ts +6 -6
  31. package/src/parser/inline/shortmedia.ts +4 -2
  32. package/src/parser/inline/template.ts +9 -9
  33. package/src/parser/inline.test.ts +2 -0
  34. package/src/parser/source/str.ts +2 -1
  35. package/src/parser/util.ts +6 -3
  36. package/src/parser/visibility.ts +4 -2
  37. package/src/util/quote.test.ts +2 -2
@@ -23,7 +23,8 @@ export function visualize<T extends HTMLElement | string>(parser: Parser<T>): Pa
23
23
  return union([
24
24
  convert(
25
25
  source => source.replace(blank.line, line => line.replace(/[\\&<]/g, `${Command.Escape}$&`)),
26
- verify(parser, (ns, rest) => !rest && hasVisible(ns))),
26
+ verify(parser, (ns, rest) => !rest && hasVisible(ns)),
27
+ false),
27
28
  some(union([linebreak, unescsource])),
28
29
  ]);
29
30
  }
@@ -162,7 +163,8 @@ export function trimBlankStart<P extends Parser<unknown>>(parser: P): P;
162
163
  export function trimBlankStart<T>(parser: Parser<T>): Parser<T> {
163
164
  return convert(
164
165
  source => source.replace(blank.start, ''),
165
- parser);
166
+ parser,
167
+ true);
166
168
  }
167
169
  export function trimBlankEnd<P extends Parser<HTMLElement | string>>(parser: P): P;
168
170
  export function trimBlankEnd<T extends HTMLElement | string>(parser: Parser<T>): Parser<T> {
@@ -5,10 +5,10 @@ describe('Unit: util/quote', () => {
5
5
  describe('quote', () => {
6
6
  it('basic', () => {
7
7
  const range = document.createRange();
8
- const el = parse('>>1\n>2\n> a\n>>4 `b` ${c}$\n [e](f) ').firstElementChild!;
8
+ const el = parse('>>1\n> a\n>>?\n> 2\n>>4 `b` ${c}$\n [e](f) ').firstElementChild!;
9
9
  range.setStart(el.firstChild!.firstChild!, 0);
10
10
  range.setEnd(el.lastChild!.lastChild!.lastChild!, 1);
11
- assert(quote('3', range) === `>>>1\n> >2\n>> a\n>>3\n> >>4 \`b\` \${c}$\n> e`);
11
+ assert.deepStrictEqual(quote('3', range), `>>>1\n>> a\n>>>?\n>> 2\n>>3\n> >>4 \`b\` \${c}$\n> e`);
12
12
  });
13
13
 
14
14
  it('adjustment', () => {