Skip to content
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

Error when code examples are improperly closed #15186

Merged
merged 1 commit into from
Jan 18, 2022
Merged
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
3 changes: 3 additions & 0 deletions utils/style_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,9 @@ def style_mdx_file(mdx_file, max_len=119, check_only=False):
else:
new_lines.append(line)

if in_code:
raise ValueError(f"There was a problem when styling {mdx_file}. A code block is opened without being closed.")

clean_content = "\n".join(new_lines)
diff = clean_content != content
if not check_only and diff:
Expand Down