Skip to content

Fix syntax highlighting for no_run blocks #7450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions util/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from lintlib import parse_all, log

lint_subheadline = re.compile(r'''^\*\*([\w\s]+?)[:?.!]?\*\*(.*)''')
rust_code_block = re.compile(r'''```rust.+?```''', flags=re.DOTALL)
rust_code_block = re.compile(r'''```(rust|no_run).+?```''', flags=re.DOTALL)

CONF_TEMPLATE = """\
This lint has the following configuration variables:
Expand All @@ -23,7 +23,7 @@ def parse_code_block(match):

for line in match.group(0).split('\n'):
# fix syntax highlighting for headers like ```rust,ignore
if line.startswith('```rust'):
if line.startswith('```rust') or line.startswith('```no_run'):
lines.append('```rust')
elif not line.startswith('# '):
lines.append(line)
Expand Down