This chapter is not available on Baka-Tsuki.
'; const $ = parseHTML(html); $( '.mw-editsection, #toc, .toc, .navbox, .printfooter, .catlinks, ' + '.mw-jump-link, .noprint, #siteSub, .mw-empty-elt, #contentSub, ' + '.mw-references-wrap ~ .navbox, script, style', ).remove(); // Chapter navigation sits in a table at the top and bottom of most pages, // but not reliably in the same position — match on content instead. $('table').each((_, element) => { const table = $(element); if (/Back to|Return to|Forward to|Main Page/i.test(table.text())) { table.remove(); } }); const origin = new URL(this.site).origin; const absolute = (value: string) => value.startsWith('//') ? `https:${value}` : value.startsWith('/') ? origin + value : value; $('img[src]').each((_, element) => { const img = $(element); img.attr('src', absolute(img.attr('src') ?? '')); img.removeAttr('srcset'); }); $('a[href]').each((_, element) => { const anchor = $(element); anchor.attr('href', absolute(anchor.attr('href') ?? '')); }); const content = $.html().trim(); return content || 'This chapter appears to be empty.
'; } resolveUrl = (path: string) => `${this.site}index.php?title=${encodeURIComponent(this.toTitle(path))}`; } export default new BakaTsuki();