securemark 0.298.4 → 0.298.5
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 +4 -0
- package/dist/index.js +1 -2
- package/package.json +1 -1
- package/src/parser/inline/deletion.test.ts +1 -1
- package/src/parser/inline/emstrong.test.ts +2 -2
- package/src/parser/inline/insertion.test.ts +1 -1
- package/src/parser/inline/italic.test.ts +1 -1
- package/src/parser/inline/mark.test.ts +1 -1
- package/src/parser/inline.test.ts +2 -0
- package/src/parser/util.ts +0 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.298.
|
|
1
|
+
/*! securemark v0.298.5 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory(require("Prism"), require("DOMPurify"));
|
|
@@ -9091,7 +9091,6 @@ function repeat(symbol, after, parser, cons, termination = (nodes, context, pref
|
|
|
9091
9091
|
}
|
|
9092
9092
|
break;
|
|
9093
9093
|
}
|
|
9094
|
-
if (nodes.length === 0) return;
|
|
9095
9094
|
const prefix = i;
|
|
9096
9095
|
i = 0;
|
|
9097
9096
|
for (let len = (0, alias_1.min)(prefix, source.length - context.position); i < len && source[context.position + i] === symbol[0];) {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ describe('Unit: parser/inline/deletion', () => {
|
|
|
11
11
|
it('invalid', () => {
|
|
12
12
|
assert.deepStrictEqual(inspect(parser, input('', new Context())), undefined);
|
|
13
13
|
assert.deepStrictEqual(inspect(parser, input('~', new Context())), undefined);
|
|
14
|
-
assert.deepStrictEqual(inspect(parser, input('~~', new Context())),
|
|
14
|
+
assert.deepStrictEqual(inspect(parser, input('~~', new Context())), [['~~'], '']);
|
|
15
15
|
assert.deepStrictEqual(inspect(parser, input('~~a', new Context())), [['~~', 'a'], '']);
|
|
16
16
|
assert.deepStrictEqual(inspect(parser, input('~~a~', new Context())), [['~~', 'a~'], '']);
|
|
17
17
|
assert.deepStrictEqual(inspect(parser, input(' ~~a~~', new Context())), undefined);
|
|
@@ -9,7 +9,7 @@ describe('Unit: parser/inline/emstrong', () => {
|
|
|
9
9
|
const parser = some(emstrong);
|
|
10
10
|
|
|
11
11
|
it('invalid', () => {
|
|
12
|
-
assert.deepStrictEqual(inspect(parser, input('***', new Context())),
|
|
12
|
+
assert.deepStrictEqual(inspect(parser, input('***', new Context())), [['***'], '']);
|
|
13
13
|
assert.deepStrictEqual(inspect(parser, input('***a', new Context())), [['***a'], '']);
|
|
14
14
|
assert.deepStrictEqual(inspect(parser, input('***a ***', new Context())), [['***a ', '***'], '']);
|
|
15
15
|
assert.deepStrictEqual(inspect(parser, input('***a ***', new Context())), [['***a', ' ', '***'], '']);
|
|
@@ -85,7 +85,7 @@ describe('Unit: parser/inline/emstrong', () => {
|
|
|
85
85
|
assert.deepStrictEqual(inspect(parser, input('***a***b', new Context())), [['<em><strong>a</strong></em>'], 'b']);
|
|
86
86
|
assert.deepStrictEqual(inspect(parser, input('***a****', new Context())), [['<em><strong>a</strong></em>'], '*']);
|
|
87
87
|
assert.deepStrictEqual(inspect(parser, input('***a*****', new Context())), [['<em><strong>a</strong></em>'], '**']);
|
|
88
|
-
assert.deepStrictEqual(inspect(parser, input('***a******', new Context())), [['<em><strong>a</strong></em>'
|
|
88
|
+
assert.deepStrictEqual(inspect(parser, input('***a******', new Context())), [['<em><strong>a</strong></em>', '***'], '']);
|
|
89
89
|
assert.deepStrictEqual(inspect(parser, input('****a***', new Context())), [['*', '<em><strong>a</strong></em>'], '']);
|
|
90
90
|
assert.deepStrictEqual(inspect(parser, input('****a***b', new Context())), [['*', '<em><strong>a</strong></em>', 'b'], '']);
|
|
91
91
|
assert.deepStrictEqual(inspect(parser, input('****a***b*', new Context())), [['<em><em><strong>a</strong></em>b</em>'], '']);
|
|
@@ -11,7 +11,7 @@ describe('Unit: parser/inline/insertion', () => {
|
|
|
11
11
|
it('invalid', () => {
|
|
12
12
|
assert.deepStrictEqual(inspect(parser, input('', new Context())), undefined);
|
|
13
13
|
assert.deepStrictEqual(inspect(parser, input('+', new Context())), undefined);
|
|
14
|
-
assert.deepStrictEqual(inspect(parser, input('++', new Context())),
|
|
14
|
+
assert.deepStrictEqual(inspect(parser, input('++', new Context())), [['++'], '']);
|
|
15
15
|
assert.deepStrictEqual(inspect(parser, input('++a', new Context())), [['++', 'a'], '']);
|
|
16
16
|
assert.deepStrictEqual(inspect(parser, input('++a+', new Context())), [['++', 'a+'], '']);
|
|
17
17
|
assert.deepStrictEqual(inspect(parser, input(' ++a++', new Context())), undefined);
|
|
@@ -9,7 +9,7 @@ describe('Unit: parser/inline/italic', () => {
|
|
|
9
9
|
const parser = some(italic);
|
|
10
10
|
|
|
11
11
|
it('invalid', () => {
|
|
12
|
-
assert.deepStrictEqual(inspect(parser, input('///', new Context())),
|
|
12
|
+
assert.deepStrictEqual(inspect(parser, input('///', new Context())), [['///'], '']);
|
|
13
13
|
assert.deepStrictEqual(inspect(parser, input('///a', new Context())), [['///', 'a'], '']);
|
|
14
14
|
assert.deepStrictEqual(inspect(parser, input('///a ///', new Context())), [['///', 'a ', '///'], '']);
|
|
15
15
|
assert.deepStrictEqual(inspect(parser, input('///a ///', new Context())), [['///', 'a', ' ', '///'], '']);
|
|
@@ -11,7 +11,7 @@ describe('Unit: parser/inline/mark', () => {
|
|
|
11
11
|
it('invalid', () => {
|
|
12
12
|
assert.deepStrictEqual(inspect(parser, input('', new Context())), undefined);
|
|
13
13
|
assert.deepStrictEqual(inspect(parser, input('=', new Context())), undefined);
|
|
14
|
-
assert.deepStrictEqual(inspect(parser, input('==', new Context())),
|
|
14
|
+
assert.deepStrictEqual(inspect(parser, input('==', new Context())), [['=='], '']);
|
|
15
15
|
assert.deepStrictEqual(inspect(parser, input('==a', new Context())), [['==', 'a'], '']);
|
|
16
16
|
assert.deepStrictEqual(inspect(parser, input('==a=', new Context())), [['==', 'a='], '']);
|
|
17
17
|
assert.deepStrictEqual(inspect(parser, input('==a ==', new Context())), [['==', 'a ', '=='], '']);
|
|
@@ -22,6 +22,8 @@ describe('Unit: parser/inline', () => {
|
|
|
22
22
|
it('nest', () => {
|
|
23
23
|
assert.deepStrictEqual(inspect(parser, input('あ(A)', new Context())), [['あ', '<span class="paren">(A)</span>'], '']);
|
|
24
24
|
assert.deepStrictEqual(inspect(parser, input('あ(い)', new Context())), [['あ', '<span class="paren">(い)</span>'], '']);
|
|
25
|
+
assert.deepStrictEqual(inspect(parser, input('='.repeat(1e6), new Context())), [['='.repeat(1e6)], '']);
|
|
26
|
+
assert.deepStrictEqual(inspect(parser, input('*'.repeat(1e6), new Context())), [['*'.repeat(1e6)], '']);
|
|
25
27
|
assert.deepStrictEqual(inspect(parser, input('* a*', new Context())), [['* a', '*'], '']);
|
|
26
28
|
assert.deepStrictEqual(inspect(parser, input('** a**', new Context())), [['**', ' a', '**'], '']);
|
|
27
29
|
assert.deepStrictEqual(inspect(parser, input('*** a***', new Context())), [['***', ' a', '***'], '']);
|
package/src/parser/util.ts
CHANGED
|
@@ -67,7 +67,6 @@ export function repeat<N extends HTMLElement | string>(symbol: string, after: st
|
|
|
67
67
|
}
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
|
-
if (nodes.length === 0) return;
|
|
71
70
|
const prefix = i;
|
|
72
71
|
i = 0;
|
|
73
72
|
for (let len = min(prefix, source.length - context.position); i < len && source[context.position + i] === symbol[0];) {
|