minify-html 0.3.7

Fast and smart HTML + JS minifier
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use aho_corasick::AhoCorasick;
use lazy_static::lazy_static;
use crate::err::ProcessingResult;
use crate::proc::MatchAction::*;
use crate::proc::MatchMode::*;
use crate::proc::Processor;

lazy_static! {
    static ref INSTRUCTION_END: AhoCorasick = AhoCorasick::new(&["?>"]);
}

#[inline(always)]
pub fn process_instruction(proc: &mut Processor) -> ProcessingResult<()> {
    proc.m(IsSeq(b"<?"), Keep).expect();
    proc.m(ThroughSeq(&INSTRUCTION_END), Keep).require("instruction end")?;
    Ok(())
}