securemark 0.247.0 → 0.247.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/index.js +3 -3
- package/package.json +3 -3
- package/src/parser/inline/math.test.ts +1 -1
- package/src/parser/inline/math.ts +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! securemark v0.247.
|
|
1
|
+
/*! securemark v0.247.1 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("DOMPurify"), require("Prism"));
|
|
@@ -6545,7 +6545,7 @@ const source_1 = __webpack_require__(6743);
|
|
|
6545
6545
|
const dom_1 = __webpack_require__(3252);
|
|
6546
6546
|
|
|
6547
6547
|
const syntax = /^(?:[ "([](?!\$)|\\{(?!\$)|\\[\\}$]?|^`|`(?!`)|[!#%&')\x2A-\x5A\]^_\x61-\x7A|~])+/;
|
|
6548
|
-
const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![
|
|
6548
|
+
const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])/i;
|
|
6549
6549
|
exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.validate)('$', (0, combinator_1.rewrite)((0, combinator_1.union)([(0, combinator_1.surround)('$', bracket, '$'), (0, combinator_1.surround)(/^\$(?!\s)/, (0, combinator_1.some)((0, combinator_1.union)([bracket, quote, (0, source_1.str)(syntax)])), /^\$(?![0-9A-Za-z])/)]), (source, {
|
|
6550
6550
|
caches: {
|
|
6551
6551
|
math: cache
|
|
@@ -6559,7 +6559,7 @@ exports.math = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combin
|
|
|
6559
6559
|
translate: 'no',
|
|
6560
6560
|
'data-invalid-syntax': 'math',
|
|
6561
6561
|
'data-invalid-type': 'content',
|
|
6562
|
-
'data-invalid-message': `"${source.match(forbiddenCommand)[0]}" command is
|
|
6562
|
+
'data-invalid-message': `"${source.match(forbiddenCommand)[0]}" command is forbidden`
|
|
6563
6563
|
}, source)], '']))));
|
|
6564
6564
|
const bracket = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)('{', (0, combinator_1.some)((0, combinator_1.union)([bracket, (0, combinator_1.some)(source_1.escsource, /^(?:[{}$]|\\?\n)/)])), '}', true)));
|
|
6565
6565
|
const quote = (0, combinator_1.lazy)(() => (0, combinator_1.creator)((0, combinator_1.surround)('``', (0, combinator_1.some)((0, combinator_1.union)([quote, bracket, (0, combinator_1.focus)(/^(?:\\[\\{}$]|`(?!`)|[^`{}"$\n])*/, (0, source_1.str)(syntax))])), /^"?/, true)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "securemark",
|
|
3
|
-
"version": "0.247.
|
|
3
|
+
"version": "0.247.1",
|
|
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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"babel-loader": "^8.2.5",
|
|
39
39
|
"babel-plugin-unassert": "^3.2.0",
|
|
40
40
|
"concurrently": "^7.2.0",
|
|
41
|
-
"eslint": "^8.
|
|
41
|
+
"eslint": "^8.16.0",
|
|
42
42
|
"eslint-plugin-redos": "^4.4.0",
|
|
43
43
|
"eslint-webpack-plugin": "^3.1.1",
|
|
44
44
|
"glob": "^8.0.3",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"karma-mocha": "^2.0.1",
|
|
50
50
|
"karma-power-assert": "^1.0.0",
|
|
51
51
|
"mocha": "^10.0.0",
|
|
52
|
-
"npm-check-updates": "^13.0.
|
|
52
|
+
"npm-check-updates": "^13.0.3",
|
|
53
53
|
"semver": "^7.3.7",
|
|
54
54
|
"spica": "0.0.551",
|
|
55
55
|
"ts-loader": "^9.3.0",
|
|
@@ -60,7 +60,7 @@ describe('Unit: parser/inline/math', () => {
|
|
|
60
60
|
assert.deepStrictEqual(inspect(parser('${a\\$\nb}$')), undefined);
|
|
61
61
|
assert.deepStrictEqual(inspect(parser('${a\\$\\\nb}$')), undefined);
|
|
62
62
|
assert.deepStrictEqual(inspect(parser('$\\begin{}$')), [['<span class="invalid" translate="no">$\\begin{}$</span>'], '']);
|
|
63
|
-
assert.deepStrictEqual(inspect(parser('$\\
|
|
63
|
+
assert.deepStrictEqual(inspect(parser('$\\huge0$')), [['<span class="invalid" translate="no">$\\huge0$</span>'], '']);
|
|
64
64
|
assert.deepStrictEqual(inspect(parser('$\\Begin{}$')), [['<span class="invalid" translate="no">$\\Begin{}$</span>'], '']);
|
|
65
65
|
assert.deepStrictEqual(inspect(parser('${\\begin}$')), [['<span class="invalid" translate="no">${\\begin}$</span>'], '']);
|
|
66
66
|
assert.deepStrictEqual(inspect(parser(' ${a}$')), undefined);
|
|
@@ -4,7 +4,7 @@ import { escsource, str } from '../source';
|
|
|
4
4
|
import { html } from 'typed-dom/dom';
|
|
5
5
|
|
|
6
6
|
const syntax = /^(?:[ "([](?!\$)|\\{(?!\$)|\\[\\}$]?|^`|`(?!`)|[!#%&')\x2A-\x5A\]^_\x61-\x7A|~])+/;
|
|
7
|
-
const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![
|
|
7
|
+
const forbiddenCommand = /\\(?:begin|tiny|huge|large)(?![a-z])/i;
|
|
8
8
|
|
|
9
9
|
export const math: MathParser = lazy(() => creator(validate('$', rewrite(
|
|
10
10
|
union([
|
|
@@ -28,7 +28,7 @@ export const math: MathParser = lazy(() => creator(validate('$', rewrite(
|
|
|
28
28
|
translate: 'no',
|
|
29
29
|
'data-invalid-syntax': 'math',
|
|
30
30
|
'data-invalid-type': 'content',
|
|
31
|
-
'data-invalid-message': `"${source.match(forbiddenCommand)![0]}" command is
|
|
31
|
+
'data-invalid-message': `"${source.match(forbiddenCommand)![0]}" command is forbidden`,
|
|
32
32
|
},
|
|
33
33
|
source)
|
|
34
34
|
], '']))));
|