Skip to content
EPUBCheck · XHTML content documents

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

  1. 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.
  2. Give the link a real target, such as another chapter or a fragment like #note-3.
  3. If it should not be a link at all, remove the a element and keep its text.
  4. 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-044 Namespace uri "…" was included but not used.
  • HTM-046 Fixed layout document has no "viewport" meta element.
  • HTM-047 Viewport metadata "…" has a syntax error
  • HTM-048 SVG Fixed-Layout Documents must have a "viewBox" attribute (on the outermost "svg" element).
  • HTM-051 Found Microdata semantic enrichments but no RDFa. EDUPUB recommends using RDFa Lite.
  • HTM_054 Custom 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.

FAQ

What does EPUBCheck HTM-045 mean?

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.

Is HTM-045 an error?

HTM-045 is reported as usage by default. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.

PDF to EPUB tools

Every tool uses the same engine and starts with a free 5-page sample.