emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniel Radetsky <dradetsky@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Adding a class to the auto-inserted <br> elements
Date: Sun, 1 Sep 2024 15:23:44 -0700	[thread overview]
Message-ID: <CABLa6CR2kbN0E2KD97dpr45fyTktLvV6GdWMWQL+bWxi4V9j+A@mail.gmail.com> (raw)
In-Reply-To: <87seujpc7p.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 3211 bytes --]

> But there is nothing wrong on Org side per se, right?

I don't think so. The fact that ox-html inserts a <br> there with no way
for me as the user to disable this, in my view, bad. It's not a totally
unreasonable default, but it shouldn't be required.

> The fact that some specific suggestion...

This is an example of "motivation"; a specific concrete use-case that
actually came for the user to demonstrate that the issue is not merely
theoretical.

> What would be the benefit of doing this beyond fixing your personal use
case?

Other users might also have the same use case. Either the specific thing
I'm trying to do, or just a need to generate <li> elements from headlines
without auto-inserting <br> elements for any other purpose.

> Also, you can always use p > a CSS selector. What's wrong with that?

As a user, I would like to be able to apply a css selector to the elements
in question

0. With extremely high confidence that I am selecting _only_ the specific
<br> elements which org is auto-inserting in this case

1. Without having to do much understanding of the way org generates html
exports, or much thinking in general.

It did turn out that in the case of my specific document (which was pretty
simple), the selector `ul.org-ul li br` did in fact select only those
elements. But was this guaranteed? Even for arbitrarily complex documents?
Maybe, but proving this requires way more thinking than makes sense to me.
Much easier to just tag those elements with a class. Especially since we
already add classes like `.org-ul`.


On Sun, Sep 1, 2024 at 9:30 AM Ihor Radchenko <yantar92@posteo.net> wrote:

> Daniel Radetsky <dradetsky@gmail.com> writes:
>
> > So I was exporting an Org doc to html the other day, and I was trying to
> > follow this guide to make the list elements appear as a comma-separated
> list
> >
> > https://markheath.net/post/css-comma-separated-list
> >
> > It didn't work, and I discovered this was because Org adds a <br> element
> > to the <li> element if the <li> element is created from an Org headline
> > element.
>
> But there is nothing wrong on Org side per se, right? The fact that some
> specific suggestion from the internet did not work for a specific
> HTML that happened to be created by Org mode, does not mean that we need
> to fix Org mode. Unless the change you suggest may benefit many Org
> users, of course.
>
> > ... The easiest way to fix this and allow the aforementioned guide to
> > work is by ensuring that all those <br> elements have `display: none` set
> > via CSS. To make this easier and/or reduce the risk of accidentally
> > removing other elements, we can add a class name to those <br>'s the way
> we
> > do to other elements.
>
> What would be the benefit of doing this beyond fixing your personal use
> case?
> For other Org users.
>
> Also, you can always use p > a CSS selector. What's wrong with that?
>
> --
> 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>
>

[-- Attachment #2: Type: text/html, Size: 6691 bytes --]

  reply	other threads:[~2024-09-01 22:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-25 23:23 Adding a class to the auto-inserted <br> elements Daniel Radetsky
2024-09-01 16:31 ` Ihor Radchenko
2024-09-01 22:23   ` Daniel Radetsky [this message]
2024-09-02  2:20     ` Suhail Singh
2024-09-09 17:13     ` [POLL] Mark all the tags in HTML export with unique class (was: Adding a class to the auto-inserted <br> elements) Ihor Radchenko
2024-11-09 14:31       ` Ihor Radchenko
2024-09-09 17:16     ` Adding a class to the auto-inserted <br> elements Ihor Radchenko

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=CABLa6CR2kbN0E2KD97dpr45fyTktLvV6GdWMWQL+bWxi4V9j+A@mail.gmail.com \
    --to=dradetsky@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).