It is simple, any link that is pointing to another html file when that file also links back to the original link is assumed to be a endnote/backlink pair.
This assumption can, of course be incorrect in some cases, as you discovered, but most of the time, it makes sense. You can always force the viewer to not treat a link as a footnote/endnote, by setting
epub:type="link" on the <a> tag.
|