You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to turn off specific marked rules so that the marked renderer ignores said rules and leaves the input as is:
"`This would be inline-code`" should turn into "`This would be inline-code`" (notice how the backticks and everything else is still there)
"# heading" should turn into "# heading" (notice how the hash is still there and it didn't turn into a <h1> tag)
![Why do developers never include their Discord or have open DMs on Twitter?](discord.png) should turn into ![Why do developers never include their Discord or have open DMs on Twitter?](discord.png)
etc. I think you get the idea
Why it's necessary
Because some people do not want or need the full markdown feature set.
As an example, I don't want the user to be able to link images using markdown when I am already providing an image uploader feature on my site. I don't want my text to change colors when the user discovers backticks (also I don't want the user to wonder where his backticks went). The only thing I want is the user to be able to make his text bolditalic and strikethrough.
What I have tried
I've dug through #420 and the related tickets and have found a few things that looked like they might work. They didn't:
"`This would be inline-code`" turned into "This would be inline-code" (notice how the backticks are missing)
"# heading" turned into "`heading" (notice how the hash is no longer there)
![Why do developers never include their Discord or have open DMs on Twitter?](discord.png) turned into Why do developers never include their Discord or have open DMs on Twitter?
etc.
This almost isn't stupid but it still is stupid, because the user will look at this and wonder "Where have all my special characters gone"?
If there is a way to achieve what I am looking for, please enlighten me. I have done my research, even using AI, and couldn't find the solution to my issue. IMO, this should be something you can configure in the MarkedOptions.
I would greatly appreciate a TypeScript approach to my issue, by the way.
The text was updated successfully, but these errors were encountered:
You're going to need hooks (https://marked.js.org/using_pro#hooks) or, if that is not sufficient, register extensions to achieve this level of customization.
You're going to need hooks (https://marked.js.org/using_pro#hooks) or, if that is not sufficient, register extensions to achieve this level of customization.
I have read the documentation and came to the conclusion that I cannot achieve the desired result with hooks. Perhaps this is just a skill issue though. Would you mind providing an example?
You can see an example extension in the docs. You can also try just changing the tokenizer to return undefined for the tokens you don't want to create.
What I want:
I want to be able to turn off specific marked rules so that the marked renderer ignores said rules and leaves the input as is:
<h1>
tag)![Why do developers never include their Discord or have open DMs on Twitter?](discord.png)
should turn into![Why do developers never include their Discord or have open DMs on Twitter?](discord.png)
Why it's necessary
Because some people do not want or need the full markdown feature set.
As an example, I don't want the user to be able to link images using markdown when I am already providing an image uploader feature on my site. I don't want my text to change colors when the user discovers backticks (also I don't want the user to wonder where his backticks went). The only thing I want is the user to be able to make his text bold italic and
strikethrough.What I have tried
I've dug through #420 and the related tickets and have found a few things that looked like they might work. They didn't:
![Why do developers never include their Discord or have open DMs on Twitter?](discord.png)
turned intoWhy do developers never include their Discord or have open DMs on Twitter?
This almost isn't stupid but it still is stupid, because the user will look at this and wonder "Where have all my special characters gone"?
If there is a way to achieve what I am looking for, please enlighten me. I have done my research, even using AI, and couldn't find the solution to my issue. IMO, this should be something you can configure in the MarkedOptions.
I would greatly appreciate a TypeScript approach to my issue, by the way.
The text was updated successfully, but these errors were encountered: