Исправление проблемы чтения каталога opds для koreader

This commit is contained in:
Book Pauk
2023-02-05 17:35:24 +07:00
parent 018e1069d5
commit 9126973378
3 changed files with 9 additions and 7 deletions

View File

@@ -24,13 +24,18 @@ class BasePage {
this.showDeleted = false;
}
escape(s) {
//костыль для koreader, не понимает hex-экранирование вида '
return he.escape(s).replace(/'/g, ''').replace(/`/g, '`');
}
makeEntry(entry = {}) {
if (!entry.id)
throw new Error('makeEntry: no id');
if (!entry.title)
throw new Error('makeEntry: no title');
entry.title = he.escape(entry.title);
entry.title = this.escape(entry.title);
const result = {
updated: (new Date()).toISOString().substring(0, 19) + 'Z',
@@ -48,7 +53,7 @@ class BasePage {
}
makeLink(attrs) {
attrs.href = he.escape(attrs.href);
attrs.href = this.escape(attrs.href);
return {'*ATTRS': attrs};
}