Skip to content

Commit d20fcf1

Browse files
committed
fix: update detection of changelog links
Upstream changes to the Node.js `CHANGELOG.md` no longer escape `_` characters in markdown links. Refs: nodejs/node#40645
1 parent a23a96e commit d20fcf1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/prepare_release.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,15 @@ class ReleasePreparation {
333333

334334
const major = versionComponents.major;
335335
const hrefLink = `doc/changelogs/CHANGELOG_V${major}.md`;
336-
const escapedHrefLink = hrefLink.replace(/_/g, '\\_');
337336
const newRefLink = `<a href="${hrefLink}#${newVersion}">${newVersion}</a>`;
338337
const lastRefLink = `<a href="${hrefLink}#${lastRef}">${lastRef}</a>`;
339338

340339
for (let idx = 0; idx < arr.length; idx++) {
341340
if (isLTSTransition) {
342-
if (arr[idx].includes(escapedHrefLink)) {
343-
arr[idx] = arr[idx].replace('**Current**', '**Long Term Support**');
344-
} else if (arr[idx].includes(hrefLink)) {
341+
if (arr[idx].includes(hrefLink)) {
345342
const eolDate = getEOLDate(date);
346343
const eol = eolDate.toISOString().split('-').slice(0, 2).join('-');
344+
arr[idx] = arr[idx].replace('**Current**', '**Long Term Support**');
347345
arr[idx] = arr[idx].replace('"Current"', `"LTS Until ${eol}"`);
348346
arr[idx] = arr[idx].replace('(Current)', '(LTS)');
349347
} else if (arr[idx].includes('**Long Term Support**')) {

0 commit comments

Comments
 (0)