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

Confusing/contradicting documentation regarding extensions #3488

Open
ronny-rentner opened this issue Oct 14, 2024 · 3 comments
Open

Confusing/contradicting documentation regarding extensions #3488

ronny-rentner opened this issue Oct 14, 2024 · 3 comments
Labels
category: docs Documentation changes

Comments

@ronny-rentner
Copy link

ronny-rentner commented Oct 14, 2024

On https://marked.js.org/using_pro#use it's being said I can use marked.use(myExtension, extension2, extension3); to load my custom extension but this doesn't work.

On https://marked.js.org/using_pro#extensions you learn that you actually have to use marked.use({ extensions: [description] }); with the key extensions.

The first version does not work but there's also no error message. Just nothing happens which is bad because you start guessing around why nothing happens and why your extension is not being used.

@UziTech
Copy link
Member

UziTech commented Oct 14, 2024

There is a difference between "Marked Extension" and "Custom Extension" see #3182 and The two hardest things in computer science

@ronny-rentner
Copy link
Author

And this difference is necessary? What's the idea behind it? Why not treat any kind of extension the same and simplify things?

@UziTech
Copy link
Member

UziTech commented Oct 15, 2024

A marked extension can have multiple custom extensions, tokenizer extensions, and renderer extensions. Yes this is necessary mostly for legacy reasons. It would be great to clean it up but there will be many extensions that would break.

@UziTech UziTech added the category: docs Documentation changes label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: docs Documentation changes
Projects
None yet
Development

No branches or pull requests

5 participants
@UziTech @ronny-rentner and others