@kolkrabbi/kol-workshop 0.3.5 → 0.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-workshop",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "private": false,
5
5
  "description": "KOL workshop/docs system — a handrolled markdown engine, search, tag system (incl. a d3 tag graph), docs viewer, and docs shell. Sits above @kolkrabbi/kol-{theme,icons,component,framework}; content is consumer-injected (the package never globs docs).",
6
6
  "license": "MIT",
@@ -16,8 +16,8 @@
16
16
  "@kolkrabbi/kol-brand": "^0.1.2",
17
17
  "@kolkrabbi/kol-component": "0.14.1",
18
18
  "@kolkrabbi/kol-icons": "0.8.11",
19
- "@kolkrabbi/kol-framework": "0.8.1",
20
- "@kolkrabbi/kol-theme": "0.13.3"
19
+ "@kolkrabbi/kol-theme": "0.13.3",
20
+ "@kolkrabbi/kol-framework": "0.8.1"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": "^18.3.0 || ^19.0.0",
@@ -168,18 +168,27 @@ const DocumentationReader = ({
168
168
 
169
169
  /**
170
170
  * Resolve a .md link URL to an app route, or null if not a known doc.
171
- * Extracts the doc ID from the filename portion of the URL.
171
+ * Extracts the doc ID from the filename portion of the URL. Bare basenames
172
+ * miss two inventory id dialects (wave-4): index files (`00-overview/INDEX`
173
+ * → id `00-overview-INDEX`) and collision-prefixed ids (`03-components/
174
+ * 01-inventory` → `03-components-01-inventory`) — both gain the parent
175
+ * folder, so try `${parentDir}-${basename}` as the fallback.
172
176
  */
173
177
  const resolveDocLink = (url) => {
174
178
  if (!url || !url.includes('.md')) return null
175
179
  // Strip anchor fragment
176
180
  const [pathPart, anchor] = url.split('#')
177
- const basename = pathPart.split('/').pop().replace(/\.md$/, '')
178
- if (knownDocIds.has(basename)) {
179
- const route = docHref(basename)
180
- return anchor ? `${route}#${anchor}` : route
181
- }
182
- return null
181
+ const segs = pathPart.split('/')
182
+ const basename = segs.pop().replace(/\.md$/, '')
183
+ const parentDir = segs.filter((s) => s && s !== '.' && s !== '..').pop()
184
+ const id = knownDocIds.has(basename)
185
+ ? basename
186
+ : parentDir && knownDocIds.has(`${parentDir}-${basename}`)
187
+ ? `${parentDir}-${basename}`
188
+ : null
189
+ if (!id) return null
190
+ const route = docHref(id)
191
+ return anchor ? `${route}#${anchor}` : route
183
192
  }
184
193
 
185
194
  // Bind the resolved link + tag helpers so call sites stay terse. Hashtag
@@ -316,10 +316,14 @@ export const parseDocsMarkdown = (markdown) => {
316
316
  const blocks = getTargetBlocks()
317
317
  const lastBlock = blocks[blocks.length - 1]
318
318
 
319
+ /* Split on UNESCAPED pipes only, then unescape: Obsidian tables carry
320
+ * `[[target\|display]]` wikilinks, and a naive split('|') exploded the
321
+ * link across two cells and left literal `\` in the text — the reason
322
+ * hub INDEX pages (tables of wikilinks) rendered as junk (wave-4). */
319
323
  const cells = trimmed
320
324
  .slice(1, -1)
321
- .split('|')
322
- .map((cell) => cell.trim())
325
+ .split(/(?<!\\)\|/)
326
+ .map((cell) => cell.trim().replace(/\\\|/g, '|'))
323
327
 
324
328
  // Separator row (|---|---|)
325
329
  const isSeparator = cells.every((cell) => /^:?-+:?$/.test(cell))