rapier-html 1.2.45 → 1.2.48
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/BUILD.json +16 -16
- package/README.md +13 -12
- package/dist/ledger/LICENSE +12 -5
- package/dist/ledger/authored-origin.mjs +2 -2
- package/dist/ledger/authorship.mjs +5 -5
- package/dist/ledger/carried.mjs +21 -12
- package/dist/ledger/diff/concerns.mjs +3 -3
- package/dist/ledger/diff/diff.mjs +6 -6
- package/dist/ledger/diff/index.mjs +2 -2
- package/dist/ledger/diff/merge.mjs +3 -3
- package/dist/ledger/diff/moves.mjs +1 -1
- package/dist/ledger/diff/walk.mjs +1 -1
- package/dist/ledger/document-fonts.mjs +296 -0
- package/dist/ledger/document-settings.mjs +2 -2
- package/dist/ledger/format.mjs +14 -12
- package/dist/ledger/history.mjs +7 -7
- package/dist/ledger/inverse-source.mjs +5 -5
- package/dist/ledger/journal-records.mjs +3 -3
- package/dist/ledger/math/delimiters.mjs +38 -0
- package/dist/ledger/math/markdown-rules.mjs +103 -0
- package/dist/ledger/md-assets.mjs +3 -2
- package/dist/ledger/md-comments.mjs +384 -0
- package/dist/ledger/md-engine.mjs +157 -0
- package/dist/ledger/md-marks.mjs +10 -1
- package/dist/ledger/md-parser-config.mjs +463 -0
- package/dist/ledger/md-parser-runtime.mjs +23 -0
- package/dist/ledger/md-source.mjs +1 -1
- package/dist/ledger/source.mjs +31 -2
- package/dist/ledger/template-page.mjs +1 -1
- package/dist/ledger/transport.mjs +66 -7
- package/dist/ledger/vendor/NOTICE.txt +60 -0
- package/dist/ledger/vendor/SOURCES.json +253 -0
- package/dist/ledger/vendor/entities/decode-codepoint.mjs +27 -0
- package/dist/ledger/vendor/entities.mjs +499 -0
- package/dist/ledger/vendor/linkify-it.mjs +427 -0
- package/dist/ledger/vendor/markdown-it.mjs +4027 -0
- package/dist/ledger/vendor/markdown-licenses/entities-LICENSE.txt +11 -0
- package/dist/ledger/vendor/markdown-licenses/linkify-it-LICENSE.txt +22 -0
- package/dist/ledger/vendor/markdown-licenses/markdown-it-LICENSE.txt +22 -0
- package/dist/ledger/vendor/markdown-licenses/mdurl-LICENSE.txt +45 -0
- package/dist/ledger/vendor/markdown-licenses/punycode.js-LICENSE-MIT.txt +20 -0
- package/dist/ledger/vendor/markdown-licenses/uc.micro-LICENSE.txt +20 -0
- package/dist/ledger/vendor/markdown-plugins.mjs +1344 -0
- package/dist/ledger/vendor/markdown-runtime.mjs +5 -0
- package/dist/ledger/vendor/mdurl/index.mjs +11 -0
- package/dist/ledger/vendor/mdurl/lib/decode.mjs +107 -0
- package/dist/ledger/vendor/mdurl/lib/encode.mjs +77 -0
- package/dist/ledger/vendor/mdurl/lib/format.mjs +20 -0
- package/dist/ledger/vendor/mdurl/lib/parse.mjs +231 -0
- package/dist/ledger/vendor/punycode.mjs +282 -0
- package/dist/ledger/vendor/uc.micro.mjs +49 -0
- package/dist/page.mjs +11 -3
- package/dist/rapier.html +113 -75
- package/dist/wrap.mjs +10 -5
- package/package.json +1 -1
package/dist/ledger/source.mjs
CHANGED
|
@@ -70,13 +70,42 @@ function sourceString(node) {
|
|
|
70
70
|
}
|
|
71
71
|
const replacements = new WeakMap(), texts = new WeakMap(), edits = new WeakMap();
|
|
72
72
|
export const sourceEdit = source => edits.get(source) || null;
|
|
73
|
+
const INITIAL_LEAF_CHARS = 16384;
|
|
73
74
|
export class HistorySource {
|
|
74
75
|
#root;
|
|
75
|
-
constructor(text) {
|
|
76
|
+
constructor(text) {
|
|
77
|
+
if (typeof text === 'string' && text.length > INITIAL_LEAF_CHARS) {
|
|
78
|
+
const leaves = [];
|
|
79
|
+
for (let from = 0; from < text.length;) {
|
|
80
|
+
let to = Math.min(text.length, from + INITIAL_LEAF_CHARS);
|
|
81
|
+
if (to < text.length && (text.charCodeAt(to - 1) & 0xfc00) === 0xd800 && (text.charCodeAt(to) & 0xfc00) === 0xdc00) to++;
|
|
82
|
+
leaves.push(sourceLeaf(text, from, to));
|
|
83
|
+
from = to;
|
|
84
|
+
}
|
|
85
|
+
const build = (from, to) => from === to ? null : to - from === 1 ? leaves[from]
|
|
86
|
+
: sourceNode(build(from, (from + to) >> 1), build((from + to) >> 1, to));
|
|
87
|
+
this.#root = build(0, leaves.length);
|
|
88
|
+
} else this.#root = sourceLeaf(text);
|
|
89
|
+
Object.freeze(this);
|
|
90
|
+
}
|
|
76
91
|
static owns(value) { return value !== null && typeof value === 'object' && #root in value; }
|
|
77
92
|
static #fromRoot(root) { const source = new HistorySource(''); source.#root = root; return source; }
|
|
78
93
|
static fromParts(parts) {
|
|
79
|
-
const leaves =
|
|
94
|
+
const leaves = [];
|
|
95
|
+
for (const text of parts) {
|
|
96
|
+
if (typeof text !== 'string') throw new TypeError('source string required');
|
|
97
|
+
if (text.length <= INITIAL_LEAF_CHARS) {
|
|
98
|
+
const leaf = sourceLeaf(text);
|
|
99
|
+
if (leaf) leaves.push(leaf);
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
for (let from = 0; from < text.length;) {
|
|
103
|
+
let to = Math.min(text.length, from + INITIAL_LEAF_CHARS);
|
|
104
|
+
if (to < text.length && (text.charCodeAt(to - 1) & 0xfc00) === 0xd800 && (text.charCodeAt(to) & 0xfc00) === 0xdc00) to++;
|
|
105
|
+
leaves.push(sourceLeaf(text, from, to));
|
|
106
|
+
from = to;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
80
109
|
const build = (from, to) => from === to ? null : to - from === 1 ? leaves[from]
|
|
81
110
|
: sourceNode(build(from, Math.floor((from + to) / 2)), build(Math.floor((from + to) / 2), to));
|
|
82
111
|
return HistorySource.#fromRoot(build(0, leaves.length));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
import {readDocumentSettings} from
|
|
2
|
+
import {readDocumentSettings} from "./document-settings.mjs";
|
|
3
3
|
export const isTemplatePage = source => readDocumentSettings(source).template === 'page';
|
|
4
4
|
export const isPageBorderLayout = layout => layout?.wrap === 'behind' && layout.lock === 'on';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
import {_rapierTransformSplices, _rapierValidAuthored, _rapierHistoryEffects} from
|
|
3
|
-
import {projectInverseSource} from
|
|
4
|
-
import {authoredBasis, authoredPlacement, authoredPlacements} from
|
|
5
|
-
import {sha256} from
|
|
6
|
-
import {canonicalJSON} from
|
|
2
|
+
import {_rapierTransformSplices, _rapierValidAuthored, _rapierHistoryEffects} from "./journal-records.mjs";
|
|
3
|
+
import {projectInverseSource} from "./inverse-source.mjs";
|
|
4
|
+
import {authoredBasis, authoredPlacement, authoredPlacements} from "./authored-origin.mjs";
|
|
5
|
+
import {sha256} from "./hash.mjs";
|
|
6
|
+
import {canonicalJSON} from "./data.mjs";
|
|
7
|
+
import {parseComments, commentSplices, derivedCommentEdits} from "./md-comments.mjs";
|
|
7
8
|
|
|
8
9
|
const whole = text => typeof text === 'string' && !/[\uD800-\uDFFF]/u.test(text);
|
|
9
10
|
function admitted(rows) {
|
|
@@ -59,7 +60,65 @@ function applyBatch(text, rows) {
|
|
|
59
60
|
return {text: after, splices: exact};
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
export function transposeRecord(base, splices, id, records) {
|
|
63
|
+
export function transposeRecord(base, splices, id, records, derivedCommentIndex) {
|
|
64
|
+
const comments = transposeCommentRecord(base, splices, id, records, derivedCommentIndex);
|
|
65
|
+
return comments || transposeTextRecord(base, splices, id, records);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function commentRecordProof(source, splices, index) {
|
|
69
|
+
if (typeof source !== 'string' || !source.includes('<!-- md-comments:') ||
|
|
70
|
+
!Array.isArray(splices) || !Number.isSafeInteger(index) || index !== splices.length - 1) return null;
|
|
71
|
+
try {
|
|
72
|
+
const parsed = parseComments(source), proof = derivedCommentEdits(source, splices);
|
|
73
|
+
if (!parsed.record || parsed.reason || !parsed.current || !proof || proof.edits.length !== index ||
|
|
74
|
+
canonicalJSON(proof.edits) !== canonicalJSON(splices.slice(0, index))) return null;
|
|
75
|
+
let start = parsed.record.start;
|
|
76
|
+
for (const row of proof.edits) {
|
|
77
|
+
if (row.pos >= start || row.pos + row.removed.length > start) return null;
|
|
78
|
+
start += row.inserted.length - row.removed.length;
|
|
79
|
+
}
|
|
80
|
+
const derived = commentSplices(source, proof.edits);
|
|
81
|
+
if (derived.length !== 1 || canonicalJSON(derived[0]) !== canonicalJSON(splices[index])) return null;
|
|
82
|
+
return {parsed, edits: proof.edits, text: _rapierTransformSplices(source, splices)};
|
|
83
|
+
} catch (_) { return null; }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function transposeCommentRecord(base, splices, id, records, derivedCommentIndex) {
|
|
87
|
+
if (!Array.isArray(records) || !records.length) return null;
|
|
88
|
+
const local = commentRecordProof(base, splices, derivedCommentIndex);
|
|
89
|
+
if (!local) return null;
|
|
90
|
+
const bodyRecords = []; let current = base;
|
|
91
|
+
for (const record of records) {
|
|
92
|
+
const proof = commentRecordProof(current, record.splices, record.derivedCommentIndex);
|
|
93
|
+
if (!proof) return null;
|
|
94
|
+
bodyRecords.push({...record, splices: proof.edits}); current = proof.text;
|
|
95
|
+
}
|
|
96
|
+
const moved = transposeTextRecord(local.parsed.body, local.edits, id, bodyRecords);
|
|
97
|
+
const derive = (source, rows) => {
|
|
98
|
+
const parsed = parseComments(source); let start = parsed.record?.start;
|
|
99
|
+
if (!parsed.record || parsed.reason || !parsed.current) throw new RangeError('canonical_act_rebase_conflict');
|
|
100
|
+
for (const row of rows) {
|
|
101
|
+
if (row.pos >= start || row.pos + row.removed.length > start) throw new RangeError('canonical_act_rebase_conflict');
|
|
102
|
+
start += row.inserted.length - row.removed.length;
|
|
103
|
+
}
|
|
104
|
+
const footer = commentSplices(source, rows), splices = [...rows, ...footer];
|
|
105
|
+
const text = _rapierTransformSplices(source, splices), after = text === null ? null : parseComments(text);
|
|
106
|
+
if (!after?.record || after.reason || !after.current) throw new RangeError('canonical_act_rebase_conflict');
|
|
107
|
+
return {text, splices, footer};
|
|
108
|
+
};
|
|
109
|
+
const accepted = derive(current, moved.splices);
|
|
110
|
+
let reciprocal = local.text;
|
|
111
|
+
const against = moved.against.map(record => {
|
|
112
|
+
const value = derive(reciprocal, record.splices); reciprocal = value.text;
|
|
113
|
+
return {...record, splices: value.splices};
|
|
114
|
+
});
|
|
115
|
+
if (reciprocal !== accepted.text || parseComments(accepted.text).body !== moved.text)
|
|
116
|
+
throw new RangeError('canonical_transport_invalid');
|
|
117
|
+
return {text: accepted.text, splices: accepted.splices, against,
|
|
118
|
+
sourceIndices: [...moved.sourceIndices, ...accepted.footer.map(() => derivedCommentIndex)]};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function transposeTextRecord(base, splices, id, records) {
|
|
63
122
|
if (typeof base !== 'string' || !Array.isArray(splices) || typeof id !== 'string' || !Array.isArray(records))
|
|
64
123
|
throw new RangeError('canonical_transport_invalid');
|
|
65
124
|
let source = base, current = base;
|
|
@@ -305,7 +364,7 @@ function authoredReplay(base, records, append = null) {
|
|
|
305
364
|
throw new RangeError('canonical_origin_invalid');
|
|
306
365
|
const accepted = projectInverse(text, aligned.records, id);
|
|
307
366
|
moved = {text: accepted.after, splices: accepted.splices};
|
|
308
|
-
} else moved = transposeRecord(basis.text, origin.splices, id, crossed);
|
|
367
|
+
} else moved = transposeRecord(basis.text, origin.splices, id, crossed, original.derivedCommentIndex);
|
|
309
368
|
if (_rapierTransformSplices(text, moved.splices) !== moved.text) throw new RangeError('canonical_origin_invalid');
|
|
310
369
|
placed.push({...original, splices: moved.splices}); text = moved.text; ids.add(id);
|
|
311
370
|
if (original.derivedCommentIndex != null) sourceIndices.set(id, moved.sourceIndices);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
These components are distributed under the MIT licence,
|
|
4
|
+
each under its own copyright notice:
|
|
5
|
+
|
|
6
|
+
gpu-lexer 0.0.4
|
|
7
|
+
Copyright (c) 2026 Shu Ding
|
|
8
|
+
acorn 8.19.0
|
|
9
|
+
Copyright (C) 2012-2022 by various contributors (see AUTHORS)
|
|
10
|
+
markdown-it 15.0.3
|
|
11
|
+
Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin.
|
|
12
|
+
linkify-it 6.1.0, bundled inside the markdown-it build
|
|
13
|
+
Copyright (c) 2015 Vitaly Puzrin.
|
|
14
|
+
markdown-it-emoji 3.1.0
|
|
15
|
+
Copyright (c) 2014 Vitaly Puzrin.
|
|
16
|
+
markdown-it-footnote 4.0.0, -mark 4.0.0, -ins 4.0.0,
|
|
17
|
+
-abbr 2.0.0, -sub 2.0.0, -sup 2.0.0, -deflist 4.0.0
|
|
18
|
+
Copyright (c) 2014-2015 Vitaly Puzrin, Alex Kocharin.
|
|
19
|
+
Turndown 7.2.4
|
|
20
|
+
Copyright (c) 2017 Dom Christie
|
|
21
|
+
collapse-whitespace, adapted inside Turndown
|
|
22
|
+
Copyright (c) 2014 Luc Thevenard
|
|
23
|
+
Feather icons: info, message-square, alert-triangle, alert-octagon
|
|
24
|
+
Copyright (c) 2013-2023 Cole Bemis
|
|
25
|
+
https://github.com/feathericons/feather/tree/main/icons
|
|
26
|
+
Rapier's lightbulb matches the stroke conventions; it is not a Feather icon.
|
|
27
|
+
|
|
28
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
30
|
+
in the Software without restriction, including without limitation the rights
|
|
31
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
33
|
+
furnished to do so, subject to the following conditions:
|
|
34
|
+
|
|
35
|
+
The above copyright notice and this permission notice shall be included in
|
|
36
|
+
all copies or substantial portions of the Software.
|
|
37
|
+
|
|
38
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
44
|
+
THE SOFTWARE.
|
|
45
|
+
|
|
46
|
+
ISC License — markdown-it-task-lists 2.1.1
|
|
47
|
+
|
|
48
|
+
Copyright (c) 2016, Revin Guillen
|
|
49
|
+
|
|
50
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
51
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
52
|
+
copyright notice and this permission notice appear in all copies.
|
|
53
|
+
|
|
54
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
55
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
56
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
57
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
58
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
59
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
60
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "rapier-markdown-readable/1",
|
|
3
|
+
"description": "The pinned markdown-it 15.0.3 compiled unminified from its published sources, as the page's copy is, with its runtime dependencies and plugins as published, for the installed helpers. Written by tools/markdown-readable-vendor.mjs; licences in agent/vendor/NOTICE.txt and agent/vendor/markdown-licenses/.",
|
|
4
|
+
"packages": [
|
|
5
|
+
{
|
|
6
|
+
"name": "markdown-it",
|
|
7
|
+
"version": "15.0.3",
|
|
8
|
+
"tarball": "https://registry.npmjs.org/markdown-it/-/markdown-it-15.0.3.tgz",
|
|
9
|
+
"integrity": "sha512-+Az7Ojz3iRGu8KYMvJ6xVhvrxP3eE+vEtJX75Ow88XBpcQNV/0lGX5ZynIIBftREo4DC2jsveAMDaeltmm8QvQ=="
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "entities",
|
|
13
|
+
"version": "8.1.0",
|
|
14
|
+
"tarball": "https://registry.npmjs.org/entities/-/entities-8.1.0.tgz",
|
|
15
|
+
"integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA=="
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "linkify-it",
|
|
19
|
+
"version": "6.1.0",
|
|
20
|
+
"tarball": "https://registry.npmjs.org/linkify-it/-/linkify-it-6.1.0.tgz",
|
|
21
|
+
"integrity": "sha512-wJ/TwpSDTLepCrQoYWYIExIKg5Zchex2Nn5yk2mFnB+6PtdkHtyLx742md9csRjjOnGkKIS/RrbY7l8D6gT9Vw=="
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "mdurl",
|
|
25
|
+
"version": "2.1.0",
|
|
26
|
+
"tarball": "https://registry.npmjs.org/mdurl/-/mdurl-2.1.0.tgz",
|
|
27
|
+
"integrity": "sha512-1+HBaOx0zi/dQWht8rNv9MYf9qqpqL/kxI0hXImU6Y547zM6Sni8BQibt7ifgMcYtQg41ao3Ivd6cnSM86inpg=="
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "uc.micro",
|
|
31
|
+
"version": "3.0.0",
|
|
32
|
+
"tarball": "https://registry.npmjs.org/uc.micro/-/uc.micro-3.0.0.tgz",
|
|
33
|
+
"integrity": "sha512-U3PppEkleoTnIfi8BozMx3yju3qc/L6SwqWo2Sw+54PX+PX0q9I+r1Um5HCmqD7n9VDX5/v3vQH/AjA6deDdtw=="
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "punycode.js",
|
|
37
|
+
"version": "2.3.1",
|
|
38
|
+
"tarball": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz",
|
|
39
|
+
"integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA=="
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "markdown-it-task-lists",
|
|
43
|
+
"version": "2.1.1",
|
|
44
|
+
"tarball": "https://registry.npmjs.org/markdown-it-task-lists/-/markdown-it-task-lists-2.1.1.tgz",
|
|
45
|
+
"integrity": "sha512-TxFAc76Jnhb2OUu+n3yz9RMu4CwGfaT788br6HhEDlvWfdeJcLUsxk1Hgw2yJio0OXsxv7pyIPmvECY7bMbluA=="
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "markdown-it-footnote",
|
|
49
|
+
"version": "4.0.0",
|
|
50
|
+
"tarball": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-4.0.0.tgz",
|
|
51
|
+
"integrity": "sha512-WYJ7urf+khJYl3DqofQpYfEYkZKbmXmwxQV8c8mO/hGIhgZ1wOe7R4HLFNwqx7TjILbnC98fuyeSsin19JdFcQ=="
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "markdown-it-mark",
|
|
55
|
+
"version": "4.0.0",
|
|
56
|
+
"tarball": "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-4.0.0.tgz",
|
|
57
|
+
"integrity": "sha512-YLhzaOsU9THO/cal0lUjfMjrqSMPjjyjChYM7oyj4DnyaXEzA8gnW6cVJeyCrCVeyesrY2PlEdUYJSPFYL4Nkg=="
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "markdown-it-sup",
|
|
61
|
+
"version": "2.0.0",
|
|
62
|
+
"tarball": "https://registry.npmjs.org/markdown-it-sup/-/markdown-it-sup-2.0.0.tgz",
|
|
63
|
+
"integrity": "sha512-5VgmdKlkBd8sgXuoDoxMpiU+BiEt3I49GItBzzw7Mxq9CxvnhE/k09HFli09zgfFDRixDQDfDxi0mgBCXtaTvA=="
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "markdown-it-emoji",
|
|
67
|
+
"version": "3.1.0",
|
|
68
|
+
"tarball": "https://registry.npmjs.org/markdown-it-emoji/-/markdown-it-emoji-3.1.0.tgz",
|
|
69
|
+
"integrity": "sha512-NhmMEH2ywduD4Nty1E8uB5NqfLhAT1VR0dyvoJyStKOqCzbZmVdn/+8wj7zpDsb/fLBikpCPsWwxqKlvMmbz4g=="
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "markdown-it-abbr",
|
|
73
|
+
"version": "2.0.0",
|
|
74
|
+
"tarball": "https://registry.npmjs.org/markdown-it-abbr/-/markdown-it-abbr-2.0.0.tgz",
|
|
75
|
+
"integrity": "sha512-of7C8pXSjXjDojW4neNP+jD7inUYH/DO0Ca+K/4FUEccg0oHAEX/nfscw0jfz66PJbYWOAT9U8mjO21X5p6aAw=="
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "markdown-it-ins",
|
|
79
|
+
"version": "4.0.0",
|
|
80
|
+
"tarball": "https://registry.npmjs.org/markdown-it-ins/-/markdown-it-ins-4.0.0.tgz",
|
|
81
|
+
"integrity": "sha512-sWbjK2DprrkINE4oYDhHdCijGT+MIDhEupjSHLXe5UXeVr5qmVxs/nTUVtgi0Oh/qtF+QKV0tNWDhQBEPxiMew=="
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "markdown-it-deflist",
|
|
85
|
+
"version": "4.0.0",
|
|
86
|
+
"tarball": "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-4.0.0.tgz",
|
|
87
|
+
"integrity": "sha512-06186ZWDwNLg638THD70MxBeFrDMF0+nL7IWU/qwCGHGOcUIm4MTYXbfjpv0ooWnVjkSnAjW8msKaOQmNRfY6Q=="
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"build": {
|
|
91
|
+
"path": "markdown-it.mjs",
|
|
92
|
+
"package": "markdown-it",
|
|
93
|
+
"map": "dist/markdown-it.mjs.map",
|
|
94
|
+
"imports": {
|
|
95
|
+
"mdurl": "./mdurl/index.mjs",
|
|
96
|
+
"uc.micro": "./uc.micro.mjs",
|
|
97
|
+
"entities": "./entities.mjs",
|
|
98
|
+
"linkify-it": "./linkify-it.mjs",
|
|
99
|
+
"punycode.js": "./punycode.mjs"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"copies": [
|
|
103
|
+
{
|
|
104
|
+
"path": "linkify-it.mjs",
|
|
105
|
+
"package": "linkify-it",
|
|
106
|
+
"from": "build/index.mjs",
|
|
107
|
+
"imports": {
|
|
108
|
+
"uc.micro": "./uc.micro.mjs"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"path": "uc.micro.mjs",
|
|
113
|
+
"package": "uc.micro",
|
|
114
|
+
"from": "build/index.mjs"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"path": "punycode.mjs",
|
|
118
|
+
"package": "punycode.js",
|
|
119
|
+
"from": "punycode.es6.js"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"path": "entities/decode-codepoint.mjs",
|
|
123
|
+
"package": "entities",
|
|
124
|
+
"from": "dist/decode-codepoint.js"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"path": "mdurl/index.mjs",
|
|
128
|
+
"package": "mdurl",
|
|
129
|
+
"from": "index.mjs"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"path": "mdurl/lib/decode.mjs",
|
|
133
|
+
"package": "mdurl",
|
|
134
|
+
"from": "lib/decode.mjs"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"path": "mdurl/lib/encode.mjs",
|
|
138
|
+
"package": "mdurl",
|
|
139
|
+
"from": "lib/encode.mjs"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"path": "mdurl/lib/format.mjs",
|
|
143
|
+
"package": "mdurl",
|
|
144
|
+
"from": "lib/format.mjs"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"path": "mdurl/lib/parse.mjs",
|
|
148
|
+
"package": "mdurl",
|
|
149
|
+
"from": "lib/parse.mjs"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"plugins": [
|
|
153
|
+
{
|
|
154
|
+
"package": "markdown-it-task-lists",
|
|
155
|
+
"from": "dist/markdown-it-task-lists.js"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"package": "markdown-it-footnote",
|
|
159
|
+
"from": "dist/markdown-it-footnote.js"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"package": "markdown-it-mark",
|
|
163
|
+
"from": "dist/markdown-it-mark.js"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"package": "markdown-it-sup",
|
|
167
|
+
"from": "dist/markdown-it-sup.js"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"package": "markdown-it-emoji",
|
|
171
|
+
"from": "dist/markdown-it-emoji-light.js"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"package": "markdown-it-abbr",
|
|
175
|
+
"from": "dist/markdown-it-abbr.js"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"package": "markdown-it-ins",
|
|
179
|
+
"from": "dist/markdown-it-ins.js"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"package": "markdown-it-deflist",
|
|
183
|
+
"from": "dist/markdown-it-deflist.js"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"files": [
|
|
187
|
+
{
|
|
188
|
+
"path": "entities.mjs",
|
|
189
|
+
"bytes": 50594,
|
|
190
|
+
"sha256": "7914d95849325717065db7db37b8fcd6f8ffaaa3aa481f1bde687209f844da38"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"path": "entities/decode-codepoint.mjs",
|
|
194
|
+
"bytes": 948,
|
|
195
|
+
"sha256": "d80628653e792234aca25c5b431523753af5c827339140d38e265d726a136579"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"path": "linkify-it.mjs",
|
|
199
|
+
"bytes": 16516,
|
|
200
|
+
"sha256": "9e2b21808450980d055f1cc159293c32eb0eecc205fe19b67ded4d7fee08aca6"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"path": "markdown-it.mjs",
|
|
204
|
+
"bytes": 111298,
|
|
205
|
+
"sha256": "73c4a1041d82dddb670375e9889bc91492c0c1c150c2c8f33267cfb3790c5d05"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"path": "markdown-plugins.mjs",
|
|
209
|
+
"bytes": 45734,
|
|
210
|
+
"sha256": "0a935c55fb20f684271d32f37819d0811ca0772c2e9cd4b1822aab2507525555"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"path": "markdown-runtime.mjs",
|
|
214
|
+
"bytes": 110,
|
|
215
|
+
"sha256": "8ce7c709299538e10b844b7f051dd784b67f0515efdd4bd167be13e0deb97f5b"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"path": "mdurl/index.mjs",
|
|
219
|
+
"bytes": 200,
|
|
220
|
+
"sha256": "8ea430f1f8a107f529e2dac519d2f18e71ec9befe6f23f78bf6510cf86d3f9a0"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"path": "mdurl/lib/decode.mjs",
|
|
224
|
+
"bytes": 2692,
|
|
225
|
+
"sha256": "6a854a029a7211a14575cbb43922734fa8a11be28a00e184463848582a349d6a"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"path": "mdurl/lib/encode.mjs",
|
|
229
|
+
"bytes": 1697,
|
|
230
|
+
"sha256": "65aa62a0e96659b9bb53ab0b4e64d5917be86e964e2f121dfce21e30a88448cb"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"path": "mdurl/lib/format.mjs",
|
|
234
|
+
"bytes": 465,
|
|
235
|
+
"sha256": "ac3695720223d7e38b1a8c061c8615b8a74b2dd56f383d3029db073430322ea6"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"path": "mdurl/lib/parse.mjs",
|
|
239
|
+
"bytes": 6205,
|
|
240
|
+
"sha256": "ac8f5a5a4a68f2c03f4624f672a5c28b425e0ddd52b8483d6c2b9a60056dcc81"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"path": "punycode.mjs",
|
|
244
|
+
"bytes": 5921,
|
|
245
|
+
"sha256": "ad32ca11244584756cc645b69679cb0df608428443f081f20bbad269afd15ff1"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"path": "uc.micro.mjs",
|
|
249
|
+
"bytes": 6384,
|
|
250
|
+
"sha256": "17ece0a12a868a21119fd68dad490664cc5f7e116102ec939f586bf203a977cb"
|
|
251
|
+
}
|
|
252
|
+
]
|
|
253
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const c1 = [
|
|
2
|
+
8364, 0, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, 0,
|
|
3
|
+
381, 0, 0, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250,
|
|
4
|
+
339, 0, 382, 376,
|
|
5
|
+
];
|
|
6
|
+
function isInvalidCodePoint(codePoint) {
|
|
7
|
+
return (codePoint === 0 ||
|
|
8
|
+
(codePoint >= 0xd8_00 && codePoint <= 0xdf_ff) ||
|
|
9
|
+
codePoint > 0x10_ff_ff);
|
|
10
|
+
}
|
|
11
|
+
export function replaceCodePoint(codePoint) {
|
|
12
|
+
if (isInvalidCodePoint(codePoint)) {
|
|
13
|
+
return 0xff_fd;
|
|
14
|
+
}
|
|
15
|
+
if (codePoint >= 128 && codePoint <= 159) {
|
|
16
|
+
return c1[codePoint - 128] || codePoint;
|
|
17
|
+
}
|
|
18
|
+
return codePoint;
|
|
19
|
+
}
|
|
20
|
+
export function replaceCodePointXML(codePoint) {
|
|
21
|
+
return isInvalidCodePoint(codePoint) ? 0xff_fd : codePoint;
|
|
22
|
+
}
|
|
23
|
+
export function codePointToString(codePoint) {
|
|
24
|
+
return (codePoint - 1) >>> 0 < 0x7f || (codePoint - 0xa0) >>> 0 < 0xd7_60
|
|
25
|
+
? String.fromCharCode(codePoint)
|
|
26
|
+
: String.fromCodePoint(replaceCodePoint(codePoint));
|
|
27
|
+
}
|