summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--awk/index.awk8
-rw-r--r--tests/org-fc-indexer-test.el14
2 files changed, 18 insertions, 4 deletions
diff --git a/awk/index.awk b/awk/index.awk
index 29c982c..638fb70 100644
--- a/awk/index.awk
+++ b/awk/index.awk
@@ -44,17 +44,17 @@ ENDFILE {
## File Tags
-match($0, /^#\+FILETAGS:[ \t]+(.*)/, a) {
+match($0, /^#\+(FILETAGS|filetags):[ \t]+(.*)/, a) {
# Combine tags to handle multiple FILETAGS lines
- parent_tags[0] = combine_tags(a[1], parent_tags[0]);
+ parent_tags[0] = combine_tags(a[2], parent_tags[0]);
next;
}
## File Title
-match($0, /^#\+TITLE:[ \t]+(.*)/, a) {
+match($0, /^#\+(TITLE|title):[ \t]+(.*)/, a) {
# Combine tags to handle multiple FILETAGS lines
- file_title = a[1]
+ file_title = a[2]
next;
}
diff --git a/tests/org-fc-indexer-test.el b/tests/org-fc-indexer-test.el
index adb00fe..ae75735 100644
--- a/tests/org-fc-indexer-test.el
+++ b/tests/org-fc-indexer-test.el
@@ -22,6 +22,20 @@
(equal (plist-get (car index) :id)
"33645f3a-384d-44ed-aed2-a2d56b973800"))))
+(ert-deftest org-fc-test-index-keywords ()
+ (let ((index (org-fc-awk-index-paths
+ (list (org-fc-test-fixture "index/uppercase.org")))))
+ (should (eq (length index) 1))
+ (let ((card (car index)))
+ (should (equal (plist-get card :inherited-tags) ":tag1:tag2:"))
+ (should (equal (plist-get card :filetitle) "File Title"))))
+ (let ((index (org-fc-awk-index-paths
+ (list (org-fc-test-fixture "index/lowercase.org")))))
+ (should (eq (length index) 1))
+ (let ((card (car index)))
+ (should (equal (plist-get card :inherited-tags) ":tag1:tag2:"))
+ (should (equal (plist-get card :filetitle) "File Title")))))
+
(ert-deftest org-fc-test-index ()
(let ((index (org-fc-awk-index-paths
(list