dprint-plugin-pug 0.1.2

A super minimal Pug formatter plugin for dprint.
Documentation
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct LexedLine {
    pub indent: usize,
    pub content: String,
    pub is_blank: bool,
}

pub fn lex(source: &str) -> Vec<LexedLine> {
    source
        .lines()
        .map(|line| {
            let indent = line.chars().take_while(|ch| *ch == ' ').count();
            LexedLine {
                indent,
                content: line[indent..].to_string(),
                is_blank: line.trim().is_empty(),
            }
        })
        .collect()
}