Skip to content

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

Merged
hukkin merged 1 commit intoexecutablebooks:masterfrom
jpmckinney:patch-1
Feb 1, 2022
Merged

fix: Do not error if a directive has no options or body#12
hukkin merged 1 commit intoexecutablebooks:masterfrom
jpmckinney:patch-1

Conversation

@jpmckinney
Copy link
Contributor

@jpmckinney jpmckinney commented Jul 8, 2021

It is allowed to do, for example:

```{directive} required argument
```

@welcome
Copy link

welcome bot commented Jul 8, 2021

Thanks for submitting your first pull request! You are awesome! 🤗

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! 🎉

@hukkin
Copy link
Collaborator

hukkin commented Jul 8, 2021

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
    ```
    .
    ```{some-directive} args
    ```
    .

@jpmckinney
Copy link
Contributor Author

Thanks for the review. Done now!

@welcome
Copy link

welcome bot commented Feb 1, 2022

Congrats on your first merged pull request in this project! 🎉
congrats

Thank you for contributing, we are very proud of you! ❤️

@jpmckinney jpmckinney deleted the patch-1 branch February 1, 2022 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants