Skip to content

Removing linkTarget option - #762

Merged
wooorm merged 1 commit into
remarkjs:mainfrom
galabra:remove-link-target
Sep 25, 2023
Merged

Removing linkTarget option#762
wooorm merged 1 commit into
remarkjs:mainfrom
galabra:remove-link-target

Conversation

@galabra

@galabragalabra commented Aug 24, 2023

Copy link
Copy Markdown
Contributor

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-actionsgithub-actionsBot added the 👋 phase/new Post is being triaged automatically label Aug 24, 2023
@github-actions

This comment has been minimized.

@github-actionsgithub-actionsBot added 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Aug 24, 2023
@ChristianMurphyChristianMurphy 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
Copy Markdown
Member

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
Copy Markdown
Member

Yep, I agree

@ChristianMurphyChristianMurphy left a comment

Copy link
Copy Markdown
Member

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

codecov-commenter commented Sep 21, 2023

Copy link
Copy Markdown

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.

@wooormwooorm changed the title Removing linkTargetRemoving linkTarget optionSep 25, 2023
@wooorm
wooorm merged commit de29396 into remarkjs:mainSep 25, 2023
@wooormwooorm added the 💪 phase/solved Post is done label Sep 25, 2023
@github-actions

This comment has been minimized.

@github-actionsgithub-actionsBot removed the 🤞 phase/open Post is being triaged manually label Sep 25, 2023
@louh

louh commented Nov 11, 2023

Copy link
Copy Markdown

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:

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

After:

importrehypeExternalLinksfrom'rehype-external-links'<ReactMarkdownrehypePlugins={[[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
Copy Markdown
Member

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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗄 area/interfaceThis affects the public interface☂️ area/typesThis affects typings💪 phase/solvedPost is done🧑 semver/majorThis is a change

Development

Successfully merging this pull request may close these issues.

6 participants

@galabra@wooorm@remcohaszing@codecov-commenter@louh@ChristianMurphy