mirror of
https://github.com/orhun/systeroid
synced 2024-10-01 13:13:32 +00:00
refactor(parser): skip the document beginnings
This commit is contained in:
parent
8650c29273
commit
7435c1c7a6
|
@ -30,6 +30,11 @@ impl<'a> TryFrom<Pair<'a, Rule>> for Title<'a> {
|
|||
|
||||
// set the actual title
|
||||
if let Some(value) = pair.as_str().lines().next() {
|
||||
if value.chars().all(|v| v == '=') {
|
||||
return Err(ErrorImpl::ParseError(String::from(
|
||||
"document beginning found",
|
||||
)));
|
||||
}
|
||||
title.value = value;
|
||||
} else {
|
||||
return Err(ErrorImpl::ParseError(String::from("invalid title")));
|
||||
|
|
Loading…
Reference in a new issue