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.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +56 -62
- package/markdown.d.ts +13 -36
- package/package.json +1 -1
- package/src/combinator/control/manipulation/convert.ts +4 -4
- package/src/combinator/control/manipulation/trim.ts +3 -3
- package/src/parser/autolink.test.ts +4 -2
- package/src/parser/autolink.ts +2 -1
- package/src/parser/block/blockquote.test.ts +2 -0
- package/src/parser/block/blockquote.ts +4 -4
- package/src/parser/block/codeblock.test.ts +2 -0
- package/src/parser/block/extension/fig.ts +2 -1
- package/src/parser/block/extension/figure.ts +1 -1
- package/src/parser/block/extension/table.ts +2 -2
- package/src/parser/block/paragraph.test.ts +4 -5
- package/src/parser/block/reply/cite.test.ts +8 -10
- package/src/parser/block/reply/cite.ts +24 -11
- package/src/parser/block/reply/quote.test.ts +18 -17
- package/src/parser/block/reply/quote.ts +15 -30
- package/src/parser/block/reply.test.ts +14 -1
- package/src/parser/block/reply.ts +12 -24
- package/src/parser/block/sidefence.test.ts +2 -0
- package/src/parser/block/sidefence.ts +2 -2
- package/src/parser/header.ts +1 -1
- package/src/parser/inline/autolink/account.ts +2 -1
- package/src/parser/inline/autolink/anchor.ts +2 -1
- package/src/parser/inline/autolink/hashnum.ts +2 -1
- package/src/parser/inline/autolink/hashtag.ts +2 -1
- package/src/parser/inline/autolink/url.ts +12 -10
- package/src/parser/inline/media.ts +6 -6
- package/src/parser/inline/shortmedia.ts +4 -2
- package/src/parser/inline/template.ts +9 -9
- package/src/parser/inline.test.ts +2 -0
- package/src/parser/source/str.ts +2 -1
- package/src/parser/util.ts +6 -3
- package/src/parser/visibility.ts +4 -2
- package/src/util/quote.test.ts +2 -2
package/src/parser/visibility.ts
CHANGED
|
@@ -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> {
|
package/src/util/quote.test.ts
CHANGED
|
@@ -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>
|
|
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)
|
|
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', () => {
|