Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Remove Lines That Start With A Token In Rust

TODO: Write this up from the org mode to noepolitan processor.

Code

pub fn body(source: &str) -> IResult<&str, &str> {
    let (source, lines) = many_till(
        alt((
            preceded(
                many0(tuple((tag("#+"), not_line_ending, line_ending))),
                terminated(not_line_ending, line_ending),
            ),
            multispace1.map(|x| "\n"),
            not_line_ending,
            line_ending,
        )),
        eof,
    )(source)?;

    ///// etc...
}