Hi all,

My apologies for the long delay in my response. I have been tied up with
some personal matters over the past two months and was unable to follow
up on this thread until now.

A localized change within ox-html.el is the right path forward. For any
descriptive items residing within a non-descriptive plain list (such as
an unordered list), the patch manually prepends the TERM component back
onto the item contents before handing it down to the formatter.

(defun org-html-item (item contents info)
  "Transcode an ITEM element from Org to HTML.
CONTENTS holds the contents of the item.  INFO is a plist holding
contextual information."
  (let* ((plain-list (org-element-parent item))
(type (org-element-property :type plain-list))
(counter (org-element-property :counter item))
(checkbox (org-element-property :checkbox item))
(tag (let ((tag (org-element-property :tag item)))
(and tag (org-export-data tag info))))
         ;; type is not descriptive but get tag
         (ditem-in-others (and tag (not (eq type 'descriptive))))
         (contents (if (not ditem-in-others) contents
                     (concat tag " :: " contents))))
    (org-html-format-list-item
     contents type checkbox info
     (if (eq type 'descriptive) tag counter))))

In this diff patch, I have also deliberately changed the last argument passed
to `org-html-format-list-item' from (or tag counter) to an if expression:
(if (eq type 'descriptive) tag counter).

My reasoning is that under the old or logic, when a pseudo-descriptive
item appears within a non-descriptive list (like an unordered list), the
extracted TERM is passed down and inadvertently becomes the id attribute
of the <li> tag (e.g., <li id="term">). This can be quite problematic:

The TERM component may contain spaces, special characters, or rich
text markup. Directly dumping it into an id attribute inevitably
produces invalid HTML output.

However, if the maintainers strongly prefer to preserve the original,
implicit ID behavior for the sake of strict backward compatibility, I am
entirely open to reverting this specific line back to (or tag counter).

(While I believe it is somewhat absurd to handle counter syntax like
[@num] for unordered lists, it is probably best to either preserve this
compatibility for now or leave it for a separate discussion.)

To better demonstrate the effect of this patch, consider the following
examples and their exported HTML output under the old vs. new logic:

- test1
- hello :: world


- test2
- [@3] *Bold* :: foobar

Regards.

Pedro Andres Aranda Gutierrez <[email protected]> 于2026年4月7日周二 00:36写道:
>
> No worries :-)
>
> On Mon, 6 Apr 2026 at 13:58, Christian Moe <[email protected]> wrote:
>>
>> Pedro Andres Aranda Gutierrez <[email protected]> writes:
>>
>> > I was not suggesting to touch anything in ox-latex.
>>
>> That was clear. My remark was for Ihor, since I'd changed my mind from
>> my previous message in the thread. Pardon the confusion.
>>
>> Regards,
>> Christian
>
>
>
> --
> Fragen sind nicht da, um beantwortet zu werden,
> Fragen sind da um gestellt zu werden
> Georg Kreisler
>
> "Sagen's Paradeiser" (ORF: Als Radiohören gefährlich war) => write BE!
> Year 2 of the New Koprocracy
>

Attachment: p.diff
Description: Binary data

Reply via email to