@telepat/ideon 0.1.28 → 0.1.29

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/ideon.js +12 -6
  2. package/package.json +1 -1
package/dist/ideon.js CHANGED
@@ -1424,7 +1424,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
1424
1424
  // package.json
1425
1425
  var package_default = {
1426
1426
  name: "@telepat/ideon",
1427
- version: "0.1.28",
1427
+ version: "0.1.29",
1428
1428
  description: "CLI for generating rich articles and images from ideas.",
1429
1429
  type: "module",
1430
1430
  repository: {
@@ -6177,8 +6177,7 @@ async function loadLinksFromSidecar(markdownPath) {
6177
6177
  const record = parsed;
6178
6178
  const links = Array.isArray(record.links) ? record.links : [];
6179
6179
  const customLinks = Array.isArray(record.customLinks) ? record.customLinks : [];
6180
- const combined = [...customLinks, ...links];
6181
- return combined.filter((entry) => {
6180
+ const filterAndMap = (entries, isCustom) => entries.filter((entry) => {
6182
6181
  if (typeof entry !== "object" || entry === null) {
6183
6182
  return false;
6184
6183
  }
@@ -6187,8 +6186,10 @@ async function loadLinksFromSidecar(markdownPath) {
6187
6186
  }).map((entry) => ({
6188
6187
  expression: entry.expression.trim(),
6189
6188
  url: entry.url.trim(),
6190
- title: entry.title
6189
+ title: entry.title,
6190
+ isCustom
6191
6191
  })).filter((entry) => entry.expression.length > 0 && entry.url.length > 0);
6192
+ return [...filterAndMap(customLinks, true), ...filterAndMap(links, false)];
6192
6193
  }
6193
6194
  function enrichMarkdownWithLinks(markdown, links) {
6194
6195
  if (links.length === 0) {
@@ -6208,8 +6209,13 @@ function enrichMarkdownWithLinks(markdown, links) {
6208
6209
  if (isInProtectedSpan(updated, start, end)) {
6209
6210
  continue;
6210
6211
  }
6211
- updated = `${updated.slice(0, start)}[${match[0]}](${link.url})${updated.slice(end)}`;
6212
- break;
6212
+ const replacement = `[${match[0]}](${link.url})`;
6213
+ updated = `${updated.slice(0, start)}${replacement}${updated.slice(end)}`;
6214
+ if (link.isCustom) {
6215
+ expressionRegex.lastIndex = start + replacement.length;
6216
+ } else {
6217
+ break;
6218
+ }
6213
6219
  }
6214
6220
  }
6215
6221
  return updated;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telepat/ideon",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "CLI for generating rich articles and images from ideas.",
5
5
  "type": "module",
6
6
  "repository": {