Skip to content

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-commenter commented Sep 21, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0242d11) to head (a739291).
⚠️ Report is 77 commits behind head on main.

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     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wooorm wooorm changed the title Removing linkTarget Removing linkTarget option Sep 25, 2023
@wooorm wooorm merged commit de29396 into remarkjs:main Sep 25, 2023
@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