@incremark/core 0.3.7 → 0.3.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.
- package/dist/engines/marked/index.js +19 -0
- package/dist/engines/marked/index.js.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1821,6 +1821,25 @@ function transformOptimisticReference(token, ctx) {
|
|
|
1821
1821
|
alt: token.text
|
|
1822
1822
|
};
|
|
1823
1823
|
}
|
|
1824
|
+
const imageRefMatch = token.text.match(/^!\[((?:\[[^\]]*\]|[^\[\]])*)\]\[([^\]]*)\]$/);
|
|
1825
|
+
if (imageRefMatch) {
|
|
1826
|
+
const altText = imageRefMatch[1];
|
|
1827
|
+
const imageIdentifier = imageRefMatch[2] || altText;
|
|
1828
|
+
const imageRefType = imageRefMatch[2] === "" ? "collapsed" : imageRefMatch[2] ? "full" : "shortcut";
|
|
1829
|
+
return {
|
|
1830
|
+
type: "linkReference",
|
|
1831
|
+
identifier: token.identifier,
|
|
1832
|
+
label: token.label,
|
|
1833
|
+
referenceType: token.referenceType,
|
|
1834
|
+
children: [{
|
|
1835
|
+
type: "imageReference",
|
|
1836
|
+
identifier: imageIdentifier.toLowerCase(),
|
|
1837
|
+
label: imageIdentifier,
|
|
1838
|
+
referenceType: imageRefType,
|
|
1839
|
+
alt: altText
|
|
1840
|
+
}]
|
|
1841
|
+
};
|
|
1842
|
+
}
|
|
1824
1843
|
const labelChildren = ctx.transformInline(new Lexer().inlineTokens(token.text));
|
|
1825
1844
|
return {
|
|
1826
1845
|
type: "linkReference",
|