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

Removing linkTarget option #762

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Conversation

galabra
Copy link
Contributor

@galabra galabra commented Aug 24, 2023

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

Following the discussion in #761, I removed the redundant linkTarget prop.
This functionality can still be applied using plugins, or the components prop.

@github-actions github-actions bot added the 👋 phase/new Post is being triaged automatically label Aug 24, 2023
@github-actions

This comment has been minimized.

@github-actions github-actions bot added 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Aug 24, 2023
@ChristianMurphy ChristianMurphy added 🧑 semver/major This is a change ☂️ area/types This affects typings 🗄 area/interface This affects the public interface labels Aug 24, 2023
@wooorm
Copy link
Member

wooorm commented Aug 25, 2023

Thanks for the PR!

I think this is a good idea. And I’ll be doing a major in a couple weeks. So this is 👍 in my opinion. What do you think, @remcohaszing, @ChristianMurphy?

Just jotting down for myself that I should also probably add an example to the readme to show how rehype-external-links can be used!

@remcohaszing
Copy link
Member

Yep, I agree

Copy link
Member

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

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

Seems like a good idea to me as well. 👍
It fits well with the overarching goal of better alignment of this package with the rest of the unified/remark ecosystem.

@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (0242d11) 100.00% compared to head (a739291) 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #762   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          754       733   -21     
=========================================
- Hits           754       733   -21     
Files Changed Coverage Δ
lib/ast-to-react.js 100.00% <ø> (ø)
lib/react-markdown.js 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wooorm wooorm changed the title Removing linkTarget Removing linkTarget option Sep 25, 2023
@wooorm wooorm merged commit de29396 into remarkjs:main Sep 25, 2023
7 checks passed
@wooorm wooorm added the 💪 phase/solved Post is done label Sep 25, 2023
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Sep 25, 2023
@louh
Copy link

louh commented Nov 11, 2023

Documentation should really be updated to show specifically how to migrate from linkTarget to using the rehype-external-links plugin.

I had to figure this out myself. In case anyone is coming here looking for help:

Before:

<ReactMarkdown linkTarget="_blank">
  {yourContent}
</ReactMarkdown>

After:

import rehypeExternalLinks from 'rehype-external-links'

<ReactMarkdown rehypePlugins={[[rehypeExternalLinks, { target: '_blank' }]]}>
  {yourContent}
</ReactMarkdown>

Basically rehypePlugins will accept any value that is accepted by unified.use(). The double nested array is there in case you need more than one plugin.

Hope that helps someone.

@wooorm
Copy link
Member

wooorm commented Nov 11, 2023

It’s documented https://github.com/remarkjs/react-markdown/releases/tag/9.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface ☂️ area/types This affects typings 💪 phase/solved Post is done 🧑 semver/major This is a change
Development

Successfully merging this pull request may close these issues.

6 participants