Skip to content

Commit

Permalink
Error when code examples are improperly closed (#15186)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgugger authored Jan 18, 2022
1 parent 22454ae commit f6d3fee
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit f6d3fee

Please sign in to comment.