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:
@@ -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)
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user