executablebooks / mdformat-myst

Mdformat plugin for MyST compatibility
MIT License
7 stars 2 forks source link

fix: Do not error if a directive has no options or body #12

Closed jpmckinney closed 2 years ago

jpmckinney commented 3 years ago

It is allowed to do, for example:

```{directive} required argument
welcome[bot] commented 3 years ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:

hukkin commented 3 years ago

Good catch!

I suggest the following:

  1. Move the handling from format_directive_content to parse_opts_and_content (make it return None)
  2. Add a test case to tests/data/fixtures.md. E.g.
    MyST directive, no opts or content
    .
    ``` {some-directive} args

    .

    .

jpmckinney commented 3 years ago

Thanks for the review. Done now!

welcome[bot] commented 2 years ago

Congrats on your first merged pull request in this project! :tada: congrats
Thank you for contributing, we are very proud of you! :heart: