From c941b465ad32e6ebf2074b1967d95c5c55a36294 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Tue, 26 Sep 2023 19:28:28 +0700 Subject: [PATCH] ci(danger): Ignore escaping backslash in Release notes --- .gitlab/dangerjs/mrDescriptionReleaseNotes.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab/dangerjs/mrDescriptionReleaseNotes.js b/.gitlab/dangerjs/mrDescriptionReleaseNotes.js index f9ea40341f..88ead239cd 100644 --- a/.gitlab/dangerjs/mrDescriptionReleaseNotes.js +++ b/.gitlab/dangerjs/mrDescriptionReleaseNotes.js @@ -74,6 +74,10 @@ function check_entry(entry) { return [entry_str, `${indent}- \`No release notes\` comment shouldn't start with bullet.`].join('\n'); } + // Remove a leading escaping backslash of the special characters, https://www.markdownguide.org/basic-syntax/#characters-you-can-escape + const escapeCharRegex = /\\([\\`*_{}[\]<>()+#-.!|])/g; + entry = entry.replace(escapeCharRegex, '$1'); + const regex = /^(\s*)[-*+]\s+\[([^\]]+)\]\s+(.*)$/; const match = regex.exec(entry); if (!match) {