@readme/syntax-highlighter 12.1.1 → 12.1.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@readme/syntax-highlighter",
3
3
  "description": "ReadMe's React-based syntax highlighter",
4
- "version": "12.1.1",
4
+ "version": "12.1.2",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
7
7
  "license": "ISC",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "homepage": "https://readmeio.github.io/syntax-highlighter/",
13
13
  "engines": {
14
- "node": ">=14"
14
+ "node": ">=16"
15
15
  },
16
16
  "scripts": {
17
17
  "build": "webpack --progress",
@@ -20,7 +20,6 @@
20
20
  "prepare": "husky install",
21
21
  "pretest": "npm run lint",
22
22
  "prettier": "prettier --list-different --write \"./**/**.{js,jsx}\"",
23
- "release": "npx conventional-changelog-cli -i CHANGELOG.md -s && git add CHANGELOG.md",
24
23
  "start": "webpack serve --open --config ./webpack.config.dev.js",
25
24
  "test": "jest --coverage --runInBand",
26
25
  "watch": "webpack -w --progress"
@@ -37,20 +36,20 @@
37
36
  "react-dom": "16.x || 17.x"
38
37
  },
39
38
  "devDependencies": {
40
- "@babel/preset-env": "^7.21.5",
41
- "@babel/preset-react": "^7.14.5",
42
- "@commitlint/cli": "^17.6.1",
43
- "@commitlint/config-conventional": "^17.6.1",
44
- "@readme/eslint-config": "^10.5.2",
39
+ "@babel/preset-env": "^7.22.5",
40
+ "@babel/preset-react": "^7.22.5",
41
+ "@commitlint/cli": "^17.6.6",
42
+ "@commitlint/config-conventional": "^17.6.6",
43
+ "@readme/eslint-config": "^10.6.1",
45
44
  "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
46
45
  "babel-jest": "^29.5.0",
47
46
  "babel-loader": "^8.2.4",
48
- "core-js": "^3.30.1",
47
+ "core-js": "^3.31.0",
49
48
  "css-loader": "^6.7.3",
50
49
  "enzyme": "^3.11.0",
51
- "eslint": "^8.39.0",
52
- "glob": "^10.2.2",
53
- "html-webpack-plugin": "^5.5.1",
50
+ "eslint": "^8.44.0",
51
+ "glob": "^10.3.1",
52
+ "html-webpack-plugin": "^5.5.3",
54
53
  "husky": "^8.0.3",
55
54
  "identity-obj-proxy": "^3.0.0",
56
55
  "jest": "^29.5.0",
@@ -60,12 +59,12 @@
60
59
  "react": "^17.0.2",
61
60
  "react-dom": "^17.0.2",
62
61
  "regenerator-runtime": "^0.13.9",
63
- "sass-loader": "^13.2.2",
62
+ "sass-loader": "^13.3.2",
64
63
  "style-loader": "^3.3.2",
65
64
  "terser-webpack-plugin": "^5.3.7",
66
- "webpack": "^5.81.0",
67
- "webpack-cli": "^5.0.2",
68
- "webpack-dev-server": "^4.13.3"
65
+ "webpack": "^5.88.1",
66
+ "webpack-cli": "^5.1.4",
67
+ "webpack-dev-server": "^4.15.1"
69
68
  },
70
69
  "prettier": "@readme/eslint-config/prettier",
71
70
  "commitlint": {
@@ -169,9 +169,14 @@ const extractVariables = (code, opts) => {
169
169
  let offsetDelta = 0;
170
170
  const variables = [];
171
171
 
172
- const extracter = ({ length }, capture, offset) => {
172
+ const extracter = (match, capture, offset) => {
173
+ const unescaped = match.replace(/^\\<</, '<<').replace(/\\>>$/, '>>');
174
+ if (unescaped !== match) {
175
+ return unescaped;
176
+ }
177
+
173
178
  variables.push({ text: capture, offset: offset - offsetDelta });
174
- offsetDelta += length;
179
+ offsetDelta += match.length;
175
180
 
176
181
  return '';
177
182
  };