feat(parser): table blank lines

This commit is contained in:
PoiScript 2019-10-30 14:43:55 +08:00
parent ead6ea6289
commit b446471535
10 changed files with 151 additions and 114 deletions

View file

@ -15,7 +15,10 @@ pub struct FixedWidth<'a> {
impl FixedWidth<'_> {
pub(crate) fn parse(input: &str) -> Option<(&str, FixedWidth<'_>)> {
let (input, value) = take_lines_while(|line| line == ":" || line.starts_with(": "))(input);
let (input, value) = take_lines_while(|line| {
let line = line.trim_start();
line == ":" || line.starts_with(": ")
})(input);
let (input, blank) = blank_lines(input);
if value.is_empty() {