[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 5cb52f379b 1/3: org-html-example-block: Combine :cl
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 5cb52f379b 1/3: org-html-example-block: Combine :class attributes using space |
Date: |
Sat, 3 Feb 2024 09:58:23 -0500 (EST) |
branch: externals/org
commit 5cb52f379b40c54c499caa259e8e2b04305d5019
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
org-html-example-block: Combine :class attributes using space
* lisp/ox-html.el (org-html-example-block): Avoid creating duplicate
class= attributes when example block has #+ATTR_HTML: :class foo.
Multiple class attributes must be combined with space, as per
https://www.w3schools.com/html/html_classes.asp
Reported-by: Joshua Honeycutt <joshua.honeycutt@gmail.com>
Link: https://orgmode.org/list/87fsfxfzex.fsf@localhost
---
lisp/ox-html.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 2588d6c7cc..976c245843 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2682,7 +2682,10 @@ information."
(let ((attributes (org-export-read-attribute :attr_html example-block)))
(if (plist-get attributes :textarea)
(org-html--textarea-block example-block)
- (format "<pre class=\"example\"%s>\n%s</pre>"
+ (if-let ((class-val (plist-get attributes :class)))
+ (setq attributes (plist-put attributes :class (concat "example "
class-val)))
+ (setq attributes (plist-put attributes :class "example")))
+ (format "<pre%s>\n%s</pre>"
(let* ((reference (org-html--reference example-block info))
(a (org-html--make-attribute-string
(if (or (not reference) (plist-member attributes :id))