improve chapter name sanitization

This commit is contained in:
Marko Andjelic 2026-06-25 22:08:53 +01:00
commit f17f6a63e2
Signed by: marko
GPG key ID: 9C5E99C8C682FB59

View file

@ -132,7 +132,8 @@ extractTocFromEntry fullPath = do
getChapter :: (InternalPath, T.Text) -> ChapterIndex -> EpubAction Chapter
getChapter (InternalPath filename, tocTitle) idx = do
env <- ask
let full = normalise (baseDir env </> filename)
let bare = takeWhile (/= '#') filename
let full = normalise (baseDir env </> bare)
case findEntryByPath full (archive env) of
Nothing -> pure $ Chapter tocTitle "" idx
Just e -> do