File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ public class OrgPatterns {
4141 public static final Pattern HEAD_PRIORITY_P = Pattern .compile ("^\\ s*\\ [#([A-Z])](.*)" );
4242 public static final Pattern HEAD_TAGS_P = Pattern .compile ("^(.*)\\ s+:(\\ S+):\\ s*$" );
4343
44- public static final Pattern PROPERTY = Pattern .compile ("^:([^:\\ s]+):(\\ s+.+|)$" );
44+ // org-property-re
45+ public static final Pattern PROPERTY = Pattern .compile ("^[ \\ t]*:(\\ S+):(|[ \\ t]+.*?[ \\ t]*)$" );
4546
4647 /*
4748 https://orgmode.org/manual/In_002dbuffer-settings.html
Original file line number Diff line number Diff line change @@ -169,4 +169,22 @@ public void compositeWithBreak() throws IOException {
169169 Assert .assertEquals (4 , head .getProperties ().size ());
170170 Assert .assertEquals ("c d" , head .getProperties ().get ("KEY" ));
171171 }
172+
173+ @ Test
174+ public void headerArguments () throws IOException {
175+ String fileContent =
176+ "* Test heading\n " +
177+ ":PROPERTIES:\n " +
178+ ":header-args: :cache yes\n " +
179+ ":header-args:python:: :results output\n " +
180+ ":END:" ;
181+
182+ OrgParsedFile file = parserBuilder .setInput (fileContent ).build ().parse ();
183+ OrgHead head = file .getHeadsInList ().get (0 ).getHead ();
184+
185+ Assert .assertTrue (head .hasProperties ());
186+ Assert .assertEquals (2 , head .getProperties ().size ());
187+ Assert .assertEquals (":cache yes" , head .getProperties ().get ("header-args" ));
188+ Assert .assertEquals (":results output" , head .getProperties ().get ("header-args:python:" ));
189+ }
172190}
You can’t perform that action at this time.
0 commit comments