marked-katex-extension 3.0.4 → 3.0.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/lib/index.cjs +5 -4
- package/lib/index.umd.js +5 -4
- package/package.json +9 -9
- package/src/index.js +5 -4
package/lib/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var katex = require('katex');
|
|
4
4
|
|
|
5
|
-
const inlineStartRule = /(
|
|
6
|
-
const inlineRule = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])
|
|
5
|
+
const inlineStartRule = /(\s|^)\${1,2}(?!\$)/;
|
|
6
|
+
const inlineRule = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:]|$)/;
|
|
7
7
|
const blockRule = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
8
8
|
|
|
9
9
|
function index(options = {}) {
|
|
@@ -29,10 +29,11 @@ function inlineKatex(options, renderer) {
|
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const
|
|
32
|
+
const index = match.index + match[1].length;
|
|
33
|
+
const possibleKatex = src.substring(index);
|
|
33
34
|
|
|
34
35
|
if (possibleKatex.match(inlineRule)) {
|
|
35
|
-
return
|
|
36
|
+
return index;
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
tokenizer(src, tokens) {
|
package/lib/index.umd.js
CHANGED
|
@@ -18409,8 +18409,8 @@
|
|
|
18409
18409
|
}
|
|
18410
18410
|
};
|
|
18411
18411
|
|
|
18412
|
-
const inlineStartRule = /(
|
|
18413
|
-
const inlineRule = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])
|
|
18412
|
+
const inlineStartRule = /(\s|^)\${1,2}(?!\$)/;
|
|
18413
|
+
const inlineRule = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:]|$)/;
|
|
18414
18414
|
const blockRule = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
18415
18415
|
|
|
18416
18416
|
function index(options = {}) {
|
|
@@ -18436,10 +18436,11 @@
|
|
|
18436
18436
|
return;
|
|
18437
18437
|
}
|
|
18438
18438
|
|
|
18439
|
-
const
|
|
18439
|
+
const index = match.index + match[1].length;
|
|
18440
|
+
const possibleKatex = src.substring(index);
|
|
18440
18441
|
|
|
18441
18442
|
if (possibleKatex.match(inlineRule)) {
|
|
18442
|
-
return
|
|
18443
|
+
return index;
|
|
18443
18444
|
}
|
|
18444
18445
|
},
|
|
18445
18446
|
tokenizer(src, tokens) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marked-katex-extension",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "MarkedJS extesion to render katex",
|
|
5
5
|
"main": "./lib/index.cjs",
|
|
6
6
|
"module": "./src/index.js",
|
|
@@ -41,29 +41,29 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://github.com/UziTech/marked-katex-extension#readme",
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"marked": ">=4 <
|
|
44
|
+
"marked": ">=4 <10"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@babel/core": "^7.22.
|
|
48
|
-
"@babel/preset-env": "^7.22.
|
|
47
|
+
"@babel/core": "^7.22.17",
|
|
48
|
+
"@babel/preset-env": "^7.22.15",
|
|
49
49
|
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
50
50
|
"@semantic-release/changelog": "^6.0.3",
|
|
51
51
|
"@semantic-release/commit-analyzer": "^10.0.4",
|
|
52
52
|
"@semantic-release/git": "^10.0.1",
|
|
53
|
-
"@semantic-release/github": "^9.0.
|
|
53
|
+
"@semantic-release/github": "^9.0.5",
|
|
54
54
|
"@semantic-release/npm": "^10.0.5",
|
|
55
55
|
"@semantic-release/release-notes-generator": "^11.0.7",
|
|
56
56
|
"babel-jest": "^29.6.4",
|
|
57
57
|
"cheerio": "^1.0.0-rc.12",
|
|
58
|
-
"eslint": "^8.
|
|
58
|
+
"eslint": "^8.49.0",
|
|
59
59
|
"eslint-config-standard": "^17.1.0",
|
|
60
60
|
"eslint-plugin-import": "^2.28.1",
|
|
61
|
-
"eslint-plugin-n": "^16.0
|
|
61
|
+
"eslint-plugin-n": "^16.1.0",
|
|
62
62
|
"eslint-plugin-promise": "^6.1.1",
|
|
63
63
|
"jest-cli": "^29.6.4",
|
|
64
|
-
"marked": "^
|
|
64
|
+
"marked": "^9.0.0",
|
|
65
65
|
"node-fetch": "^3.3.2",
|
|
66
|
-
"rollup": "^3.
|
|
66
|
+
"rollup": "^3.29.1",
|
|
67
67
|
"semantic-release": "^21.1.1",
|
|
68
68
|
"tsd": "^0.29.0"
|
|
69
69
|
},
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import katex from 'katex';
|
|
2
2
|
|
|
3
|
-
const inlineStartRule = /(
|
|
4
|
-
const inlineRule = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])
|
|
3
|
+
const inlineStartRule = /(\s|^)\${1,2}(?!\$)/;
|
|
4
|
+
const inlineRule = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:]|$)/;
|
|
5
5
|
const blockRule = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
6
6
|
|
|
7
7
|
export default function(options = {}) {
|
|
@@ -27,10 +27,11 @@ function inlineKatex(options, renderer) {
|
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const index = match.index + match[1].length;
|
|
31
|
+
const possibleKatex = src.substring(index);
|
|
31
32
|
|
|
32
33
|
if (possibleKatex.match(inlineRule)) {
|
|
33
|
-
return
|
|
34
|
+
return index;
|
|
34
35
|
}
|
|
35
36
|
},
|
|
36
37
|
tokenizer(src, tokens) {
|