Skip to content

Commit 3fe847b

Browse files
authored
server : do not apply Markdown formatting in code sections (#6850)
1 parent 37246b1 commit 3fe847b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/server/public/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -881,11 +881,11 @@
881881
.replace(/&/g, '&')
882882
.replace(/</g, '&lt;')
883883
.replace(/>/g, '&gt;')
884-
.replace(/^#{1,6} (.*)$/gim, '<h3>$1</h3>')
885-
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
886-
.replace(/__(.*?)__/g, '<strong>$1</strong>')
887-
.replace(/\*(.*?)\*/g, '<em>$1</em>')
888-
.replace(/_(.*?)_/g, '<em>$1</em>')
884+
.replace(/(^|\n)#{1,6} ([^\n]*)(?=([^`]*`[^`]*`)*[^`]*$)/g, '$1<h3>$2</h3>')
885+
.replace(/\*\*(.*?)\*\*(?=([^`]*`[^`]*`)*[^`]*$)/g, '<strong>$1</strong>')
886+
.replace(/__(.*?)__(?=([^`]*`[^`]*`)*[^`]*$)/g, '<strong>$1</strong>')
887+
.replace(/\*(.*?)\*(?=([^`]*`[^`]*`)*[^`]*$)/g, '<em>$1</em>')
888+
.replace(/_(.*?)_(?=([^`]*`[^`]*`)*[^`]*$)/g, '<em>$1</em>')
889889
.replace(/```.*?\n([\s\S]*?)```/g, '<pre><code>$1</code></pre>')
890890
.replace(/`(.*?)`/g, '<code>$1</code>')
891891
.replace(/\n/gim, '<br />');

0 commit comments

Comments
 (0)