remarkjs / remark-gfm

remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists)

Home Page:https://remark.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add options to selectively disable sub-plugins

tripodsan opened this issue · comments

Initial checklist

Problem

It would be useful to be able to disable some features of the GFM plugin.
use case could be: use all GFM features except the autolink literals.

Solution

allow disabling certain plugins with option:

const mdast = unified()
  .use(remark)
  .use(gfm, {
    autolink: false,
  })
  .parse(doc);

Alternatives

Create a custom plugin for remark-gfm and mdast-util-gfm that is more or less a copy of the original ones.

commented

I want markdown to become easier, more uniform, more “standard”. I.e., matching CommonMark and GFM. Not the funky language whatsapp or slack has. I don‘t think it’s a good feature to add.

I think the alternative is fine! 👍

Hi! 👋
I landed here due to the same need as @tripodsan.

I couldn't believe that no one had ever struggled with the same problem and I was wondering why such a simple configuration wasn't already present on a such popular project.

Then, I read your comments, @wooorm...
Both in this issue and in this one...

What you said is a legitimate point of view, IMHO... It has its reason to be valid!


In any case, I was hugely surprised by this kind of closed-mindedness in an open-source project...
And to be honest, I just can't understand why...

You asked:

  • This package follows GFM. Why would you use this but not want to follow GFM. 🤷‍♂️
  • What is so bad about emails be clickable?

Now I'm asking you:

  • Why can't just add such a basic flag to leave the developer the choice?
    Is that hard to implement?
  • Why force someone to fork this project to simply disable this functionality?
    What could be the benefits of this kind of fragmentation of effort and knowledge?

At this point, sadly, I still have to create a new repository to solve this problem...
Can I create a PR to this repository adding this configuration? Will you accept it?

Finally, I just want to let you know that I find this situation totally absurd; but, I know, this is only my two cents. 🙃

commented

I do not know what problem you are running into. If you just want to shout into the void, please don’t do it here. If you have a problem, share your problem in the designated channels.

I think that breaking GFM is bad.
Everything is possible because unified is lego bricks. You can make whatever you want.
I don’t think people learning and using unified and composing the things they want is bad.

Adding flags to turn things off here is not a good approach. It includes code to autolink but then doesn’t use them. If you have a problem, share your problem in a constructive manner by opening a discussion: I want to achieve A, I’ve though about B and C but it doesn’t work because of D, anyone have any recommendations?

I'm not an English native speaker so I apologize if my comment seems to be rude.
It didn't want to be. 😥

My original goal was actually to be constructive.
That's why I haven't created a new issue, it would simply be a duplicate of this one. As is.

To be precise, it's the 4th check on the "New issue" template:

  • I searched issues and couldn’t find anything (or linked relevant results below) *

But, of course...
If you prefer, I'll open a new issue. No problem. 🙃

commented

I recommend discussions, which is better for vague problems