[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org 8e8e635eba 08/10: Revert "lisp/ox-html.el:
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org 8e8e635eba 08/10: Revert "lisp/ox-html.el: Convert :alt to :aria-label attribute in svg images" |
Date: |
Mon, 3 Jun 2024 06:58:37 -0400 (EDT) |
branch: externals-release/org
commit 8e8e635ebab8569f657a36b92198f354bbe98ead
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
Revert "lisp/ox-html.el: Convert :alt to :aria-label attribute in svg
images"
This reverts commit 0e5ac433246be43c8ac52549e543154115c30fc5.
---
lisp/ox-html.el | 65 +++++++++++++++++++++------------------------------------
1 file changed, 24 insertions(+), 41 deletions(-)
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 6b515ef342..b4ac836012 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1772,60 +1772,43 @@ SOURCE is a string specifying the location of the image.
ATTRIBUTES is a plist, as returned by
`org-export-read-attribute'. INFO is a plist used as
a communication channel."
- (let ((alt
- (if (string-match-p
- (concat "^" org-preview-latex-image-directory) source)
- (org-html-encode-plain-text
- (org-find-text-property-in-string 'org-latex-src source))
- (file-name-nondirectory source))))
- (if (string= "svg" (file-name-extension source))
- (org-html--svg-image
- source
- (org-combine-plists
- (list :alt alt) ; fallback when no :alt in attributes
- attributes)
- info)
- (org-html-close-tag
- "img"
- (org-html--make-attribute-string
- (org-combine-plists
- (list :src source :alt alt) ; fallback when no :alt in attributes
- attributes))
- info))))
+ (if (string= "svg" (file-name-extension source))
+ (org-html--svg-image source attributes info)
+ (org-html-close-tag
+ "img"
+ (org-html--make-attribute-string
+ (org-combine-plists
+ (list :src source
+ :alt (if (string-match-p
+ (concat "^" org-preview-latex-image-directory) source)
+ (org-html-encode-plain-text
+ (org-find-text-property-in-string 'org-latex-src source))
+ (file-name-nondirectory source)))
+ attributes))
+ info)))
(defun org-html--svg-image (source attributes info)
"Return \"object\" embedding svg file SOURCE with given ATTRIBUTES.
-INFO is a plist used as a communication channel. ALT is the
-alternative text to be used as a fallback when image is not suitable
-for display.
+INFO is a plist used as a communication channel.
The special attribute \"fallback\" can be used to specify a
fallback image file to use if the object embedding is not
-supported. Attribute :alt can be specified and will be transformed
-into :aria-label. CSS class \"org-svg\" is assigned as the class of
-the object unless a different class is specified with an attribute."
+supported. CSS class \"org-svg\" is assigned as the class of the
+object unless a different class is specified with an attribute."
(let ((fallback (plist-get attributes :fallback))
(attrs (org-html--make-attribute-string
(org-combine-plists
- '(:class "org-svg")
- ;; Replace :alt attribute not allowed in object tags
- ;; with :aria-label. :aria-label in attributes, if
- ;; any, takes priority.
- (when-let ((alt (plist-get attributes :alt)))
- `(:aria-label ,alt))
- attributes
;; Remove fallback attribute, which is not meant to
;; appear directly in the attributes string, and
;; provide a default class if none is set.
- '(:fallback nil)
- ;; Remove :alt attribute not allowed in object tags.
- '(:alt nil)
- `(:type "image/svg+xml" :data ,source)))))
- (format "<object %s>\n%s</object>"
+ '(:class "org-svg") attributes '(:fallback nil)))))
+ (format "<object type=\"image/svg+xml\" data=\"%s\" %s>\n%s</object>"
+ source
attrs
- (cond
- (fallback (org-html--format-image fallback attrs info))
- (t "Sorry, your browser does not support SVG.")))))
+ (if fallback
+ (org-html-close-tag
+ "img" (format "src=\"%s\" %s" fallback attrs) info)
+ "Sorry, your browser does not support SVG."))))
(defun org-html--textarea-block (element)
"Transcode ELEMENT into a textarea block.
- [elpa] externals-release/org updated (f737e7213d -> 2ee94bb065), ELPA Syncer, 2024/06/03
- [elpa] externals-release/org 9ad3360d76 04/10: etc/ORG-NEWS: Fix unintentional list markup, ELPA Syncer, 2024/06/03
- [elpa] externals-release/org 0ea4dc166c 01/10: org-html-latex-environment: Fix error when environment is non-math, ELPA Syncer, 2024/06/03
- [elpa] externals-release/org 671ca44df0 05/10: test-org-clock: Fix typo in test name, ELPA Syncer, 2024/06/03
- [elpa] externals-release/org 0477df8aab 06/10: org-setup-yank-dnd-handlers: Support MacOS dnd URIs, ELPA Syncer, 2024/06/03
- [elpa] externals-release/org 5f050580d8 07/10: lisp/org.el (org--dnd-attach-file): Load org-attach, ELPA Syncer, 2024/06/03
- [elpa] externals-release/org 8e8e635eba 08/10: Revert "lisp/ox-html.el: Convert :alt to :aria-label attribute in svg images",
ELPA Syncer <=
- [elpa] externals-release/org 2ee94bb065 10/10: Reapply "lisp/ox-html.el: Restore org-svg class.", ELPA Syncer, 2024/06/03
- [elpa] externals-release/org 88dd2cea35 03/10: Update version number for the 9.7.2 release, ELPA Syncer, 2024/06/03
- [elpa] externals-release/org 5b8159228a 02/10: etc/ORG-NEWS: Move user-facing changes near the top, ELPA Syncer, 2024/06/03
- [elpa] externals-release/org 77e77f051c 09/10: Reapply "ox-html: Use <img> tags for svgs, not <object>", ELPA Syncer, 2024/06/03