Skip to content

Commit

Permalink
Improve detection of YAML option block (fixes executablebooks#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
iso2013 authored Aug 19, 2024
1 parent 1038800 commit bb7e1a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion myst_parser/parsers/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ def _parse_directive_options(
content_lines = content.splitlines()
yaml_lines = []
while content_lines:
if not content_lines[0].lstrip().startswith(":"):
next_line = content_lines[0].lstrip()
if not next_line.startswith(":") or next_line.lstrip(":").startswith("{"):
break
yaml_lines.append(content_lines.pop(0).lstrip()[1:])
options_block = "\n".join(yaml_lines)
Expand Down

0 comments on commit bb7e1a5

Please sign in to comment.