From 04fec98ffd017abb89a3c96a025a294a177390cd Mon Sep 17 00:00:00 2001 From: Perry Kundert Date: Mon, 16 Nov 2020 12:37:37 -0800 Subject: [PATCH 1/2] Make ORG-mode drawer ":end:" case-insensitivie --- org/drawer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org/drawer.go b/org/drawer.go index eee590d..5576302 100644 --- a/org/drawer.go +++ b/org/drawer.go @@ -15,7 +15,7 @@ type PropertyDrawer struct { } var beginDrawerRegexp = regexp.MustCompile(`^(\s*):(\S+):\s*$`) -var endDrawerRegexp = regexp.MustCompile(`^(\s*):END:\s*$`) +var endDrawerRegexp = regexp.MustCompile(`(?i)^(\s*):END:\s*$`) var propertyRegexp = regexp.MustCompile(`^(\s*):(\S+):(\s+(.*)$|$)`) func lexDrawer(line string) (token, bool) { From 4cf9dff01056865ad5b370a97e16f3c0b0b1c954 Mon Sep 17 00:00:00 2001 From: Perry Kundert Date: Fri, 20 Nov 2020 11:41:24 -0800 Subject: [PATCH 2/2] Add a lower-case org-mode drawer :end: test --- org/testdata/headlines.org | 2 +- org/testdata/misc.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org/testdata/headlines.org b/org/testdata/headlines.org index 17c08e3..ee02735 100644 --- a/org/testdata/headlines.org +++ b/org/testdata/headlines.org @@ -18,7 +18,7 @@ we can link to headlines that define a custom_id: [[#this-will-be-the-id-of-the- Still outside the drawer :DRAWERNAME: This is inside the drawer -:END: +:end: Still outside the drawer * CUSTOM headline with custom status it's possible to use =#+SETUPFILE= - in this case the setup file contains the following diff --git a/org/testdata/misc.html b/org/testdata/misc.html index 6f84275..f5cc21a 100644 --- a/org/testdata/misc.html +++ b/org/testdata/misc.html @@ -162,7 +162,7 @@ we can link to headlines that define a custom_id: [[#this-will-be-the-id-of-the- Still outside the drawer :DRAWERNAME: This is inside the drawer -:END: +:end: Still outside the drawer * CUSTOM headline with custom status it's possible to use =#+SETUPFILE= - in this case the setup file contains the following