refs

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package refs extracts internal markdown link targets from rendered content. It is pure and stdlib-only: it performs no I/O and resolves no paths — callers resolve and stat the returned targets. (ADR-0020)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Links(content string) []string

Links returns the relative-path targets of inline markdown links — [text](target) — in content, in order of appearance. Image-link destinations (![alt](target)) are extracted too, so a dead image counts as a dead reference. It skips: external targets (http://, https://, mailto:, tel:) and bare #fragment anchors; links inside a fenced code block (opened by ``` or ~~~); and links inside an inline code span (text between paired `-backtick delimiters). A trailing #anchor and a (target "title") title are stripped, leaving the bare relative path. Reference-style links ([text][id]) and 4-space-indented code blocks are out of scope.

func WithoutFences added in v0.6.0

func WithoutFences(content string) string

WithoutFences returns content minus fenced-code-block lines (opened by ``` or ~~~; delimiter lines dropped too). Inline code spans are deliberately kept — scanners like the skill-reference check (ADR-0046) match tokens that legitimately render inside single-backtick spans.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL