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

Update USING_PRO.md #3492

Merged
merged 4 commits into from
Oct 20, 2024
Merged

Update USING_PRO.md #3492

merged 4 commits into from
Oct 20, 2024

Conversation

linuxbckp
Copy link
Contributor

Add document about #3487

Copy link

vercel bot commented Oct 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 20, 2024 3:50am

@UziTech
Copy link
Member

UziTech commented Oct 18, 2024

I think this might be better to add to marked.use documentation since this is not only for walkTokens but any time marked.use is called.

@linuxbckp
Copy link
Contributor Author

OK. I changed to Marked part.

@@ -13,6 +13,31 @@ const marked = new Marked([options, extension, ...]);
|:--------|:-------|:----------------------------------------------------------------------|
| options |`object`|The same arguments that can be passed to [`marked.use`](/using_pro#use)|

Another case is, if you want to rerun function everytime they open a file, or you want to make marked.run() non-state, you can create a new instance of Marked to ensure options and extensions are locally scoped.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem like this is saying anything more than the documentation above. That the user should use Marked instance if they want extensions to be locally scoped.

I think the example should emphasize that marked.use(...) should not be used in a loop or function. It should only be used directly after new Marked is created or marked is imported

@linuxbckp
Copy link
Contributor Author

OK. I changed to a note.

Copy link
Member

@UziTech UziTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 💯

@UziTech UziTech merged commit 17ca80c into markedjs:master Oct 20, 2024
8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants