Unverified Commit f6d3fee8 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Error when code examples are improperly closed (#15186)

parent 22454ae4
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment