minify_html/minify/comment.rs
1use crate::cfg::Cfg;
2
3pub fn minify_comment(cfg: &Cfg, out: &mut Vec<u8>, code: &[u8], ended: bool) {
4 let is_ssi = code.starts_with(b"#");
5 if cfg.keep_comments || (is_ssi && cfg.keep_ssi_comments) {
6 out.extend_from_slice(b"<!--");
7 out.extend_from_slice(code);
8 if ended {
9 out.extend_from_slice(b"-->");
10 };
11 };
12}