executablebooks / MyST-Parser

An extended commonmark compliant parser, with bridges to docutils/sphinx
https://myst-parser.readthedocs.io
MIT License
708 stars 189 forks source link

For v3.0.1: If the last directive option has an empty value then it is omitted #923

Closed hroemer closed 2 months ago

hroemer commented 2 months ago

What version of myst-parser are you using?

3.0.0

What version dependencies are you using?

sphinx=7.3.7 docutils=0.20.1

What operating system are you using?

Linux

Describe the Bug

The glob patterns defined in a toctree directive do not work with 3.0.0 anymore.

Expected Behavior

No response

To Reproduce

```{toctree}
---
maxdepth: 2
caption: Contents
glob:
---
path*/index
pages/**
*/index
welcome[bot] commented 2 months ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

chrisjsewell commented 2 months ago

Heya, gotta look into exactly what is going on here, but if you change the order of the option, I think it will work, e.g.

```{toctree}
---
maxdepth: 2
glob:
caption: Contents
---
path*/index
pages/**
*/index


let me know?
hroemer commented 2 months ago

Yes indeed, changing the option order works :+1: . I will have to grep through my multiple toctrees split over hundreds of files, now :wink:.

chrisjsewell commented 2 months ago

I will have to grep through my multiple toctrees split over hundreds of files, now 😉.

well, if its not urgent, then I would hope to have a fix in perhaps the next few days 😅

hroemer commented 2 months ago

No hurry, thanks! I found a workaround by repeating the glob flag:

---
maxdepth: 2
caption: Contents
glob:
glob:
---