mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-04-20 13:59:16 +00:00
fix: don't require snippet lang classes in code blocks
This commit is contained in:
parent
0b073c0d3c
commit
066a3fdaff
1 changed files with 1 additions and 1 deletions
|
@ -73,7 +73,7 @@ func stripBlockTags(content string) (result string) {
|
|||
return
|
||||
}
|
||||
|
||||
var codeBlockRegex = regexp.MustCompile(`(?s)<pre.*?lang-(.*?)[\s"'].*?><code>(.*?)<\/code><\/pre>`)
|
||||
var codeBlockRegex = regexp.MustCompile(`(?s)<pre(?:.+?lang-(.+?)[\s"'])?.*?><code>(.*?)<\/code><\/pre>`)
|
||||
|
||||
// HighlightCodeBlocks uses both highlightSyntaxViaContent stripCodeBlocks and returns the newly highlighted code HTML.
|
||||
func HighlightCodeBlocks(html string) string {
|
||||
|
|
Loading…
Add table
Reference in a new issue