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

Avoid linkifying trailing period #49

Merged
merged 1 commit into from
Nov 9, 2024
Merged

Avoid linkifying trailing period #49

merged 1 commit into from
Nov 9, 2024

Conversation

fregante
Copy link
Collaborator

@fregante fregante commented Nov 7, 2024

@fregante fregante added the bug label Nov 7, 2024
@sindresorhus sindresorhus merged commit 34b0f76 into main Nov 9, 2024
6 checks passed
@sindresorhus sindresorhus deleted the trailing-dot-1 branch November 9, 2024 06:35
@karlhorky
Copy link
Contributor

@fregante thanks for this, nice! 🙌

Does this also handle question marks, which was part of #26?

@fregante
Copy link
Collaborator Author

No it doesn't. Fixing it would be easy though, PR welcome

let trailingDot = '';
if (href.endsWith('.')) {
href = href.slice(0, -1);
trailingDot = '.';
Copy link
Collaborator Author

@fregante fregante Nov 10, 2024

Choose a reason for hiding this comment

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

trailingDot = url.slice(-1);

Plus the condition update

@karlhorky
Copy link
Contributor

No it doesn't. Fixing it would be easy though, PR welcome

Something like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants