0
0
Fork 0
mirror of https://github.com/DavidAnson/markdownlint-cli2-action.git synced 2024-12-24 05:43:33 +01:00

Freshen generated index.js file.

This commit is contained in:
David Anson 2024-08-12 22:54:36 -07:00
parent be72418f16
commit 9ebbe5279e

24
dist/index.js vendored
View file

@ -6782,17 +6782,26 @@ const REPLACERS = [
[
// (a\ ) -> (a )
// (a ) -> (a)
// (a ) -> (a)
// (a \ ) -> (a )
/\\?\s+$/,
match => match.indexOf('\\') === 0
? SPACE
: EMPTY
/((?:\\\\)*?)(\\?\s+)$/,
(_, m1, m2) => m1 + (
m2.indexOf('\\') === 0
? SPACE
: EMPTY
)
],
// replace (\ ) with ' '
// (\ ) -> ' '
// (\\ ) -> '\\ '
// (\\\ ) -> '\\ '
[
/\\\s/g,
() => SPACE
/(\\+?)\s/g,
(_, m1) => {
const {length} = m1
return m1.slice(0, length - length % 2) + SPACE
}
],
// Escape metacharacters
@ -7020,7 +7029,8 @@ const makeRegex = (pattern, ignoreCase) => {
if (!source) {
source = REPLACERS.reduce(
(prev, current) => prev.replace(current[0], current[1].bind(pattern)),
(prev, [matcher, replacer]) =>
prev.replace(matcher, replacer.bind(pattern)),
pattern
)
regexCache[pattern] = source