The name2id command reads an HTML file and looks for elements with an A element has first child, with no intervening text other than whitespace. If that A element has an ID or NAME attribute, it is moved to the parent element and removed from the A.
Because Netscape 4 doesn't understand ID attributes, it was common practice to write <H2><A NAME="sect7">...</A></H2> instead of <H2 ID="sect7">. This program can be used to convert such old HTML files to the new convention.
Other programs in this suite, such as multitoc, require IDs on headings instead of A elements with NAME attributes. So it is useful to run name2id prior to running multitoc and similar program. name2id can be used in a pipe.
The error recovery for incorrect HTML is primitive.