From: Ihor Radchenko <yantar92@posteo.net>
To: Tom Alexander <tom@fizz.buzz>
Cc: emacs-orgmode@gnu.org
Subject: Re: Extra paragraphs incorrectly spawning when ":end:" appears.
Date: Tue, 13 Feb 2024 11:49:02 +0000 [thread overview]
Message-ID: <878r3owpn5.fsf@localhost> (raw)
In-Reply-To: <87o7hiwzma.fsf@localhost>
Ihor Radchenko <yantar92@posteo.net> writes:
> "Tom Alexander" <tom@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>
prev parent reply other threads:[~2024-02-13 11:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-30 18:47 Extra paragraphs incorrectly spawning when ":end:" appears Tom Alexander
2023-09-30 19:15 ` Tom Alexander
2023-10-01 7:50 ` Ihor Radchenko
2023-10-02 14:17 ` Tom Alexander
2024-02-13 11:49 ` Ihor Radchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878r3owpn5.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=tom@fizz.buzz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).