securemark 0.280.5 → 0.280.6
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/extension/indexee.ts +2 -6
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.280.
|
|
1
|
+
/*! securemark v0.280.6 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"));
|
|
@@ -6251,7 +6251,6 @@ function identity(id, text, type = 'index') {
|
|
|
6251
6251
|
if (cs.length <= 120) return `${type}:${id ?? ''}:${text}`;
|
|
6252
6252
|
switch (type) {
|
|
6253
6253
|
case 'index':
|
|
6254
|
-
return `${type}:${id ?? ''}:${cs.slice(0, 120 - 3).join('')}...`;
|
|
6255
6254
|
case 'mark':
|
|
6256
6255
|
return `${type}:${id ?? ''}:${cs.slice(0, 38).join('')}...${cs.slice(cs.length / 2 - 38 / 2 | 0).slice(0, 38).join('')}...${cs.slice(-38).join('')}`;
|
|
6257
6256
|
}
|
package/package.json
CHANGED
|
@@ -20,18 +20,14 @@ export function identity(id: string | undefined, text: string, type: 'index' | '
|
|
|
20
20
|
if (cs.length <= 120) return `${type}:${id ?? ''}:${text}`;
|
|
21
21
|
switch (type) {
|
|
22
22
|
case 'index':
|
|
23
|
-
return `${type}:${id ?? ''}:${cs.slice(0, 120 - 3).join('')}...`;
|
|
24
23
|
case 'mark':
|
|
25
24
|
return `${type}:${id ?? ''}:${cs.slice(0, 38).join('')}...${cs.slice(cs.length / 2 - 38 / 2 | 0).slice(0, 38).join('')}...${cs.slice(-38).join('')}`;
|
|
26
25
|
}
|
|
27
26
|
assert(false);
|
|
28
27
|
}
|
|
29
28
|
assert(identity(undefined, '0'.repeat(120 - 1) + 1)!.slice(7) === '0'.repeat(120 - 1) + 1);
|
|
30
|
-
assert(identity(undefined, '0'.repeat(
|
|
31
|
-
assert(identity(undefined, '0'.repeat(
|
|
32
|
-
assert(identity(undefined, '0'.repeat(120 - 1) + 1, 'mark')!.slice(6) === '0'.repeat(120 - 1) + 1);
|
|
33
|
-
assert(identity(undefined, '0'.repeat(41) + '1'.repeat(38) + '2'.repeat(41) + 3, 'mark')!.slice(6) === '0'.repeat(38) + '...' + '1'.repeat(38) + '...' + '2'.repeat(38 - 1) + 3);
|
|
34
|
-
assert(identity(undefined, '0'.repeat(81) + '1'.repeat(38) + '2'.repeat(81) + 3, 'mark')!.slice(6) === '0'.repeat(38) + '...' + '1'.repeat(38) + '...' + '2'.repeat(38 - 1) + 3);
|
|
29
|
+
assert(identity(undefined, '0'.repeat(41) + '1'.repeat(38) + '2'.repeat(41) + 3)!.slice(7) === '0'.repeat(38) + '...' + '1'.repeat(38) + '...' + '2'.repeat(38 - 1) + 3);
|
|
30
|
+
assert(identity(undefined, '0'.repeat(81) + '1'.repeat(38) + '2'.repeat(81) + 3)!.slice(7) === '0'.repeat(38) + '...' + '1'.repeat(38) + '...' + '2'.repeat(38 - 1) + 3);
|
|
35
31
|
|
|
36
32
|
export function index(source: Element, optional = false): string {
|
|
37
33
|
assert(!source.matches('.indexer'));
|