From 3fe847b5747676ee1bf90371c46ed0bc66b57240 Mon Sep 17 00:00:00 2001 From: mgroeber9110 <45620825+mgroeber9110@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:54:24 +0200 Subject: [PATCH] server : do not apply Markdown formatting in code sections (#6850) --- examples/server/public/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/server/public/index.html b/examples/server/public/index.html index 9fe61eb1b..2961999f2 100644 --- a/examples/server/public/index.html +++ b/examples/server/public/index.html @@ -881,11 +881,11 @@ .replace(/&/g, '&') .replace(//g, '>') - .replace(/^#{1,6} (.*)$/gim, '

$1

') - .replace(/\*\*(.*?)\*\*/g, '$1') - .replace(/__(.*?)__/g, '$1') - .replace(/\*(.*?)\*/g, '$1') - .replace(/_(.*?)_/g, '$1') + .replace(/(^|\n)#{1,6} ([^\n]*)(?=([^`]*`[^`]*`)*[^`]*$)/g, '$1

$2

') + .replace(/\*\*(.*?)\*\*(?=([^`]*`[^`]*`)*[^`]*$)/g, '$1') + .replace(/__(.*?)__(?=([^`]*`[^`]*`)*[^`]*$)/g, '$1') + .replace(/\*(.*?)\*(?=([^`]*`[^`]*`)*[^`]*$)/g, '$1') + .replace(/_(.*?)_(?=([^`]*`[^`]*`)*[^`]*$)/g, '$1') .replace(/```.*?\n([\s\S]*?)```/g, '
$1
') .replace(/`(.*?)`/g, '$1') .replace(/\n/gim, '
');