Skip to content

Commit e305755

Browse files
committed
org-element: Parse malformed clock lines as paragraphs
* lisp/org-element.el (org-element-clock-line-re): Update the regexp matching the actual required clock line structure. (org-element--set-regexps): Use `org-element-clock-line-re'. Link: https://orgmode.org/list/87h7571bpb.fsf@localhost
1 parent 1f8cc85 commit e305755

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lisp/org-element.el

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,15 @@ Key is located in match group 1.")
126126
Style, if any, is located in match group 1.")
127127

128128
(defconst org-element-clock-line-re
129-
(rx line-start (0+ (or ?\t ?\s)) "CLOCK:")
129+
(rx line-start (0+ (or ?\t ?\s))
130+
"CLOCK: "
131+
(regexp org-ts-regexp-inactive)
132+
(opt "--"
133+
(regexp org-ts-regexp-inactive)
134+
(1+ (or ?\t ?\s)) "=>" (1+ (or ?\t ?\s))
135+
(1+ digit) ":" digit digit)
136+
(0+ (or ?\t ?\s))
137+
line-end)
130138
"Regexp matching a clock line.")
131139

132140
(defconst org-element-comment-string "COMMENT"
@@ -219,7 +227,7 @@ specially in `org-element--object-lex'.")
219227
;; LaTeX environments.
220228
"\\\\begin{\\([A-Za-z0-9*]+\\)}" "\\|"
221229
;; Clock lines.
222-
"CLOCK:" "\\|"
230+
org-element-clock-line-re "\\|"
223231
;; Lists.
224232
(let ((term (pcase org-plain-list-ordered-item-terminator
225233
(?\) ")") (?. "\\.") (_ "[.)]")))

0 commit comments

Comments
 (0)