feat(parser): timestamp parsing
This commit is contained in:
parent
1f52e75d3d
commit
1bb5286dd3
12 changed files with 887 additions and 1023 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use crate::elements::{fn_def, keyword, Key};
|
||||
use crate::headline::Headline;
|
||||
use crate::headline::{Headline, DEFAULT_KEYWORDS};
|
||||
use memchr::memchr;
|
||||
|
||||
type Headlines<'a> = Vec<Headline<'a>>;
|
||||
|
|
@ -15,7 +15,7 @@ pub fn metadata(src: &str) -> (Headlines<'_>, Keywords<'_>, Footnotes<'_>) {
|
|||
if line.starts_with('*') {
|
||||
let level = memchr(b' ', line.as_bytes()).unwrap_or_else(|| line.len());
|
||||
if line.as_bytes()[0..level].iter().all(|&c| c == b'*') {
|
||||
headlines.push(Headline::parse(line).0)
|
||||
headlines.push(Headline::parse(line, DEFAULT_KEYWORDS).0)
|
||||
}
|
||||
} else if line.starts_with("#+") {
|
||||
if let Some((key, value, _)) = keyword::parse(line) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue