Skip to content

Commit

Permalink
fix: escape github usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jul 7, 2023
1 parent 5dbc401 commit a961cf7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.js
Expand Up @@ -60,11 +60,15 @@ function toMarkdown(changelogsByComponent) {
.map(([component, changelogs]) => {
return `### ${component}
- ${changelogs.join("\n- ")}`;
- ${changelogs.map(escapeGitHubUsername).join("\n- ")}`;
})
.join("\n\n");
}

function escapeGitHubUsername(string) {
return string.replace(/@([\w-]+)/g, "[@$1](https://github.com/$1)");
}

function yamlEscape(string) {
return string.replace(/"/g, '""');
}

0 comments on commit a961cf7

Please sign in to comment.