securemark 0.269.1 → 0.270.0
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
package/README.md
CHANGED
|
@@ -68,11 +68,11 @@ Secure markdown renderer working on browsers for user input data.
|
|
|
68
68
|
|P| Operators |
|
|
69
69
|
|-|------------------|
|
|
70
70
|
|9| \n, \\\n |
|
|
71
|
-
|8|
|
|
71
|
+
|8| ` |
|
|
72
72
|
|6| (()), [[]], ${}$ |
|
|
73
73
|
|5| \<tag>\</tag> |
|
|
74
74
|
|4| [% %] |
|
|
75
|
-
|3|
|
|
75
|
+
|3| $, " |
|
|
76
76
|
|2| (), [], {} |
|
|
77
77
|
|1| _, *, ==, ++, ~~ |
|
|
78
78
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.
|
|
1
|
+
/*! securemark v0.270.0 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"));
|
|
@@ -5744,9 +5744,7 @@ const combinator_1 = __webpack_require__(2087);
|
|
|
5744
5744
|
const inline_1 = __webpack_require__(1160);
|
|
5745
5745
|
const visibility_1 = __webpack_require__(7618);
|
|
5746
5746
|
const dom_1 = __webpack_require__(3252);
|
|
5747
|
-
exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('((', (0, combinator_1.constraint)(256 /* State.annotation */, false, (0, combinator_1.syntax)(0 /* Syntax.none */, 6, 1, 256 /* State.annotation */ | 8 /* State.media */, (0, visibility_1.startLoose)((0, combinator_1.
|
|
5748
|
-
delimiters: undefined
|
|
5749
|
-
}, (0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[/^\\?\n/, 9], [')', 2], ['))', 6]])), ')'))), '))', false, ([, ns], rest) => [[(0, dom_1.html)('sup', {
|
|
5747
|
+
exports.annotation = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('((', (0, combinator_1.constraint)(256 /* State.annotation */, false, (0, combinator_1.syntax)(0 /* Syntax.none */, 6, 1, 256 /* State.annotation */ | 8 /* State.media */, (0, visibility_1.startLoose)((0, combinator_1.some)((0, combinator_1.union)([inline_1.inline]), ')', [[/^\\?\n/, 9], [')', 2], ['))', 6]]), ')'))), '))', false, ([, ns], rest) => [[(0, dom_1.html)('sup', {
|
|
5750
5748
|
class: 'annotation'
|
|
5751
5749
|
}, [(0, dom_1.html)('span', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))])], rest]));
|
|
5752
5750
|
|
|
@@ -5978,7 +5976,7 @@ exports.bracket = (0, combinator_1.lazy)(() => (0, combinator_1.union)([(0, comb
|
|
|
5978
5976
|
class: 'paren'
|
|
5979
5977
|
}, (0, dom_1.defrag)((0, array_1.push)((0, array_1.unshift)(as, bs), cs)))], rest], ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]), (0, combinator_1.surround)((0, source_1.str)('['), (0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, ']', [[']', 2]])), (0, source_1.str)(']'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)([''], (0, array_1.unshift)(as, bs)), rest]), (0, combinator_1.surround)((0, source_1.str)('{'), (0, combinator_1.syntax)(8 /* Syntax.bracket */, 2, 1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '}', [['}', 2]])), (0, source_1.str)('}'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest]),
|
|
5980
5978
|
// Control media blinking in editing rather than control confusion of pairs of quote marks.
|
|
5981
|
-
(0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.syntax)(0 /* Syntax.none */,
|
|
5979
|
+
(0, combinator_1.surround)((0, source_1.str)('"'), (0, combinator_1.syntax)(0 /* Syntax.none */, 3, 1, 0 /* State.none */, (0, combinator_1.some)(inline_1.inline, '"', [['"', 3]])), (0, source_1.str)('"'), true, undefined, ([as, bs = []], rest) => [(0, array_1.unshift)(as, bs), rest])]));
|
|
5982
5980
|
|
|
5983
5981
|
/***/ }),
|
|
5984
5982
|
|
|
@@ -6702,9 +6700,7 @@ const source_1 = __webpack_require__(6743);
|
|
|
6702
6700
|
const visibility_1 = __webpack_require__(7618);
|
|
6703
6701
|
const util_1 = __webpack_require__(9437);
|
|
6704
6702
|
const dom_1 = __webpack_require__(3252);
|
|
6705
|
-
exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(128 /* State.reference */, false, (0, combinator_1.syntax)(256 /* Syntax.reference */, 6, 1, 256 /* State.annotation */ | 128 /* State.reference */ | 8 /* State.media */, (0, visibility_1.startLoose)((0, combinator_1.
|
|
6706
|
-
delimiters: undefined
|
|
6707
|
-
}, (0, combinator_1.subsequence)([abbr, (0, combinator_1.open)((0, source_1.stropt)(/^(?=\^)/), (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]])), (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]])])), ']'))), ']]', false, ([, ns], rest) => [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))])], rest]));
|
|
6703
|
+
exports.reference = (0, combinator_1.lazy)(() => (0, combinator_1.surround)('[[', (0, combinator_1.constraint)(128 /* State.reference */, false, (0, combinator_1.syntax)(256 /* Syntax.reference */, 6, 1, 256 /* State.annotation */ | 128 /* State.reference */ | 8 /* State.media */, (0, visibility_1.startLoose)((0, combinator_1.subsequence)([abbr, (0, combinator_1.open)((0, source_1.stropt)(/^(?=\^)/), (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]])), (0, combinator_1.some)(inline_1.inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]])]), ']'))), ']]', false, ([, ns], rest) => [[(0, dom_1.html)('sup', attributes(ns), [(0, dom_1.html)('span', (0, visibility_1.trimNode)((0, dom_1.defrag)(ns)))])], rest]));
|
|
6708
6704
|
const abbr = (0, combinator_1.creation)((0, combinator_1.bind)((0, combinator_1.surround)('^', (0, combinator_1.union)([(0, source_1.str)(/^(?![0-9]+\s?[|\]])[0-9A-Za-z]+(?:(?:-|(?=\W)(?!'\d)'?(?!\.\d)\.?(?!,\S),? ?)[0-9A-Za-z]+)*(?:-|'?\.?,? ?)?/)]), /^\|?(?=]])|^\|[^\S\n]*/), ([source], rest) => [[(0, dom_1.html)('abbr', source)], rest.replace(visibility_1.regBlankStart, '')]));
|
|
6709
6705
|
function attributes(ns) {
|
|
6710
6706
|
return typeof ns[0] === 'object' && ns[0].tagName === 'ABBR' ? {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnnotationParser } from '../inline';
|
|
2
|
-
import { union, some,
|
|
2
|
+
import { union, some, syntax, constraint, surround, lazy } from '../../combinator';
|
|
3
3
|
import { inline } from '../inline';
|
|
4
4
|
import { Syntax, State } from '../context';
|
|
5
5
|
import { startLoose, trimNode } from '../visibility';
|
|
@@ -10,8 +10,7 @@ export const annotation: AnnotationParser = lazy(() => surround(
|
|
|
10
10
|
constraint(State.annotation, false,
|
|
11
11
|
syntax(Syntax.none, 6, 1, State.annotation | State.media,
|
|
12
12
|
startLoose(
|
|
13
|
-
|
|
14
|
-
some(union([inline]), ')', [[/^\\?\n/, 9], [')', 2], ['))', 6]])), ')'))),
|
|
13
|
+
some(union([inline]), ')', [[/^\\?\n/, 9], [')', 2], ['))', 6]]), ')'))),
|
|
15
14
|
'))',
|
|
16
15
|
false,
|
|
17
16
|
([, ns], rest) => [[html('sup', { class: 'annotation' }, [html('span', trimNode(defrag(ns)))])], rest]));
|
|
@@ -24,7 +24,7 @@ export const bracket: BracketParser = lazy(() => union([
|
|
|
24
24
|
undefined,
|
|
25
25
|
([as, bs = []], rest) => [unshift(as, bs), rest]),
|
|
26
26
|
// Control media blinking in editing rather than control confusion of pairs of quote marks.
|
|
27
|
-
surround(str('"'), syntax(Syntax.none,
|
|
27
|
+
surround(str('"'), syntax(Syntax.none, 3, 1, State.none, some(inline, '"', [['"', 3]])), str('"'), true,
|
|
28
28
|
undefined,
|
|
29
29
|
([as, bs = []], rest) => [unshift(as, bs), rest]),
|
|
30
30
|
]));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReferenceParser } from '../inline';
|
|
2
|
-
import { union, subsequence, some,
|
|
2
|
+
import { union, subsequence, some, syntax, creation, constraint, surround, open, lazy, bind } from '../../combinator';
|
|
3
3
|
import { inline } from '../inline';
|
|
4
4
|
import { str, stropt } from '../source';
|
|
5
5
|
import { Syntax, State } from '../context';
|
|
@@ -12,12 +12,11 @@ export const reference: ReferenceParser = lazy(() => surround(
|
|
|
12
12
|
constraint(State.reference, false,
|
|
13
13
|
syntax(Syntax.reference, 6, 1, State.annotation | State.reference | State.media,
|
|
14
14
|
startLoose(
|
|
15
|
-
context({ delimiters: undefined },
|
|
16
15
|
subsequence([
|
|
17
16
|
abbr,
|
|
18
17
|
open(stropt(/^(?=\^)/), some(inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]])),
|
|
19
18
|
some(inline, ']', [[/^\\?\n/, 9], [']', 2], [']]', 6]]),
|
|
20
|
-
])
|
|
19
|
+
]), ']'))),
|
|
21
20
|
']]',
|
|
22
21
|
false,
|
|
23
22
|
([, ns], rest) => [[html('sup', attributes(ns), [html('span', trimNode(defrag(ns)))])], rest]));
|
|
@@ -97,7 +97,7 @@ describe('Unit: parser/inline', () => {
|
|
|
97
97
|
assert.deepStrictEqual(inspect(parser('[++[a\nb++]')), [['', '[', '++', '[', 'a', '<br>', 'b', '++', ']'], '']);
|
|
98
98
|
assert.deepStrictEqual(inspect(parser('[[++a\nb++]]')), [['[', '[', '<ins>a<br>b</ins>', ']', ']'], '']);
|
|
99
99
|
assert.deepStrictEqual(inspect(parser('"[% *"*"*')), [['"', '[%', ' ', '*', '"', '*', '"', '*'], '']);
|
|
100
|
-
assert.deepStrictEqual(inspect(parser('"[% "*"* %]')), [['"', '[%
|
|
100
|
+
assert.deepStrictEqual(inspect(parser('"[% "*"* %]')), [['"', '<span class="comment"><input type="checkbox"><span>[% "*"* %]</span></span>'], '']);
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
it('uri', () => {
|