tools/bundle: don't emit empty line when stripping 'clang-format on|off' comment

This commit is contained in:
Bert Belder 2020-05-26 19:05:02 +02:00
parent e9fa25980b
commit 71e9ea6664
No known key found for this signature in database
GPG Key ID: 7A77887B2E2ED461

View File

@ -156,7 +156,7 @@ restart: for (let lno = 0; lno < source.length; ) {
} }
source = source source = source
.map(line => line.replace(/\/\* clang-format (on|off) \*\//g, '')) .filter(line => !/^\s*\/\* clang-format (on|off) \*\/\s*$/.test(line))
.map(line => line.replace(/\s+$/, '')) .map(line => line.replace(/\s+$/, ''))
.join('\n') .join('\n')
.replace(/\n{3,}/g, '\n\n') .replace(/\n{3,}/g, '\n\n')