-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for top-level properties drawer #78
Comments
Open
PoiScript
added a commit
that referenced
this issue
May 9, 2024
supported in 9b8aec0: let org = Org::parse(
r#":PROPERTIES:
:key: value
:END:
"#,
);
assert_eq!(
org.document().properties().unwrap().get("key").unwrap(),
"value"
); |
sorry for the late reply. it seems to be a potential bug where the parser incorrectly interprets a keyword as a property node. it issue was fixed in commit 5bc15d8 and included in the latest release: use orgize::{ast::Document, Org};
let org = Org::parse(
r#":PROPERTIES:
:ID: 20220718T085035.042592
:END:
#+TITLE: Complete Computing"#,
);
let properties = org.document().properties().unwrap();
assert_eq!(properties.iter().count(), 1);
assert_eq!(properties.get("ID").unwrap(), "20220718T085035.042592"); |
cheers @PoiScript , i really appreciate your work on this parser! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
as of org 9.5, properties drawers are allowed before the first-level heading
org-roam uses this in the org-roam-capture template and parses the level 0 heading as if it were a regular org-roam node/org-mode heading. It would be nice if there was a
Document::properties()
which returns anOption<PropertyDrawer>
The text was updated successfully, but these errors were encountered: