Skip to content
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

I believe that the construct name is missing in each package under GFM. #12

Closed
4 tasks done
shlroland opened this issue Jul 4, 2024 · 3 comments
Closed
4 tasks done
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on

Comments

@shlroland
Copy link

shlroland commented Jul 4, 2024

Initial checklist

Affected packages and versions

2.0.0

Link to runnable example

No response

Steps to reproduce

source code

Expected behavior

When I want to turn off certain constructs in the parser of remark, such as strong, I can pass attention to disable.null. But when I want to turn off constructs in GFM, such as strikethrough, I have no way unless I stop using remark-gfm altogether and instead selectively incorporate the functions I need.

Actual behavior

Upon examining the code, I discovered that it is this particular line of code that activates the passed disable.null.

    if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {
            return nok(code)
 }

But in https://github.com/micromark/micromark-extension-gfm-strikethrough/blob/ffa5ca5d0014667ed6c90625037b942cd7761c3c/dev/lib/syntax.js#L38, there isn't a name attribute.

So, would it be more appropriate to include the name attribute?

Relevant
zestedesavoir/zmarkdown#416 (comment)
remarkjs/remark-gfm#34 (comment)
#6 (comment)

Runtime

Node v16

Package manager

pnpm

OS

macOS

Build and bundle tools

Vite

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jul 4, 2024
@wooorm
Copy link
Member

wooorm commented Jul 4, 2024

Hey!

It isn’t exactly an issue: name is optional; it isn’t here because these are extensions, so you should be able to turn them off by not adding them.

But I do welcome PRs, I think it’s nice/good to have: I think I have it on my todolist somewhere too

Closing as this has to be solved in each of the extensions that implement constructs, not in this collection package!

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
@wooorm wooorm added the 👀 no/external This makes more sense somewhere else label Jul 4, 2024

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Jul 4, 2024
@shlroland
Copy link
Author

Hey!

It isn’t exactly an issue: name is optional; it isn’t here because these are extensions, so you should be able to turn them off by not adding them.

But I do welcome PRs, I think it’s nice/good to have: I think I have it on my todolist somewhere too

Closing as this has to be solved in each of the extensions that implement constructs, not in this collection package!

Thank you for your response. This feature is quite important to me, and I will submit PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants