emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] A commented line breaks line numbering [9.6-pre (release_9.5.5


From: Ihor Radchenko
Subject: Re: [BUG] A commented line breaks line numbering [9.6-pre (release_9.5.5-1058-g6ef33b @ /home/thblt/.emacs.d/lib/org/lisp/)]
Date: Tue, 15 Nov 2022 01:51:52 +0000

Thibault Polge <thibault@thb.lt> writes:

> With org 9.6-pre, a commented out line breaks list numbering (even with
> `org-list-repair`), and effectively breaks a list in two distinct lists
> in exporters.  Eg:
>
>  1. Item 1
>  2. Item 2
>  # 3. Commented out item 3
>  1. Reset counter?
>
> At "Reset counter?", HTML export opens a new <ol> there, LaTex a new
> \begin{enumerate}
>
> This may be expected behavior --- it's present in Pandoc as well

It is by design, and it was like this forever, not just in Org 9.6.
Comments are a valid structural element in Org AST. They are just not
exported.

It also means that comments can belong to a list item:

1. Item 1
2. Item 2
   # 3. Commented out item 3
3. Reset counter?

The above does not break the list into two because the comment is
considered to be a part of the "Item 2".

> --- but
> it's surprising, since I'd expect a comment line to be fully ignored
> from the comment marker to the final \n, inclusive.  I'd thus expect the
> above example to be perfectly equivalent to:
>
>  1. Item 1
>  2. Item 2
>  3. Reset counter?  
>
> And to export as a single <ol>/enumerate.

This can be done on export, but it will then create inconsistency
between Org buffer behaviour and what you see on export.

-- 
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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]