Skip to content

Is extensions available? #109

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
datsukan opened this issue Apr 16, 2022 · 2 comments
Open

Is extensions available? #109

datsukan opened this issue Apr 16, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@datsukan
Copy link

I am not good at English and use machine translation.

First of all, thank you for creating such a useful library.
Let me ask one question.
Are the extensions listed on the Marked.js site available for this library?

https://marked.js.org/using_pro#extensions

@mlaursen
Copy link
Owner

mlaursen commented May 3, 2022

Hello! I'm glad you like this library.

I'm currently using the lexer to parse the markdown string and generate tokens which can then be rendered as different components. It seems like the extensions are only applied when using marked.parse() from my few tests :/

I'll look into implementing custom extensions or parsers though since I've already run into some limitations.

@mlaursen mlaursen added the enhancement New feature or request label May 3, 2022
@kelvinhammond
Copy link

For what it's worth @datsukan and @mlaursen I got extensions to work by passing in the marked.defaults after calling marked.use. You can probably also just set the options for extensions yourself but marked.use appeared to make modifications.

marked.use(myext);

function MyComponent({ text }) {
  return <Markdown options={marked.defaults} markdown={text} />;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants