Skip to content

Flag directive options should resolve to something truthy? #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rowanc1 opened this issue Sep 20, 2022 · 0 comments
Open

Flag directive options should resolve to something truthy? #43

rowanc1 opened this issue Sep 20, 2022 · 0 comments

Comments

@rowanc1
Copy link
Member

rowanc1 commented Sep 20, 2022

In a directive, setting an option_spec to directiveOptions.flag will result in the result being null if the flag is set. This is strange, as the flag is truthy.

Passing this onto mdast currently requires, for example,

const mdastOptions = {
  open: t.meta.open === null || undefined,
};

Ideally the value coming out of this library is truthy for a "flag". It would also be great to have the flag be able to be set with a "true" in the markup.

```{dropdown}
:open: true
```

Currently this gets parsed into a directive error, see #42.

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

No branches or pull requests

1 participant