File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -629,6 +629,13 @@ function OrgFile:get_links()
629
629
return links
630
630
end
631
631
632
+ memoize (' get_directive' )
633
+ --- @param directive_name string
634
+ --- @return string | nil
635
+ function OrgFile :get_directive (directive_name )
636
+ return self :_get_directive (directive_name )
637
+ end
638
+
632
639
--- @private
633
640
--- @return string | nil
634
641
function OrgFile :_get_directive (directive_name )
Original file line number Diff line number Diff line change @@ -815,5 +815,18 @@ describe('OrgFile', function()
815
815
})
816
816
assert .are .same (' 112233' , file :get_property (' custom_id' ))
817
817
end )
818
+
819
+ it (' should get directive' , function ()
820
+ local file = load_file_sync ({
821
+ ' :PROPERTIES:' ,
822
+ ' :ID: 443355' ,
823
+ ' :CUSTOM_ID: 112233' ,
824
+ ' :END:' ,
825
+ ' #+somedirective: somevalue' ,
826
+ ' #+title: test' ,
827
+ ' * TODO Headline 1' ,
828
+ })
829
+ assert .are .same (' somevalue' , file :get_directive (' somedirective' ))
830
+ end )
818
831
end )
819
832
end )
You can’t perform that action at this time.
0 commit comments