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`
This commit is contained in:
bors 2021-01-27 06:47:07 +00:00
commit 5db215bca8

View File

@ -22,7 +22,10 @@ def parse_code_block(match):
lines = []
for line in match.group(0).split('\n'):
if not line.startswith('# '):
# fix syntax highlighting for headers like ```rust,ignore
if line.startswith('```rust'):
lines.append('```rust')
elif not line.startswith('# '):
lines.append(line)
return '\n'.join(lines)