Skip to content

Commit

Permalink
Build: avoid creating broken rule links in the changelog (#7731)
Browse files Browse the repository at this point in the history
  • Loading branch information
not-an-aardvark authored and kaicataldo committed Dec 11, 2016
1 parent da79f17 commit 4b77333
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/blogpost.md.ejs
Expand Up @@ -10,13 +10,13 @@ tags:
We just pushed ESLint v<%- version %>, which is a <%- type %> release upgrade of ESLint. This release <% if (type !== "patch") { %>adds some new features and<% } %> fixes several bugs found in the previous release. <% if (type === "major") { %>This release also has some breaking changes, so please read the following closely. <% } %>

<%
const RULE_REGEX = new RegExp(ruleList.map(ruleName => `\`?${ruleName}\`?`).join("|"), "g");
const RULE_REGEX = new RegExp(`\`?(${ruleList.join("|")})\`?`, "g");
function linkify(line) {
return line
.replace(/#(\d+)/g, "[#$1](https://github.com/eslint/eslint/issues/$1)")
.replace(/([a-z0-9]+)/, "[$1](https://github.com/eslint/eslint/commit/$1)")
.replace(RULE_REGEX, "[$&](/docs/rules/$&)");
.replace(RULE_REGEX, "[$&](/docs/rules/$1)");
}
function outputList(items) {
Expand Down

0 comments on commit 4b77333

Please sign in to comment.