From 71e9ea666498b84c9cdea4041d7ad4102cc4821c Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Tue, 26 May 2020 19:05:02 +0200 Subject: [PATCH] tools/bundle: don't emit empty line when stripping 'clang-format on|off' comment --- tools/bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bundle.js b/tools/bundle.js index 25e577b..8d4afec 100644 --- a/tools/bundle.js +++ b/tools/bundle.js @@ -156,7 +156,7 @@ restart: for (let lno = 0; lno < source.length; ) { } 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+$/, '')) .join('\n') .replace(/\n{3,}/g, '\n\n')