Skip to content

Commit 5db215b

Browse files
committed
Auto merge of #6645 - camsteffen:syntax-highlighting, r=phansch
Fix website syntax highlighting changelog: none Fix syntax highlighting on website when the docs contain ` ```rust,ignore`
2 parents be0125b + cbf9d49 commit 5db215b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

util/export.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def parse_code_block(match):
2222
lines = []
2323

2424
for line in match.group(0).split('\n'):
25-
if not line.startswith('# '):
25+
# fix syntax highlighting for headers like ```rust,ignore
26+
if line.startswith('```rust'):
27+
lines.append('```rust')
28+
elif not line.startswith('# '):
2629
lines.append(line)
2730

2831
return '\n'.join(lines)

0 commit comments

Comments
 (0)