org-parser icon indicating copy to clipboard operation
org-parser copied to clipboard

Tags with underscore are not parsed correctly

Open jm-g opened this issue 1 year ago • 2 comments

According to the Org user guide, tags are defined as follows:

Tags are normal words containing letters, numbers, ‘_’, and ‘@’.

But the parser seems to handle the _ as a format annotation.

(transform (parse "* Headline :tag_a:\n")) 

;; => {:headlines
 [{:headline
   {:level 1,
    :title
    [[:text-normal "Headline :tag"]
     [:text-sub [:text-subsup-word "a"]]
     [:text-normal ":"]],
    :planning [],
    :tags []}}]}

In my opinion, the correct behavior would be

(transform (parse "* Headline :tag_a:\n")) 

;; => {:headlines
 [{:headline
   {:level 1,
    :title [[:text-normal "Headline"]],
    :planning [],
    :tags ["tag_a"]}}]}

This is with org-parser 0.1.27 with Clojure on the JVM.

jm-g avatar Apr 17 '23 15:04 jm-g