@peaceroad/markdown-it-figure-with-p-caption 0.8.0 → 0.8.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/index.js +15 -11
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -314,23 +314,27 @@ const mditFigureWithPCaption = (md, option) => {
|
|
|
314
314
|
}
|
|
315
315
|
if(sp.isIframeTypeBlockQuote) {
|
|
316
316
|
if(n > 2) {
|
|
317
|
-
if (state.tokens[n-2].children
|
|
318
|
-
if (state.tokens[n-2].children
|
|
319
|
-
if (state.tokens[n-2].children[1].attrs
|
|
320
|
-
if (state.tokens[n-2].children[1].attrs[0][
|
|
321
|
-
|
|
322
|
-
|
|
317
|
+
if (state.tokens[n-2].children) {
|
|
318
|
+
if (state.tokens[n-2].children.length > 1) {
|
|
319
|
+
if (state.tokens[n-2].children[1].attrs) {
|
|
320
|
+
if (state.tokens[n-2].children[1].attrs[0][0] === 'class') {
|
|
321
|
+
if (state.tokens[n-2].children[1].attrs[0][1] === 'f-img-label') {
|
|
322
|
+
sp.hasImgCaption = true;
|
|
323
|
+
/* For now, I think I should use figure instead of blockquoe for caption. */
|
|
324
|
+
}
|
|
323
325
|
}
|
|
324
326
|
}
|
|
325
327
|
}
|
|
326
328
|
}
|
|
327
329
|
}
|
|
328
330
|
if (n + 2 < state.tokens.length) {
|
|
329
|
-
if (state.tokens[n+2].children
|
|
330
|
-
if (state.tokens[n+2].children
|
|
331
|
-
if (state.tokens[n+2].children[1].attrs
|
|
332
|
-
state.tokens[n+2].children[1].attrs[0][
|
|
333
|
-
|
|
331
|
+
if (state.tokens[n+2].children) {
|
|
332
|
+
if (state.tokens[n+2].children.length > 1) {
|
|
333
|
+
if (state.tokens[n+2].children[1].attrs) {
|
|
334
|
+
if (state.tokens[n+2].children[1].attrs[0][0] === 'class' &&
|
|
335
|
+
state.tokens[n+2].children[1].attrs[0][1] === 'f-img-label') {
|
|
336
|
+
sp.hasImgCaption = true;
|
|
337
|
+
}
|
|
334
338
|
}
|
|
335
339
|
}
|
|
336
340
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peaceroad/markdown-it-figure-with-p-caption",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "A markdown-it plugin. For a paragraph with only one image, a table or code block or blockquote, and by writing a caption paragraph immediately before or after, they are converted into the figure element with the figcaption element.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|