securemark 0.233.0 → 0.233.1
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/securemark.js +5 -4
- package/package-lock.json +12 -12
- package/package.json +1 -1
- package/src/parser/inline/annotation.test.ts +2 -2
- package/src/parser/inline/deletion.test.ts +1 -1
- package/src/parser/inline/extension/index.test.ts +2 -2
- package/src/parser/inline/extension/indexee.ts +4 -3
- package/src/parser/inline/insertion.test.ts +1 -1
- package/src/parser/inline/mark.test.ts +1 -1
- package/src/parser/inline/reference.test.ts +2 -2
- package/src/parser/inline/template.test.ts +1 -1
- package/src/parser/processor/footnote.ts +3 -2
package/CHANGELOG.md
CHANGED
package/dist/securemark.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.233.
|
|
1
|
+
/*! securemark v0.233.1 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED */
|
|
2
2
|
require = function () {
|
|
3
3
|
function r(e, n, t) {
|
|
4
4
|
function o(i, f) {
|
|
@@ -6907,8 +6907,9 @@ require = function () {
|
|
|
6907
6907
|
return (0, combinator_1.fmap)(parser, ([el], _, {id}) => [(0, typed_dom_1.define)(el, { id: id !== '' && identity(text(el)) || global_1.undefined })]);
|
|
6908
6908
|
}
|
|
6909
6909
|
exports.indexee = indexee;
|
|
6910
|
-
function identity(
|
|
6911
|
-
|
|
6910
|
+
function identity(text) {
|
|
6911
|
+
text && (text = text.trim());
|
|
6912
|
+
return text && `index:${ text.replace(/\s+/g, '_').slice(0, 101).replace(/^(.{97}).{4}$/, '$1...') }`;
|
|
6912
6913
|
}
|
|
6913
6914
|
exports.identity = identity;
|
|
6914
6915
|
function text(source) {
|
|
@@ -8159,7 +8160,7 @@ require = function () {
|
|
|
8159
8160
|
} else {
|
|
8160
8161
|
(_b = ref.lastChild) === null || _b === void 0 ? void 0 : _b.remove();
|
|
8161
8162
|
}
|
|
8162
|
-
const title = global_1.undefined || titles.get(identifier) || +identifier[0] && ref.title || (0, indexee_1.text)(content).trim() || global_1.undefined;
|
|
8163
|
+
const title = global_1.undefined || titles.get(identifier) || +identifier[0] && ref.title || (0, indexee_1.text)(content).trim() || content.textContent.trim() || global_1.undefined;
|
|
8163
8164
|
title ? !titles.has(identifier) && titles.set(identifier, title) : buffer.set(identifier, ref);
|
|
8164
8165
|
const blank = !!abbr && !content.firstChild;
|
|
8165
8166
|
const refIndex = i + 1;
|
package/package-lock.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "securemark",
|
|
3
|
-
"version": "0.233.
|
|
3
|
+
"version": "0.233.1",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -3030,9 +3030,9 @@
|
|
|
3030
3030
|
"dev": true
|
|
3031
3031
|
},
|
|
3032
3032
|
"electron-to-chromium": {
|
|
3033
|
-
"version": "1.4.
|
|
3034
|
-
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.
|
|
3035
|
-
"integrity": "sha512-
|
|
3033
|
+
"version": "1.4.93",
|
|
3034
|
+
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.93.tgz",
|
|
3035
|
+
"integrity": "sha512-ywq9Pc5Gwwpv7NG767CtoU8xF3aAUQJjH9//Wy3MBCg4w5JSLbJUq2L8IsCdzPMjvSgxuue9WcVaTOyyxCL0aQ==",
|
|
3036
3036
|
"dev": true
|
|
3037
3037
|
},
|
|
3038
3038
|
"elliptic": {
|
|
@@ -6359,9 +6359,9 @@
|
|
|
6359
6359
|
"dev": true
|
|
6360
6360
|
},
|
|
6361
6361
|
"isbinaryfile": {
|
|
6362
|
-
"version": "4.0.
|
|
6363
|
-
"resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.
|
|
6364
|
-
"integrity": "sha512-
|
|
6362
|
+
"version": "4.0.9",
|
|
6363
|
+
"resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.9.tgz",
|
|
6364
|
+
"integrity": "sha512-GhwgwhMeEkMF/PmVpA+zRGCxoQvJ7PONqsKI+eq+ivgYolKe7AQdlqLFiSEBSTrO3YsQ2jvgwT2Gd6Z1TDcoaw==",
|
|
6365
6365
|
"dev": true
|
|
6366
6366
|
},
|
|
6367
6367
|
"isexe": {
|
|
@@ -7092,18 +7092,18 @@
|
|
|
7092
7092
|
}
|
|
7093
7093
|
},
|
|
7094
7094
|
"make-fetch-happen": {
|
|
7095
|
-
"version": "10.0
|
|
7096
|
-
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.0.
|
|
7097
|
-
"integrity": "sha512-
|
|
7095
|
+
"version": "10.1.0",
|
|
7096
|
+
"resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.0.tgz",
|
|
7097
|
+
"integrity": "sha512-HeP4QlkadP/Op+hE+Une1070kcyN85FshQObku3/rmzRh4zDcKXA19d2L3AQR6UoaX3uZmhSOpTLH15b1vOFvQ==",
|
|
7098
7098
|
"dev": true,
|
|
7099
7099
|
"requires": {
|
|
7100
7100
|
"agentkeepalive": "^4.2.1",
|
|
7101
|
-
"cacache": "^16.0.
|
|
7101
|
+
"cacache": "^16.0.2",
|
|
7102
7102
|
"http-cache-semantics": "^4.1.0",
|
|
7103
7103
|
"http-proxy-agent": "^5.0.0",
|
|
7104
7104
|
"https-proxy-agent": "^5.0.0",
|
|
7105
7105
|
"is-lambda": "^1.0.1",
|
|
7106
|
-
"lru-cache": "^7.
|
|
7106
|
+
"lru-cache": "^7.7.1",
|
|
7107
7107
|
"minipass": "^3.1.6",
|
|
7108
7108
|
"minipass-collect": "^1.0.2",
|
|
7109
7109
|
"minipass-fetch": "^2.0.3",
|
package/package.json
CHANGED
|
@@ -18,14 +18,14 @@ describe('Unit: parser/inline/annotation', () => {
|
|
|
18
18
|
assert.deepStrictEqual(inspect(parser('((\na))')), undefined);
|
|
19
19
|
assert.deepStrictEqual(inspect(parser('((\\ a))')), undefined);
|
|
20
20
|
assert.deepStrictEqual(inspect(parser('((\\\na))')), undefined);
|
|
21
|
+
assert.deepStrictEqual(inspect(parser('((<wbr>a))')), undefined);
|
|
21
22
|
assert.deepStrictEqual(inspect(parser('((a\n))')), undefined);
|
|
22
23
|
assert.deepStrictEqual(inspect(parser('((a\\\n))')), undefined);
|
|
23
24
|
assert.deepStrictEqual(inspect(parser('((a\nb))')), undefined);
|
|
24
25
|
assert.deepStrictEqual(inspect(parser('((a\\\nb))')), undefined);
|
|
25
|
-
assert.deepStrictEqual(inspect(parser('((<wbr>a))')), undefined);
|
|
26
|
-
assert.deepStrictEqual(inspect(parser('((a)b))')), undefined);
|
|
27
26
|
assert.deepStrictEqual(inspect(parser('((*a\nb*))')), undefined);
|
|
28
27
|
assert.deepStrictEqual(inspect(parser('((\\))')), undefined);
|
|
28
|
+
assert.deepStrictEqual(inspect(parser('((a)b))')), undefined);
|
|
29
29
|
assert.deepStrictEqual(inspect(parser('(((a))')), undefined);
|
|
30
30
|
assert.deepStrictEqual(inspect(parser(' ((a))')), undefined);
|
|
31
31
|
});
|
|
@@ -17,7 +17,7 @@ describe('Unit: parser/inline/deletion', () => {
|
|
|
17
17
|
|
|
18
18
|
it('basic', () => {
|
|
19
19
|
assert.deepStrictEqual(inspect(parser('~~a~~')), [['<del>a</del>'], '']);
|
|
20
|
-
assert.deepStrictEqual(inspect(parser('~~
|
|
20
|
+
assert.deepStrictEqual(inspect(parser('~~a~b~~')), [['<del>a~b</del>'], '']);
|
|
21
21
|
assert.deepStrictEqual(inspect(parser('~~a ~~')), [['<del>a </del>'], '']);
|
|
22
22
|
assert.deepStrictEqual(inspect(parser('~~ ~~')), [['<del> </del>'], '']);
|
|
23
23
|
assert.deepStrictEqual(inspect(parser('~~ a~~')), [['<del> a</del>'], '']);
|
|
@@ -54,8 +54,8 @@ describe('Unit: parser/inline/extension/index', () => {
|
|
|
54
54
|
assert.deepStrictEqual(inspect(parser('[#@a]')), [['<a class="index" href="#index:@a">@a</a>'], '']);
|
|
55
55
|
assert.deepStrictEqual(inspect(parser('[#http://host]')), [['<a class="index" href="#index:http://host">http://host</a>'], '']);
|
|
56
56
|
assert.deepStrictEqual(inspect(parser('[#!http://host]')), [['<a class="index" href="#index:!http://host">!http://host</a>'], '']);
|
|
57
|
-
assert.deepStrictEqual(inspect(parser('[#[# #]]')), [['<a class="index"
|
|
58
|
-
assert.deepStrictEqual(inspect(parser('[#[# a #]]')), [['<a class="index"
|
|
57
|
+
assert.deepStrictEqual(inspect(parser('[#[# #]]')), [['<a class="index"><span class="comment">[# #]</span></a>'], '']);
|
|
58
|
+
assert.deepStrictEqual(inspect(parser('[#[# a #]]')), [['<a class="index"><span class="comment">[# a #]</span></a>'], '']);
|
|
59
59
|
assert.deepStrictEqual(inspect(parser('[#a((b))]')), [['<a class="index" href="#index:a((b))">a<span class="paren">((b))</span></a>'], '']);
|
|
60
60
|
assert.deepStrictEqual(inspect(parser('[#a[[b]]]')), [['<a class="index" href="#index:a[[b]]">a[[b]]</a>'], '']);
|
|
61
61
|
});
|
|
@@ -9,9 +9,10 @@ export function indexee(parser: Parser<HTMLElement, MarkdownParser.Context>): Pa
|
|
|
9
9
|
return fmap(parser, ([el], _, { id }) => [define(el, { id: id !== '' && identity(text(el)) || undefined })]);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export function identity(
|
|
13
|
-
assert(!
|
|
14
|
-
|
|
12
|
+
export function identity(text: string): string {
|
|
13
|
+
assert(!text.includes('\n'));
|
|
14
|
+
text &&= text.trim();
|
|
15
|
+
return text && `index:${text.replace(/\s+/g, '_').slice(0, 101).replace(/^(.{97}).{4}$/, '$1...')}`;
|
|
15
16
|
}
|
|
16
17
|
assert(identity('0'.repeat(100)).slice(6) === '0'.repeat(100));
|
|
17
18
|
assert(identity('0'.repeat(101)).slice(6) === '0'.repeat(97) + '...');
|
|
@@ -17,7 +17,7 @@ describe('Unit: parser/inline/insertion', () => {
|
|
|
17
17
|
|
|
18
18
|
it('basic', () => {
|
|
19
19
|
assert.deepStrictEqual(inspect(parser('++a++')), [['<ins>a</ins>'], '']);
|
|
20
|
-
assert.deepStrictEqual(inspect(parser('++
|
|
20
|
+
assert.deepStrictEqual(inspect(parser('++a+b++')), [['<ins>a+b</ins>'], '']);
|
|
21
21
|
assert.deepStrictEqual(inspect(parser('++a ++')), [['<ins>a </ins>'], '']);
|
|
22
22
|
assert.deepStrictEqual(inspect(parser('++ ++')), [['<ins> </ins>'], '']);
|
|
23
23
|
assert.deepStrictEqual(inspect(parser('++ a++')), [['<ins> a</ins>'], '']);
|
|
@@ -27,7 +27,7 @@ describe('Unit: parser/inline/mark', () => {
|
|
|
27
27
|
|
|
28
28
|
it('basic', () => {
|
|
29
29
|
assert.deepStrictEqual(inspect(parser('==a==')), [['<mark>a</mark>'], '']);
|
|
30
|
-
assert.deepStrictEqual(inspect(parser('==
|
|
30
|
+
assert.deepStrictEqual(inspect(parser('==a=b==')), [['<mark>a=b</mark>'], '']);
|
|
31
31
|
assert.deepStrictEqual(inspect(parser('==a\nb==')), [['<mark>a<br>b</mark>'], '']);
|
|
32
32
|
assert.deepStrictEqual(inspect(parser('==a\\\nb==')), [['<mark>a<span class="linebreak"> </span>b</mark>'], '']);
|
|
33
33
|
assert.deepStrictEqual(inspect(parser('==\\===')), [['<mark>=</mark>'], '']);
|
|
@@ -18,14 +18,14 @@ describe('Unit: parser/inline/reference', () => {
|
|
|
18
18
|
assert.deepStrictEqual(inspect(parser('[[\na]]')), undefined);
|
|
19
19
|
assert.deepStrictEqual(inspect(parser('[[\\ a]]')), undefined);
|
|
20
20
|
assert.deepStrictEqual(inspect(parser('[[\\\na]]')), undefined);
|
|
21
|
+
assert.deepStrictEqual(inspect(parser('[[<wbr>a]]')), undefined);
|
|
21
22
|
assert.deepStrictEqual(inspect(parser('[[a\n]]')), undefined);
|
|
22
23
|
assert.deepStrictEqual(inspect(parser('[[a\\\n]]')), undefined);
|
|
23
24
|
assert.deepStrictEqual(inspect(parser('[[a\nb]]')), undefined);
|
|
24
25
|
assert.deepStrictEqual(inspect(parser('[[a\\\nb]]')), undefined);
|
|
25
|
-
assert.deepStrictEqual(inspect(parser('[[<wbr>a]]')), undefined);
|
|
26
|
-
assert.deepStrictEqual(inspect(parser('[[a]b]]')), undefined);
|
|
27
26
|
assert.deepStrictEqual(inspect(parser('[[*a\nb*]]')), undefined);
|
|
28
27
|
assert.deepStrictEqual(inspect(parser('[[\\]]')), undefined);
|
|
28
|
+
assert.deepStrictEqual(inspect(parser('[[a]b]]')), undefined);
|
|
29
29
|
assert.deepStrictEqual(inspect(parser('[[[a]]')), undefined);
|
|
30
30
|
assert.deepStrictEqual(inspect(parser(' [[a]]')), undefined);
|
|
31
31
|
});
|
|
@@ -11,8 +11,8 @@ describe('Unit: parser/inline/template', () => {
|
|
|
11
11
|
assert.deepStrictEqual(inspect(parser('{')), undefined);
|
|
12
12
|
assert.deepStrictEqual(inspect(parser('{}')), undefined);
|
|
13
13
|
assert.deepStrictEqual(inspect(parser('{{')), undefined);
|
|
14
|
-
assert.deepStrictEqual(inspect(parser('{{a}b}}')), undefined);
|
|
15
14
|
assert.deepStrictEqual(inspect(parser('{{\\}}')), undefined);
|
|
15
|
+
assert.deepStrictEqual(inspect(parser('{{a}b}')), undefined);
|
|
16
16
|
assert.deepStrictEqual(inspect(parser('{{{a}}')), undefined);
|
|
17
17
|
assert.deepStrictEqual(inspect(parser(' {{}}')), undefined);
|
|
18
18
|
});
|
|
@@ -22,8 +22,8 @@ function build(
|
|
|
22
22
|
marker: (index: number, abbr: string | undefined) => string,
|
|
23
23
|
) {
|
|
24
24
|
assert(syntax.match(/^[a-z]+$/));
|
|
25
|
-
// Referenceを含むAnnotation
|
|
26
|
-
//
|
|
25
|
+
// Referenceを含むAnnotationの重複排除は両構文が互いに処理済みであることを必要とするため
|
|
26
|
+
// 構文ごとに各1回の処理では不可能
|
|
27
27
|
const identify = memoize<HTMLElement, string>(
|
|
28
28
|
ref => `${+!ref.querySelector('.label')}:${ref.getAttribute('data-abbr') || '_' + ref.innerHTML}`,
|
|
29
29
|
new WeakMap());
|
|
@@ -69,6 +69,7 @@ function build(
|
|
|
69
69
|
|| titles.get(identifier)
|
|
70
70
|
|| +identifier[0] && ref.title
|
|
71
71
|
|| text(content).trim()
|
|
72
|
+
|| content.textContent!.trim()
|
|
72
73
|
|| undefined;
|
|
73
74
|
title
|
|
74
75
|
? !titles.has(identifier) && titles.set(identifier, title)
|