Last active
October 25, 2016 13:27
-
-
Save xiaokaike/9bf9b3fcf50ce32d33ec6555bd9e2f48 to your computer and use it in GitHub Desktop.
fis-remove-html-comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 去除.tpl 中的注释 | |
var removeComments = require('./fis-remove-html-comments.js'); | |
fis.config.set('modules.parser.tpl', [removeComments]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeComments(content){ | |
return content.replace(/<!--(?!\[)([\s\S]*?)(-->|$)/g, ''); | |
} | |
module.exports = removeComments; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment