emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] * org-html.el (org-html-handle-links): add an alternate


From: Manuel Giraud
Subject: Re: [O] [PATCH] * org-html.el (org-html-handle-links): add an alternate for inline images
Date: Wed, 20 Apr 2011 10:09:23 +0200
User-agent: Gnus/5.1299999999999999 (Gnus v5.13) Emacs/23.3 (berkeley-unix)

Aankhen <address@hidden> writes:

> This might not be the best solution.  The purpose of the ‘alt’
> attribute is to provide a textual alternative, which the file name
> really isn’t.  It would be better to provide an empty value:
>
> ,----
> | <img src="foo.png" alt=""/>
> `----

I knew it was not the best solution: all i wanted was to validate. But
an empty alt or maybe just "image" is fine by me too.

> I took a look at ‘org-html.el’ and changed the relevant line, but it
> doesn’t seem to have any effect.

I've tested my patch only on [[big_image.png][small_image.png]] kind of
link (maybe that's why).

> @@ -1839,8 +1838,8 @@ lang=\"%s\" xml:lang=\"%s\">
>    "Create image tag with source and attributes."
>    (save-match-data
>      (if (string-match "^ltxpng/" src)
> -       (format "<img src=\"%s\" alt=\"%s\"/>"
> -                src (org-find-text-property-in-string 'org-latex-src src))
> +       (format "<img src=\"%s\" alt=\"\"/>"
> +                src)
>        (let* ((caption (org-find-text-property-in-string 'org-caption src))
>              (attr (org-find-text-property-in-string 'org-attributes src))
>              (label (org-find-text-property-in-string 'org-label src)))
> @@ -1855,7 +1854,7 @@ lang=\"%s\" xml:lang=\"%s\">
>                 src
>                 (if (string-match "\\<alt=" (or attr ""))
>                     (concat " " attr )
> -                 (concat " " attr " alt=\"" src "\"")))
> +                 (concat " " attr " alt=\"\"")))
>         (if caption
>             (format "</p>%s
>  </div>%s"

Ok, those 2 last hunk should complete my patch I guess. But what I'd
really like is a way to set a alt as a user. Maybe something like this:

   [[big_image.png][small_image.png|my picture is cool]]

What you guys think? I'll look what i can do and try to make it work for
anykind of <img> tag that can be generated.

-- 
Manuel Giraud



reply via email to

[Prev in Thread] Current Thread [Next in Thread]