emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Manuel Giraud <manuel.giraud@univ-nantes.fr>
To: Aankhen <aankhen@gmail.com>
Cc: Bastien <bzg@altern.org>, Org-mode ml <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] * org-html.el (org-html-handle-links): add an alternate for inline images
Date: Wed, 20 Apr 2011 10:09:23 +0200	[thread overview]
Message-ID: <87y635739o.fsf@univ-nantes.fr> (raw)
In-Reply-To: <BANLkTi=d4qkOwhPMNSAqEVDUHCoU4BM6Lw@mail.gmail.com> (aankhen@gmail.com's message of "Wed, 20 Apr 2011 02:38:57 +0530")

Aankhen <aankhen@gmail.com> 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	other threads:[~2011-04-20  8:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19  8:34 [PATCH] * org-html.el (org-html-handle-links): add an alternate for inline images Manuel Giraud
2011-04-19  8:48 ` Jambunathan K
2011-04-19  9:12   ` Manuel Giraud
2011-04-19  9:22 ` [Accepted] " Bastien Guerry
2011-04-19  9:22 ` [PATCH] " Bastien
2011-04-19 21:08   ` Aankhen
2011-04-20  8:09     ` Manuel Giraud [this message]
2011-04-20  9:10       ` Aankhen
2011-04-20  9:41         ` Manuel Giraud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y635739o.fsf@univ-nantes.fr \
    --to=manuel.giraud@univ-nantes.fr \
    --cc=aankhen@gmail.com \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).