EPUBCheck HTM-045: empty href in a link
Updated:
EPUBCheck HTM-045 is a usage message: “Encountered empty href.” A link has an empty href, which points back to the same document. It is valid, and EPUBCheck only reports it as a usage note so you can check that a self-link was intended.
The official message
Encountered empty href.
EPUBCheck's suggestion: Empty hrefs are valid self-references. These should be validated to ensure that this is the desired intent.
- Default severity
- Usage. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.
- EPUBCheck version
- 5.4.0
Typical causes
- Placeholder links that were never filled in.
- Links whose target was removed by an editor or a converter that could not resolve it.
How to fix it
- Open the file EPUBCheck names (the message gives the path, line and column) in a text or EPUB editor such as Sigil, or unzip the EPUB and open it there.
- Give the link a real target, such as another chapter or a fragment like
#note-3. - If it should not be a link at all, remove the a element and keep its text.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the href points to a fragment that does not exist, that is RSC-012, not HTM-045.
Terms used here
Other HTM messages
HTM-044Namespace uri "…" was included but not used.HTM-046Fixed layout document has no "viewport" meta element.HTM-047Viewport metadata "…" has a syntax errorHTM-048SVG Fixed-Layout Documents must have a "viewBox" attribute (on the outermost "svg" element).HTM-051Found Microdata semantic enrichments but no RDFa. EDUPUB recommends using RDFa Lite.HTM_054Custom attribute namespace ("…") must not include the string "…" in its domain.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.