You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
organic/org_mode_samples/element_container_priority
Tom Alexander 1a3e26c148
rustfmt Build rustfmt has succeeded Details
rust-test Build rust-test has succeeded Details
rust-build Build rust-build has succeeded Details
Update plain list greater block exit matcher priority test to match blog post.
It is still testing the same thing, but I changed the contents a bit to match what is being used in my blog post.
9 months ago
..
README.org More notes. 1 year ago
drawer_drawer.org Add the drawer first tests. 1 year ago
drawer_dynamic_block.org Add the drawer first tests. 1 year ago
drawer_footnote_definition.org Add the drawer first tests. 1 year ago
drawer_greater_block.org Add the greater block second tests. 1 year ago
drawer_paragraph.org Add more paragraph tests. 1 year ago
drawer_plain_list.org Add the drawer first tests. 1 year ago
dynamic_block_drawer.org Add the drawer second tests. 1 year ago
dynamic_block_dynamic_block.org Add the dynamic block first tests. 1 year ago
dynamic_block_footnote_definition.org Add the dynamic block first tests. 1 year ago
dynamic_block_greater_block.org Add the greater block second tests. 1 year ago
dynamic_block_paragraph.org Add more paragraph tests. 1 year ago
dynamic_block_plain_list.org Add the dynamic block first tests. 1 year ago
footnote_definition_drawer.org Add the drawer second tests. 1 year ago
footnote_definition_dynamic_block.org Add footnote definition first tests. 1 year ago
footnote_definition_greater_block.org Add the greater block second tests. 1 year ago
greater_block_drawer.org Add greater block first tests. 1 year ago
greater_block_dynamic_block.org Add greater block first tests. 1 year ago
greater_block_footnote_definition.org Add greater block first tests. 1 year ago
greater_block_greater_block.org Add greater block first tests. 1 year ago
greater_block_paragraph.org Add more paragraph tests. 1 year ago
greater_block_plain_list.org Add greater block first tests. 1 year ago
paragraph_drawer.org It looks like paragraphs inside empty drawers just capture the first new line and then the rest are trailing whitespace capture. 1 year ago
paragraph_dynamic_block.org More paragraph tests. 1 year ago
paragraph_greater_block.org You can have a block containing only whitespace which gets matched as a paragraph whose value is just a single newline. 1 year ago
plain_list_drawer.org Identify a mistake in the plain list drawer test. 1 year ago
plain_list_dynamic_block.org Add plain list first tests. 1 year ago
plain_list_greater_block.org Update plain list greater block exit matcher priority test to match blog post. 9 months ago
plain_list_plain_list.org Add plain list first tests. 1 year ago
section_drawer.org Add all the section-first tests. 1 year ago
section_dynamic_block.org Add all the section-first tests. 1 year ago
section_footnote_definition.org Add all the section-first tests. 1 year ago
section_greater_block.org Add the first test. 1 year ago
section_plain_list.org Add all the section-first tests. 1 year ago
test_case_1.org Update test case 1. 1 year ago

README.org

What are the possible element containers

Sections

Sections are divided by headlines.

  Zeroth section
  * First headline
  First section
  ** Child headline
  Child section
  * Second top-level headline
  Second top-level section

Greater blocks

  #+begin_center
  elements
  #+end_center

Drawers

  :drawername:
  elements
  :end:

Dynamic blocks

  * Headline
  #+BEGIN: clocktable :scope subtree :maxlevel 2
  #+CAPTION: Clock summary at [2023-04-16 Sun 16:13]
  | Headline     | Time   |
  |--------------+--------|
  | *Total time* | *0:00* |
  #+END:

Footnote definitions

  [fn:1] A footnote definition.

  [fn:2] A multi-line

  footnote definition.

Plain Lists

  1. foo
     1. bar
  2. baz

Which container takes priority

This test interleaves the opening and closing of each element container to see which element becomes parsed vs gets broken up. The row determines the first opening element and the column determines the second opening element.

Section Greater Block Drawer Dynamic Block Footnote Definition Plain List Paragraph
Section - Section Section Section Section Section Section
Greater Block Section First First First First First First
Drawer Section First First First First First First
Dynamic Block Section First First First First First First
Footnote Definition Section First First First - - -
Plain List Section Second Second Second - - -
Paragraph Section Second Second Second - - -

Possible solutions

Greater blocks, drawers, and dynamic blocks disable plain list exit matcher

Test Case 1

  1. foo
     #+begin_center
     2. bar


     baz
     #+end_center

Parse out headlines first

Then go through elements parsing them in-order

Should paragraph exit matcher apply to the element matcher in the exit matcher

No. But paragraph exit matcher needs to apply to the object matcher.

Maybe two groups of elements: alpha and beta

When entering an alpha element, ignore beta exit matchers above this in the context.