Skip to content

Commit abe1c66

Browse files
Fix code highlighting for languages with non-alphanumeric characters (#2092)
1 parent a249be4 commit abe1c66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ex_doc/doc_ast.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ defmodule ExDoc.DocAST do
165165

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

0 commit comments

Comments
 (0)