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

team mention pasting #91

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

mattcosta7
Copy link
Member

@mattcosta7 mattcosta7 commented Nov 9, 2023

related to https://github.com/github/html_pipeline/issues/76

This pull request to the codebase includes changes to improve the handling of GitHub team mentions in the paste() function. The most important changes include adding a new test case to check that team handles are not rendered as markdown, and updating the linkify() function to check if a link is a team mention using the new isTeamMention() function.

Main interface changes:

  • src/paste-markdown-html.ts: Updated the linkify() function to check if a link is a team mention using the new isTeamMention() function, and returns the label as markdown if it is a team or user mention. [1] [2]

Testing improvements:

  • test/test.js: Added a new test case to check that team handles are not rendered as markdown in the paste() function.

@mattcosta7 mattcosta7 requested a review from a team as a code owner November 9, 2023 17:44
Copy link

@maxbeizer maxbeizer left a comment

Choose a reason for hiding this comment

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

❤️🧡💛💚💙💜🖤

@@ -123,7 +123,7 @@ function linkify(element: HTMLAnchorElement, label: string): string {
let markdown = ''

// Don't linkify user mentions like "@octocat"
if (isUserMention(element)) {
if (isUserMention(element) || isTeamMention(element)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

while here, are there other types that shouldn't become urls?

Choose a reason for hiding this comment

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

@mattcosta7 Not that I know of.

Copy link

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

@mattcosta7
Copy link
Member Author

Thanks for doing this!

no problem! I don't have write access on this one @joshblack so if you're good to merge, please do when it makes sense!

@joshblack joshblack merged commit 3132aa2 into github:main Nov 9, 2023
1 check passed
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.

3 participants