linkTarget

The element an internal link points at, to show a note, a glossary entry or a citation in place instead of turning the page (#227). Reads the markup of the target's chapter only, and does not lay it out.

href is a link as EpubPage.links gives it, zipPath#fragment. Returns null for an external URL, a link without a fragment, or a fragment the chapter lacks.

val link = page.links.first { it.kind == EpubLinkKind.NOTE_REFERENCE }
book.linkTarget(link.href)?.let { note -> showNote(note.text) }