diff --git a/src/utils/syntax.go b/src/utils/syntax.go index 65959ec..369f114 100644 --- a/src/utils/syntax.go +++ b/src/utils/syntax.go @@ -73,7 +73,7 @@ func stripBlockTags(content string) (result string) { return } -var codeBlockRegex = regexp.MustCompile(`(?s)
(.*?)<\/code><\/pre>`)
+var codeBlockRegex = regexp.MustCompile(`(?s)]+?lang-(.+?)[\s"'])?.*?>(.*?)<\/code><\/pre>`)
// HighlightCodeBlocks uses both highlightSyntaxViaContent stripCodeBlocks and returns the newly highlighted code HTML.
func HighlightCodeBlocks(html string) string {