Skip to content

Commit

Permalink
👌 IMPROVE: parse_directive_options
Browse files Browse the repository at this point in the history
The change allows compatibility with the
`sphinx.ext.autodoc.directive.DummyOptionSpec` instances.
  • Loading branch information
chrisjsewell committed Dec 11, 2021
1 parent 894e8a9 commit 675a1c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions myst_parser/parse_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ def parse_directive_options(
# check options against spec
options_spec = directive_class.option_spec # type: Dict[str, Callable]
for name, value in list(options.items()):
convertor = options_spec.get(name, None)
if convertor is None:
try:
convertor = options_spec[name]
except KeyError:
raise DirectiveParsingError(f"Unknown option: {name}")
if not isinstance(value, str):
if value is True or value is None:
Expand Down

0 comments on commit 675a1c6

Please sign in to comment.