remark-captions
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -14,3 +14,3 @@ 'use strict'; | ||
blockquote: 'Source:', | ||
img: 'Figure:' | ||
image: 'Figure:' | ||
}; | ||
@@ -38,5 +38,7 @@ | ||
// legend can only be in a paragraph | ||
var lastP = getLast(node.children); | ||
if (!lastP || lastP.type !== 'paragraph') return; | ||
// if the current node has some children, the legend is the last child. | ||
// if not, the legend is the last child of the parent node. | ||
var lastP = node.children ? getLast(node.children) : parent; | ||
// legend can only be in a paragraph. | ||
if (!lastP || node.children && lastP.type !== 'paragraph' || !node.children && parent.type !== 'paragraph') return; | ||
@@ -50,3 +52,3 @@ // find which child contains the last legend | ||
}); | ||
if (legendChildIndex === -1) return; | ||
if (legendChildIndex === -1 || !node.children && legendChildIndex < index) return; | ||
@@ -53,0 +55,0 @@ // split the text node containing the last legend and find the line containing it |
{ | ||
"name": "remark-captions", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "url": "https://github.com/zestedesavoir/zmarkdown/tree/master/packages/remark-captions", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9097
144