revert double newline in code blocks

main
macsplit 2022-05-13 13:03:37 +01:00
parent 8ec740856d
commit 88bb51227b
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ function code_block_to_markdown (html) {
const match_code = /^\s*<code[^>]*>[\r\n]*([\s\S]*)<\/code>\s*$/ig.exec(inner_html); const match_code = /^\s*<code[^>]*>[\r\n]*([\s\S]*)<\/code>\s*$/ig.exec(inner_html);
if (match_code && match_code[1]) if (match_code && match_code[1])
inner_html = match_code[1]; inner_html = match_code[1];
inner_html = inner_html.replaceAll(/<br[^>]*>/ig,"\n\n"); inner_html = inner_html.replaceAll(/<br[^>]*>/ig,"\n");
inner_html = inner_html.replaceAll(/<[^>]+>/ig, ""); inner_html = inner_html.replaceAll(/<[^>]+>/ig, "");
inner_html = htmlentities.decode(inner_html); inner_html = htmlentities.decode(inner_html);
const markdown = "```\n"+inner_html+"\n```\n"; const markdown = "```\n"+inner_html+"\n```\n";