linktext

command
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Command linktext finds links whose text says nothing about where they go, and either flags or fixes them.

linktext < page.html                 # report only
linktext -flag < page.html > out.html # mark them in the document
linktext -fix page.html > out.html    # rewrite the text

The three modes exist because of one constraint, which is worth naming rather than working around quietly: whether a link's text is generic is not known until the link's closing tag, and by then the only thing that can still be done is to insert content. An attribute cannot be set on an element whose end tag has already arrived, and the element's content cannot be replaced either.

So -flag inserts a marker after the link, which the end tag allows, and -fix reads the document twice: once to decide, once to rewrite. Reporting needs neither.

Jump to

Keyboard shortcuts

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