rehype-image-caption 2.1.6 → 2.1.8

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -4
  2. package/package.json +6 -3
package/dist/index.js CHANGED
@@ -94,8 +94,7 @@ const rehypeImageCaption = (options = { wrapImagesWithoutCaptions: true }) => {
94
94
  }
95
95
  // Image with caption with line break
96
96
  if (node.children.length === ImageChildCounts.IMAGE_WITH_LINEBREAK_CAPTION &&
97
- node.children[1] &&
98
- node.children[1].type === "text" &&
97
+ node.children[1]?.type === "text" &&
99
98
  node.children[1].value.trim() === "" &&
100
99
  isElement(node.children[2], "em")) {
101
100
  node.tagName = "figure";
@@ -113,8 +112,7 @@ const rehypeImageCaption = (options = { wrapImagesWithoutCaptions: true }) => {
113
112
  // Image with caption with line break (with remark-breaks plugin)
114
113
  if (node.children.length === ImageChildCounts.IMAGE_WITH_REMARK_BREAKS_CAPTION &&
115
114
  isElement(node.children[1], "br") &&
116
- node.children[2] &&
117
- node.children[2].type === "text" &&
115
+ node.children[2]?.type === "text" &&
118
116
  node.children[2].value.trim() === "" &&
119
117
  isElement(node.children[3], "em")) {
120
118
  node.tagName = "figure";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rehype-image-caption",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "description": "rehype plugin to set captions for images in addition to alt text.",
5
5
  "publishConfig": {
6
6
  "provenance": true
@@ -40,13 +40,13 @@
40
40
  "@changesets/cli": "^2.27.1",
41
41
  "@robot-inventor/eslint-config": "^11.0.0",
42
42
  "@robot-inventor/tsconfig-base": "^7.0.0",
43
- "eslint": "^9.0.0",
43
+ "eslint": "^10.0.0",
44
44
  "prettier": "^3.2.5",
45
45
  "rehype-stringify": "^10.0.0",
46
46
  "remark-breaks": "^4.0.0",
47
47
  "remark-parse": "^11.0.0",
48
48
  "remark-rehype": "^11.1.0",
49
- "typescript": "^5.9.2",
49
+ "typescript": "^6.0.0",
50
50
  "vitest": "^4.0.0"
51
51
  },
52
52
  "dependencies": {
@@ -55,5 +55,8 @@
55
55
  "rehype": "^13.0.1",
56
56
  "unified": "^11.0.4",
57
57
  "unist-util-visit": "^5.0.0"
58
+ },
59
+ "overrides": {
60
+ "zod-validation-error": "^5.0.0"
58
61
  }
59
62
  }