reverse order of codeblock and table replacement to resolve issue converting codeblocks that have already been syntax highlighted

main
Lee Hanken 2022-12-03 11:58:54 +00:00
parent 0f27a3a5e4
commit 82365d9fb0
2 changed files with 2 additions and 2 deletions

0
Dockerfile Normal file → Executable file
View File

View File

@ -111,9 +111,9 @@ function process_dom(url, document, res, inline_title, ignore_links, id="") {
} }
let reader = new Readability(document.window.document); let reader = new Readability(document.window.document);
let readable = reader.parse().content; let readable = reader.parse().content;
let replacements = [] let replacements = [];
readable = format_tables(readable, replacements);
readable = format_codeblocks(readable, replacements); readable = format_codeblocks(readable, replacements);
readable = format_tables(readable, replacements);
let markdown = service.turndown(readable); let markdown = service.turndown(readable);
for (let i=0;i<replacements.length;i++) { for (let i=0;i<replacements.length;i++) {
markdown = markdown.replace(replacements[i].placeholder, replacements[i].replacement); markdown = markdown.replace(replacements[i].placeholder, replacements[i].replacement);