From ba38e32dd52437567e8035bfc94deb4805275731 Mon Sep 17 00:00:00 2001 From: Ro Date: Fri, 23 Apr 2021 13:27:21 -0700 Subject: [PATCH] fix for code tag being sanitized on html render --- brain/data/Render.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brain/data/Render.inc.php b/brain/data/Render.inc.php index 591aeca..3bdcb62 100644 --- a/brain/data/Render.inc.php +++ b/brain/data/Render.inc.php @@ -67,7 +67,7 @@ class Render $parser = new Parser(); $rendered = $parser->parse($page["content"]); $sanitizer = \HtmlSanitizer\Sanitizer::create([ - "extensions" => ["basic", "image", "list"], + "extensions" => ["basic", "image", "list", "code"], ]); $preclean = $sanitizer->sanitize($rendered->getContent()); $cleaned = strip_tags($preclean, [ @@ -84,6 +84,8 @@ class Render "h1", "h2", "h3", + "pre", + "code", ]); //$cleaned = preg_replace('/(?:\r\n|[\r\n]){2,}/', "\n\n", $cleaned); //$cleaned = html_entity_decode($cleaned, ENT_QUOTES, "UTF-8");