rehype-image-caption 2.1.7 → 2.1.9
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/dist/index.js +2 -4
- package/package.json +7 -4
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.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"description": "rehype plugin to set captions for images in addition to alt text.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"provenance": true
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/Robot-Inventor/rehype-image-caption#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@changesets/changelog-github": "^0.
|
|
39
|
+
"@changesets/changelog-github": "^0.7.0",
|
|
40
40
|
"@changesets/cli": "^2.27.1",
|
|
41
|
-
"@robot-inventor/eslint-config": "^
|
|
41
|
+
"@robot-inventor/eslint-config": "^13.0.0",
|
|
42
42
|
"@robot-inventor/tsconfig-base": "^7.0.0",
|
|
43
|
-
"eslint": "^
|
|
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",
|
|
@@ -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
|
}
|