Org reader: allow ":" in property drawer keys

Any non-space character is allowed as property drawer key, including ":"
itself (so it is not really a delimiter). The real delimiter is a space
character, so in a drawer like

:PROPERTIES:
::k:ey:: value
:END:

":k:ey:" is a key with value "value".

This usage can be seen in the Org Manual at
https://orgmode.org/manual/Using-Header-Arguments.html,
where the Org snippet

* Heading
  :PROPERTIES:
  :header-args:clojure:    :session *clojure-1*
  :header-args:R:          :session *R*
  :END:

is listed as an example.
This commit is contained in:
Lucas V. R 2022-02-03 01:06:10 -03:00 committed by Albert Krewinkel
parent 876859f9e9
commit 61f4771c55

View file

@ -405,7 +405,8 @@ propertiesDrawer = try $ do
key :: Monad m => OrgParser m PropertyKey
key = fmap toPropertyKey . try $
skipSpaces *> char ':' *> many1TillChar nonspaceChar (char ':')
skipSpaces *> char ':' *>
many1TillChar nonspaceChar (try $ char ':' *> spaceChar)
value :: Monad m => OrgParser m PropertyValue
value = fmap toPropertyValue . try $