Browse Source

Remove empty lines from HTML output in Eleventy configuration

codecalm 7 months ago
parent
commit
e563985c3d
1 changed files with 2 additions and 0 deletions
  1. 2 0
      eleventy.config.mjs

+ 2 - 0
eleventy.config.mjs

@@ -537,6 +537,8 @@ export default function (eleventyConfig) {
 		return outputPath.endsWith('.html')
 			? content
 				.replace(/\/\/ @formatter:(on|off)\n+/gm, '')
+				// remove empty lines
+				.replace(/^\s*[\r\n]/gm, '')
 			: content
 	}