From 49afcf0db642f7c25f101ecae344b695a3e0b921 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 6 Sep 2023 18:41:02 -0400 Subject: [PATCH] Support property nodes with colons in their key. --- .../greater_element/property_drawer/key_with_colon.org | 6 ++++++ src/parser/property_drawer.rs | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 org_mode_samples/greater_element/property_drawer/key_with_colon.org diff --git a/org_mode_samples/greater_element/property_drawer/key_with_colon.org b/org_mode_samples/greater_element/property_drawer/key_with_colon.org new file mode 100644 index 00000000..190204d1 --- /dev/null +++ b/org_mode_samples/greater_element/property_drawer/key_with_colon.org @@ -0,0 +1,6 @@ +* Overwrite + :PROPERTIES: + :header-args: :var foo="lorem" + :header-args:emacs-lisp: :var bar="ipsum" + :header-args:emacs-lisp+: :results silent :var baz=7 + :END: diff --git a/src/parser/property_drawer.rs b/src/parser/property_drawer.rs index ca0938fe..f560130a 100644 --- a/src/parser/property_drawer.rs +++ b/src/parser/property_drawer.rs @@ -169,5 +169,8 @@ fn node_property_name_end<'b, 'g, 'r, 's>( _context: RefContext<'b, 'g, 'r, 's>, input: OrgSource<'s>, ) -> Res, OrgSource<'s>> { - alt((tag("+:"), tag(":")))(input) + recognize(tuple(( + alt((tag("+:"), tag(":"))), + alt((space1, line_ending, eof)), + )))(input) }