Repository navigation
feat(reader): heuristic and cross-file footnote popover extraction - #1
Merged
Merged
Conversation
… prevent dark-on-dark contrast issues
… button when footnote target is not found
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Ringkasan Perubahan Utama (Summary)
PR ini menghadirkan peningkatan besar pada sistem pembacaan catatan kaki (footnote). Sebelumnya, reader hanya mendukung catatan kaki lokal yang menggunakan atribut semantik formal EPUB 3 (
epub:type="noteref"/role="doc-noteref"). Fitur ini memperluas deteksi catatan kaki menggunakan aturan heuristik toleran (mendukung pola angka/simbol dalam kurung siku[1], tanda bintang*, dagger†, serta class/id/href berpola footnote) dan mengimplementasikan ekstraksi in-situ untuk catatan kaki yang tersimpan di berkas terpisah (cross-file footnotes, misalnyanotes.xhtml#fn1).Selain ekstraksi cross-file tanpa memindahkan pembaca dari posisi baca bab utama, PR ini menyempurnakan penanganan edge cases saat target anchor tidak ditemukan di berkas tujuan maupun di bab saat ini (intra-file), dengan menampilkan kartu popover informatif (
⚠️ Target Not Found) dan tombol navigasi manual tanpa memicu crash atau silent failure.✨ Fitur Baru & Pembaruan (Features & Updates)
<sup>/<sub>.[1],(1),1,*,†).class,id, atauhrefyang mengandung kata kuncifootnote,noteref,endnote,fn, ataunote.requestFootnotedari webview ke Extension Host ketika tautan lintas berkas diklik.extractElementByIddancleanFootnoteMarkupdisrc/xhtml.tsuntuk mengekstrak elemen<aside>,<li>, atau<p>(termasuk inline anchor) dan membersihkan tautan balik (role="doc-backlink",↩).sanitizeXhtmluntuk mencegah script injection.🐛 Perbaikan Bug & Optimasi (Bug Fixes & Refactor)
:root:not(.light) #contentuntuk mencegah isu teks hitam di atas latar gelap akibat CSS statis bawaan buku (color: #1f2937).sample-book/OEBPS/style.cssagar secara alami mewarisi palet tema pembaca.📦 Maintenance & Dokumentasi (Maintenance & Docs)
test/xhtml.test.mjsuntuk ekstraksi elemen catatan kaki berbasis ID dan pembersihan backlink (seluruh 27 tes lulus).sample-book/lengkap dengan skenario catatan cross-file, heuristik, dan pengujian edge case.Catatan Reviewer / Dev Notes:
tsc --noEmitbersih 0 error, build esbuild sukses, dan 27 unit tests lulus.