Nikolaos Chatzikonstantinou <nchatz...@gmail.com> writes:

> Shouldn't the source blocks be using the <code> element?
>
> This patch is untested, I can pay more attention to it if first the
> maintainer(s) agree with my opinion. I thought the <code> tag is good
> for semantics.

Timothy, may you take a look?

For me, the patch looks reasonable, especially since <code> is used with
`org-html-klipsify-src'. Although, I'd be careful moving class property
into code - it might potentially block CSS selectors.

> From 61ff4297044beb9d62673557d311475c897f057c Mon Sep 17 00:00:00 2001
> From: Nikolaos Chatzikonstantinou <nchatz...@gmail.com>
> Date: Wed, 26 Feb 2025 03:51:36 -0500
> Subject: [PATCH] Add code element inside src-block in ox-html
>
> * lisp/org/ox-html.el (org-html-src-block): Add HTML code element inside
> pre element for Org source blocks exported to HTML.
> ---
>  lisp/org/ox-html.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el
> index e8ae3a134cb..6f5ce9269ff 100644
> --- a/lisp/org/ox-html.el
> +++ b/lisp/org/ox-html.el
> @@ -3697,7 +3697,7 @@ org-html-src-block
>                             " data-editor-type=\"html\""
>                           "")
>                         code)
> -             (format "<pre class=\"src src-%s\"%s>%s</pre>"
> +             (format "<pre class=\"src src-%s\"%s><code>%s</code></pre>"
>                          ;; Lang being nil is OK.
>                          lang label code))))))

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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