Browse Source

add support for multi-word title via Token::Quote

chaz-kiker 3 years ago
parent
commit
6333321ebe
1 changed files with 6 additions and 1 deletions
  1. 6 1
      parser/src/command/note.rs

+ 6 - 1
parser/src/command/note.rs

@@ -25,7 +25,12 @@ impl NoteCommand {
         let mut toks = input.clone();
         if let Some(Token::Word("note")) = toks.peek_token()? {
             toks.next_token()?;
-            if let Some(Token::Word(title)) = toks.next_token()? {
+            let title = match toks.next_token()? {
+                Some(Token::Word(title)) => Some(title),
+                Some(Token::Quote(multi_word_title)) => Some(multi_word_title),
+                _ => None,
+            };
+            if let Some(title) = title {
                 Ok(Some(NoteCommand::Summary {
                     title: title.to_string(),
                 }))