EPUBCheck RSC-012: broken fragment link (#id)
Updated:
EPUBCheck RSC-012 is an error message: “Fragment identifier is not defined.” A link points to a fragment (#id) that does not exist in the target document. The link opens the right file but cannot jump to the intended place, which is common with footnotes and table of contents entries.
The official message
Fragment identifier is not defined.
- Default severity
- Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
- EPUBCheck version
- 5.4.0
Typical causes
- Footnote or table of contents links to an id that was renamed or never written, a common result of conversion and of splitting a book into chapters.
- A link that targets the right id but the wrong file after a chapter was split.
How to fix it
- Find the link and the id named in the message.
- Add the missing id to the target element, or correct the link to an id that exists.
- After splitting chapters, update links so they name the file where the id now lives.
When it's not this
If the file itself is missing, that is RSC-007; a fragment on a PNG or JPEG is RSC-009.
Terms used here
Other RSC messages
RSC-011Found a reference to a resource that is not a spine item.RSC-013Fragment identifier is used in a reference to a stylesheet resource.RSC-010Reference to non-standard resource type found.RSC-014Fragment identifier defines an incompatible resource type.RSC-009A non-SVG image resource should not be defined with a fragment identifier.RSC-015A fragment identifier is required for svg use tag references.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.