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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.280.6
4
+
5
+ - Refactoring.
6
+
3
7
  ## 0.280.5
4
8
 
5
9
  - Refactoring.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! securemark v0.280.5 https://github.com/falsandtru/securemark | (c) 2017, falsandtru | UNLICENSED License */
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "securemark",
3
- "version": "0.280.5",
3
+ "version": "0.280.6",
4
4
  "description": "Secure markdown renderer working on browsers for user input data.",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/falsandtru/securemark",
@@ -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(120) + 1)!.slice(7) === '0'.repeat(117) + '...');
31
- assert(identity(undefined, '0'.repeat(200) + 1)!.slice(7) === '0'.repeat(117) + '...');
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'));