1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00

Add section comments and format HTML for improved readability (#2158)

This commit is contained in:
Paweł Kuna
2025-02-13 22:41:46 +01:00
committed by GitHub
parent 846c48d140
commit eff95dc033
18 changed files with 85 additions and 115 deletions

View File

@@ -590,14 +590,16 @@ export default function (eleventyConfig) {
/**
* Transforms
*/
function prettifyHTML(content, outputPath) {
return outputPath.endsWith('.html')
? content
.replace(/\/\/ @formatter:(on|off)\n+/gm, '')
// remove empty lines
.replace(/^\s*[\r\n]/gm, '')
: content
}
if (environment !== "development") {
function prettifyHTML(content, outputPath) {
return outputPath.endsWith('.html')
? content
.replace(/\/\/ @formatter:(on|off)\n+/gm, '')
// remove empty lines
.replace(/^\s*[\r\n]/gm, '')
: content
}
eleventyConfig.addTransform('htmlformat', prettifyHTML)
eleventyConfig.addTransform('htmlformat', prettifyHTML)
}
};