WORK-418
Setting up your dashboard 0 entities found · 9/32 branches scanned
ID:WORK-418Status:ready

Image-src scheme registry + resolver hook

The foundation for SPEC-106: recognise custom URL schemes in a Markdown image's src during the transform and resolve them to a renderable, before the generic <img> fallback. Custom schemes (placeholder:, icon:) already survive markdown-it's validateLink, so ![alt](scheme:arg) arrives as an image node with src intact.

Priority:mediumComplexity:moderateMilestone:v0.22.0Source:SPEC-106
claude/spec-image-src-scheme-sugar View source

Criteria completion

Criteria completion: 0 of 3 (0%) checked; tracking started on Jun 13, no incremental history yet0%25%50%75%100%Jun 13Jun 15

Tracking started Jun 13 — check back for trends.

Branches 2
claude/spec-image-src-scheme-sugar current ready
claude/spec-106-image-src-schemes donemain done
History 1
  1. 8bc0dca
    Created (ready)by bjornolofandersson

Scope

  • Extend the image schema transform (packages/runes/src/nodes.ts) with a small scheme → resolver registry. Each resolver receives the argument (after scheme:) plus the node's alt/title/property and returns a renderable Tag (typically an inline <svg>, mirroring the existing svgFiles inline-SVG branch).
  • Unrecognised schemes (and ordinary paths/URLs) fall through to the normal <img> path unchanged.
  • Establish the registry so the icon: (WORK-419) and placeholder: (WORK-420) resolvers plug in; ship neither resolver here (a no-op/test resolver proves the hook).

Acceptance Criteria

  • The image transform matches src against a scheme registry before the <img> fallback; a registered resolver's returned Tag replaces the <img>.
  • Unknown schemes, relative paths, and absolute URLs pass through to <img> unchanged (existing svgFiles behaviour preserved).
  • Resolvers receive the scheme argument + alt/title/property; a unit test exercises the hook with a stub resolver.

References

  • SPEC-106 · packages/runes/src/nodes.ts (the image schema transform).