From 4e5b52fbd3c9b5aa86827e05f0af58ad98f2b569 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Thu, 20 Aug 2020 15:01:19 +0800 Subject: [PATCH] (fix) strip todo, priority, and tags from headline candidates (#1052) Fixes #1047 --- org-roam.el | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/org-roam.el b/org-roam.el index a4895b0..be52d53 100644 --- a/org-roam.el +++ b/org-roam.el @@ -1203,8 +1203,6 @@ If USE-STACK, include the parent paths as well." (or (find-buffer-visiting file) (find-file-noselect file))) (current-buffer))) - (bol-regex (concat "^\\(?:" outline-regexp "\\)")) - (outline-title-fn (lambda () (buffer-substring-no-properties (point) (line-end-position)))) (outline-level-fn outline-level) (path-separator "/") (stack-level 0) @@ -1212,11 +1210,9 @@ If USE-STACK, include the parent paths as well." (with-current-buffer buf (save-excursion (goto-char (point-min)) - (while (re-search-forward bol-regex nil t) + (while (re-search-forward org-complex-heading-regexp nil t) (save-excursion - (setq name (or (save-match-data - (funcall outline-title-fn)) - "")) + (setq name (substring-no-properties (or (match-string 4) ""))) (setq marker (point-marker)) (when use-stack (goto-char (match-beginning 0))