-
-
Notifications
You must be signed in to change notification settings - Fork 896
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
Parse only nodeTypes and output remainder unchanged #408
Comments
I have exactly the same issue... basically looking for a "renderDisallowedTypesAsText" option. |
One more request for this feature here. We basically need to use markdown only for non-block elements (links, bold, italics, I started achieving this with custom renderers for most block element types. But for cases like list items, I have no way of knowing the character used ( |
Instead of using See this comment for an example. |
Indeed. I came here to say the same thing, as a colleague in our team also found out about this and suggested it. It worked like a charm for us. |
using a remark plugin is the preferred solution, see #408 (comment) |
Is there a way of doing this in v6? The plugin doesn't seem to work anymore. |
@ChristianMurphy maybe this could be reopened since it doesn't seem to be possible with the current |
@janpe how to migrate allow types to the v6 equivalent is documented in the changelog https://github.com/remarkjs/react-markdown/blob/main/changelog.md#replace-allownode-allowedtypes-and-disallowedtypes |
But I want to achieve the same thing as this issue describes. I want to skip parsing certain nodes as markdown and just render them as paragraphs. For example I would like for |
If you want to use the exact solution described previously feel free to contribute to zestedesavoir/zmarkdown#416
Not necessarily, |
|
I'd highly recommend reading the Readme and particularly the description of the option.
It is, a few options have been outlined above. |
Sorry if I'm misunderstading something. I have read the readme and the descriptions of all the options and tried them out in code as well. That particular option seems to be doing what I just described above. If again I'm not misunderstading something.
I'm not certain about what you are referring to here. I'm not seeing any options that seem to be working and I'm not seeing a way of achieving this now that Are there ways of having custom remark plugins in my codebase and using those with Thanks again! |
There seems to be some confusion, let's back up a bit.
Hence this is marked as a
yes, what you described and what is documented match up.
Let me spell this out more explicitly.
Yes, https://unifiedjs.com/learn documents working with plugins. |
Hi! Weird request... Maybe.
I'd like to parse some text as markdown and only convert for paragraphs, leaving the remainder as is.
The text, in places, uses characters shared by markdown syntax, but I don't wish to parse them as such - just paragraphs.
allowedTypes={['text', 'paragraph']}
achieves part of this but removes other nodes that match markdown syntax.I'm unsure of exactly how plugins work and how I could use one to achieve this, if it's even possible.
I wrote a render helper to conditionally turn links into
react-router
Link components but this would require some sort of catch-all and again I'm unsure if the input would get to this point if it matched disallowed markdown syntaxThe text was updated successfully, but these errors were encountered: