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

feat: support relative path with target config. #1751

Merged
merged 11 commits into from Apr 28, 2024
Merged

Conversation

Koooooo-7
Copy link
Member

Summary

Support relative path set target config.
close #1750

What kind of change does this PR introduce?

Bugfix

For any code change,

  • Related documentation has been updated if needed
  • Related tests have been updated or tests have been added

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

Related issue, if any:

#1750

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

@vercel
Copy link

vercel bot commented Feb 14, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

docsify-preview – ./

🔍 Inspect: https://vercel.com/docsifyjs/docsify-preview/HRJhhNznrse57qin19594z9xQ1FA
✅ Preview: https://docsify-preview-git-feat-target-docsifyjs.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 14, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 628690e:

Sandbox Source
docsify-template Configuration

Copy link
Member

@jhildenbiddle jhildenbiddle left a comment

Choose a reason for hiding this comment

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

One minor stylistic question, otherwise looks good. :)

src/core/render/compiler/link.js Outdated Show resolved Hide resolved
jhildenbiddle
jhildenbiddle previously approved these changes Mar 21, 2022
Copy link
Member

@jhildenbiddle jhildenbiddle left a comment

Choose a reason for hiding this comment

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

LGTM!

remove console.
@trusktr
Copy link
Member

trusktr commented Mar 23, 2022

Why do we check if it doesn't start with mailto:? Does that break mailto links?

I'm of the opinion that we shouldn't get in the way, should not change intent. So if someone writes a mailto link with a target, just like they can in regular HTML (<a href="mailto:..." target="blank">), we should just let it be.

It in other words, it shouldn't be our goal to change DOM conventions, but only to provide the interface to it as much as we can.

@jhildenbiddle
Copy link
Member

@trusktr --

Why do we check if it doesn't start with mailto:? Does that break mailto links?

I don't know the history, but my guess is that the original contributor was unaware of the usefulness of using the target attribute on mailto: links. The target attribute is ignored when the default email client is an external app (Apple Mail, Outlook, Thunderbird, etc) but it is honored when the default email client is web-based (Gmail, iCloud, Outlook.com, etc).

I'm of the opinion that we shouldn't get in the way, should not change intent. So if someone writes a mailto link with a target, just like they can in regular HTML (<a href="mailto:..." target="blank">), we should just let it be.

Agreed, but this is a separate issue. My vote would be to review this PR for its intended purpose and create another PR to "fix" the target attribute on mailto: links.

@Koooooo-7
Copy link
Member Author

@trusktr Hi, as @jhildenbiddle said, it is the original contributor did, I wanna keep it incase of any unpredicted changes.
If we could change the mailto: issue, I agree that we can have a new one to fix that .

@vercel
Copy link

vercel bot commented Aug 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docsify-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 1:24pm

@jhildenbiddle
Copy link
Member

@Koooooo-7 --

Since this has been targeted for v5, can we update this branch and get one more review/approval? @sy-records? @trusktr?

@jhildenbiddle
Copy link
Member

👆 @sy-records

@sy-records sy-records changed the title enhancement: support relative path with target config. feat: support relative path with target config. Apr 28, 2024
@sy-records sy-records merged commit e15ad0c into develop Apr 28, 2024
9 checks passed
@sy-records sy-records deleted the feat-target branch April 28, 2024 03:08
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

Successfully merging this pull request may close these issues.

Support relativePath link set linkTarget
4 participants