@tanstack/markdown 0.0.8 → 0.0.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/parser.js +6 -2
- package/package.json +1 -1
package/dist/parser.js
CHANGED
|
@@ -368,9 +368,13 @@ function extractDefinitions(lines) {
|
|
|
368
368
|
}
|
|
369
369
|
continue;
|
|
370
370
|
}
|
|
371
|
-
const definition = line.match(/^ {0,3}\[([^\]\n]+)\]:[ \t]*(\S+)[ \t]*$/);
|
|
371
|
+
const definition = line.match(/^ {0,3}\[([^\]\n]+)\]:[ \t]*(\S+)(?:[ \t]+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?[ \t]*$/);
|
|
372
372
|
if (definition) {
|
|
373
|
-
|
|
373
|
+
const title = definition[3] ?? definition[4] ?? definition[5];
|
|
374
|
+
references[normalizeReferenceLabel(definition[1])] = {
|
|
375
|
+
href: definition[2].replace(/^<|>$/g, ''),
|
|
376
|
+
...(title !== undefined ? { title } : {}),
|
|
377
|
+
};
|
|
374
378
|
index++;
|
|
375
379
|
continue;
|
|
376
380
|
}
|