html

package
v0.29.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTestFile

func IsTestFile(_ string) bool

IsTestFile reports whether the given HTML path is a test file. HTML documents have no widely shared test-file convention, so every HTML file is treated as production content.

func ParseHTMLLinks(sourceCode []byte) []string

ParseHTMLLinks extracts file-reference destinations from `href` / `src` attributes in HTML source. Values are normalized: external URLs, anchors, and non-file references are dropped. Attribute parsing is driven by tree-sitter, so destinations inside comments or element text are never matched.

func ResolveHTMLLinkPath

func ResolveHTMLLinkPath(sourceFile, linkPath string, suppliedFiles map[string]bool) []string

ResolveHTMLLinkPath resolves an HTML link target against the source file's directory and returns matching project files.

Server-absolute links ("/css/app.css") do not share the filesystem root, so they are resolved by suffix-matching the supplied project files, mirroring the Markdown resolver.

func ResolveHTMLProjectImports

func ResolveHTMLProjectImports(
	absPath string,
	_ string,
	_ string,
	suppliedFiles map[string]bool,
	contentReader vcs.ContentReader,
) ([]string, error)

ResolveHTMLProjectImports extracts link/asset references from an HTML file and returns the supplied project paths they resolve to.

Types

type Provider

type Provider struct{}

func (Provider) Extensions

func (Provider) Extensions() []string

func (Provider) IsTestFile

func (Provider) IsTestFile(filePath string, _ vcs.ContentReader) bool

func (Provider) Maturity

func (Provider) Maturity() moduleapi.MaturityLevel

func (Provider) Name

func (Provider) Name() string

func (Provider) NewResolver

func (Provider) NewResolver(ctx *moduleapi.Context, contentReader vcs.ContentReader) moduleapi.Resolver

Jump to

Keyboard shortcuts

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