Skip to content

Commit

Permalink
Fix code highlighting for languages with non-alphanumeric characters (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko authored Feb 18, 2025
1 parent a249be4 commit abe1c66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ex_doc/doc_ast.ex
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ defmodule ExDoc.DocAST do

## Html cannot be parsed with regex, but we try our best...
Regex.replace(
~r/<pre(\s[^>]*)?><code(?:\s+class="(\w*)")?>([^<]*)<\/code><\/pre>/,
~r/<pre(\s[^>]*)?><code(?:\s+class="([^"\s]*)")?>([^<]*)<\/code><\/pre>/,
html,
&highlight_code_block(&1, &2, &3, &4, highlight_info, opts)
)
Expand Down

0 comments on commit abe1c66

Please sign in to comment.