Skip to content

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
@mattcosta7 mattcosta7 force-pushed the include-team-mention-pasting branch from 56a9980 to b06f076 Compare November 9, 2023 17:45
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.

❤️🧡💛💚💙💜🖤


// 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
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