Browse Source

Remove empty lines from HTML output in Eleventy configuration

codecalm 7 tháng trước cách đây
mục cha
commit
e563985c3d
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  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
 	}