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

remark-deflist: remark-attr not working on links in definition term #12

Open
brandonweiss opened this issue Jan 8, 2021 · 1 comment

Comments

@brandonweiss
Copy link

brandonweiss commented Jan 8, 2021

I’m using MDX and I added remark-deflist as a plugin so I could so something like this:

term

: description and here is a <ExternalLink href="http://somewhere.com">link</ExternalLink>

I assumed that would work but it seems to throw an error. I don’t totally understand why, but MDX is new-ish and has some quirks so when I hit one I usually work around it.

Next I tried remark-attr and did something like this.

term

: description and here is a [link](https://somewhere.com){ target="_blank" rel="noopener noreferrer" }.

This didn’t work either which seemed a bit more surprising. I thought maybe it was a plugin ordering thing, like remark-deflist had to be before remark-attr but that didn't seem to make a difference.

I’m a bit new to remark so I’m not sure whether this should work or not, but it seems like it should?

@simpixelated
Copy link

I think the issue might be here: https://github.com/Symbitic/remark-plugins/blob/master/packages/remark-deflist/src/index.js#L44 where it's using mdast-util-from-markdown, which by default only parses Markdown. However it accepts an options array of extensions, so I think for our use case, would need to include mdast-util-mdx-jsx.

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

No branches or pull requests

2 participants