@incremark/core 0.3.6 → 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.
@@ -1041,6 +1041,25 @@ function transformOptimisticReference(token, ctx) {
1041
1041
  alt: token.text
1042
1042
  };
1043
1043
  }
1044
+ const imageRefMatch = token.text.match(/^!\[((?:\[[^\]]*\]|[^\[\]])*)\]\[([^\]]*)\]$/);
1045
+ if (imageRefMatch) {
1046
+ const altText = imageRefMatch[1];
1047
+ const imageIdentifier = imageRefMatch[2] || altText;
1048
+ const imageRefType = imageRefMatch[2] === "" ? "collapsed" : imageRefMatch[2] ? "full" : "shortcut";
1049
+ return {
1050
+ type: "linkReference",
1051
+ identifier: token.identifier,
1052
+ label: token.label,
1053
+ referenceType: token.referenceType,
1054
+ children: [{
1055
+ type: "imageReference",
1056
+ identifier: imageIdentifier.toLowerCase(),
1057
+ label: imageIdentifier,
1058
+ referenceType: imageRefType,
1059
+ alt: altText
1060
+ }]
1061
+ };
1062
+ }
1044
1063
  const labelChildren = ctx.transformInline(new Lexer().inlineTokens(token.text));
1045
1064
  return {
1046
1065
  type: "linkReference",