Skip to content
EPUBCheck · Images, audio and media overlays

EPUBCheck MED_018: bad SVG fragment in overlay

Updated:

EPUBCheck MED_018 is a warning message: “URL fragment should be an SVG fragment identifier, but found '#…'.” A media overlay text reference into an SVG document uses a fragment that is not an SVG fragment identifier. EPUB recommends SVG fragment identifiers there, because reading apps may not support other schemes; EPUBCheck warns and shows the fragment.

The official message

URL fragment should be an SVG fragment identifier, but found '#%1$s'.

Default severity
Warning. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.
EPUBCheck version
5.4.0

EPUBCheck prints this ID with an underscore instead of a hyphen; this page uses the ID exactly as EPUBCheck reports it.

%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.

Typical causes

  • Fragments written for XHTML used on an SVG page, such as in fixed-layout comics with narration.
  • A typo in the fragment.

How to fix it

  1. Point the text src to an element id in the SVG, or use an SVG fragment identifier such as a view or viewBox fragment.
  2. Check that the id really exists in the SVG file.
  3. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

When it's not this

For XHTML chapters the equivalent warning is MED_017.

Terms used here

Other MED messages

  • MED_017 URL fragment should indicate an element ID, but found '#…'.
  • MED_016 Media Overlays total duration should be the sum of the durations of all Media Overlays documents.
  • MED_015 Media overlay text references must be in reading order. Text target "…" is before the previous link target in … order.
  • MED_014 Media overlay audio file URLs must not have a fragment, but found '#…'.
  • MED_013 Media Overlay Document referenced from the "media-overlay" attribute does not contain a reference to this Content Document.
  • MED_012 The "media-overlay" attribute does not match the ID of the Media Overlay that refers to this document.

Sources

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.

FAQ

What does EPUBCheck MED_018 mean?

EPUBCheck MED_018 is a warning message: “URL fragment should be an SVG fragment identifier, but found '#…'.” A media overlay text reference into an SVG document uses a fragment that is not an SVG fragment identifier. EPUB recommends SVG fragment identifiers there, because reading apps may not support other schemes; EPUBCheck warns and shows the fragment.

Is MED_018 an error?

MED_018 is reported as warning by default. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.

PDF to EPUB tools

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