Ihor Radchenko <yanta...@posteo.net> writes: > "Tom Alexander" <t...@fizz.buzz> writes: > >> This test document should have 1 paragraph but org-mode is parsing it as 2: >> ``` >> foo >> :end: >> baz >> ``` >> >> which parses as: >> ``` >> (section >> (paragraph "foo\n") >> (paragraph ":end:\nbaz\n") >> ) >> ``` > .... > The documentation is not accurate here. > > The parser uses anything that _potentially_ looks like the beginning of > another element to calculate paragraph boundaries > (`org-element-paragraph-separate'). ":end:" is potentially a drawer and > thus ends the preceding paragraph.
I was wrong. `org-element-paragraph-parser' actually does perform forward-checking. So, your example is a genuine bug in the parser. (and the relevant tests were not very accurate due to copy-pasting) Fixed, on main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=61c235b77 -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>