@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.
Files changed (2) hide show
  1. package/dist/parser.js +6 -2
  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
- references[normalizeReferenceLabel(definition[1])] = { href: definition[2].replace(/^<|>$/g, '') };
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/markdown",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "description": "A tiny, fast, deterministic Markdown renderer for blogs and documentation.",
6
6
  "license": "MIT",