Fix handling of documents containing only whitespace.
This commit is contained in:
@@ -3,6 +3,7 @@ use std::path::Path;
|
||||
use nom::combinator::all_consuming;
|
||||
use nom::combinator::opt;
|
||||
use nom::multi::many0;
|
||||
use nom::InputTake;
|
||||
|
||||
use super::headline::heading;
|
||||
use super::in_buffer_settings::apply_in_buffer_settings;
|
||||
@@ -195,9 +196,9 @@ fn _document<'b, 'g, 'r, 's>(
|
||||
zeroth_section,
|
||||
children,
|
||||
contents: if contents.len() > 0 {
|
||||
Some(Into::<&str>::into(contents))
|
||||
Into::<&str>::into(contents)
|
||||
} else {
|
||||
None
|
||||
Into::<&str>::into(remaining.take(0))
|
||||
},
|
||||
},
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user