From 4b773336fa2ab9fa4b910f999d5fa37f0c222ca0 Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Sun, 11 Dec 2016 18:57:27 -0500 Subject: [PATCH] Build: avoid creating broken rule links in the changelog (#7731) --- templates/blogpost.md.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/blogpost.md.ejs b/templates/blogpost.md.ejs index c2e3d9662a5..ddf9cb79579 100644 --- a/templates/blogpost.md.ejs +++ b/templates/blogpost.md.ejs @@ -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) {