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'd like to use this library to render some markdown that might have links to external pages. For those packages, it'd be good to render anchors with target="_blank" rel="noreferrer". But I can't figure out how to inject thatm.
Since this package integrates with Astro's default Markdown configuration, you can use rehype and remark plugins to add the desired attributes. rehype-external-links should work well for your use case.
That works site-wide, I don't think that's quite what I'm looking for. Setting the behavior for all links might not be desirable. Is there a way to set specific settings in one <Markdown.Inline ... /> component / markdown.inline( ... ) function call?
Hm, looking at the source code, this would require creating a fresh markdown processor for each invocation of the markdown function to be able to pass it a custom markdown config. That has performance implications (see #16), though that could be mitigated by only creating a custom processor when custom options are passed and reusing the global processor otherwise.
(I'm not a maintainer of this package, only a user, so please take this with a grain of salt)
I'd like to use this library to render some markdown that might have links to external pages. For those packages, it'd be good to render anchors with
target="_blank" rel="noreferrer"
. But I can't figure out how to inject thatm.The
options: any
from this package seem to point to https://docs.astro.build/en/reference/configuration-reference/#markdown-options... is that right?Is there a sanctioned path with
@astropub/md
to add attributes to specific tags? If not, could we make one?The text was updated successfully, but these errors were encountered: