[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] patch for alt. text in image links
From: |
Christoffer S. Hansen |
Subject: |
[emacs-wiki-discuss] patch for alt. text in image links |
Date: |
Sun, 03 Jul 2005 16:34:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1 |
This patch fixes a bug in version 2.69 that didn't publish alt. text in
image
links correctly:
[[*web-link*][*image* *alt*]] => <a href="*weblink*"><img
src="*image**alt*" alt="" /></a>
What emacs-wiki should do, and this patch fixes, is the following:
[[*web-link*][*image* *alt*]] => <a href="*weblink*"><img src="*image*"
alt="*alt*" /></a>
Two changes are made:
emacs-wiki-image-regexp is changed to accept alternative text, and
the emacs-wiki-inline-image function in emacs-wiki-colors.el is altered
to work with the new image definition.
Note, however, that the patch will not work if there are whitespaces in
image
filenames.
I hope this is useful. Comments are welcome
Regards,
Christoffer S. Hansen
Here it is:
diff -Naur emacs-wiki/emacs-wiki-colors.el
emacs-wiki-new/emacs-wiki-colors.el
--- emacs-wiki/emacs-wiki-colors.el 2005-05-05 08:40:56.000000000 +0200
+++ emacs-wiki-new/emacs-wiki-colors.el 2005-07-03 00:22:47.000000000
+0200
@@ -850,8 +850,8 @@
((string-match "\\`file:\\(.+\\)" url)
(match-string 1 url))
((string-match "/" url)
- (expand-file-name url (symbol-value
- emacs-wiki-inline-relative-to)))))
+ (car (split-string (expand-file-name url (symbol-value
+ emacs-wiki-inline-relative-to)) " ")))))
glyph)
(when (and filename
(file-readable-p filename))
diff -Naur emacs-wiki/emacs-wiki-regexps.el
emacs-wiki-new/emacs-wiki-regexps.el
--- emacs-wiki/emacs-wiki-regexps.el 2005-05-05 08:40:56.000000000 +0200
+++ emacs-wiki-new/emacs-wiki-regexps.el 2005-07-03
02:14:33.000000000 +0200
@@ -105,7 +105,7 @@
:group 'emacs-wiki-regexp)
(defcustom emacs-wiki-image-regexp
-
"\\.\\(eps\\|gif\\|jp\\(e?g\\)\\|p\\(bm\\|ng\\)\\|tiff\\|x\\([bp]m\\)\\)\\'"
+
"\\.\\(eps\\|gif\\|jp\\(e?g\\)\\|p\\(bm\\|ng\\)\\|tiff\\|x\\([bp]m\\)\\)\\.*"
"A link matching this regexp will be published inline as an image.
Remember that it must be matched as a link first - so use either
[[CamelCaps]] or include a leading slash - [[./text]].
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [emacs-wiki-discuss] patch for alt. text in image links,
Christoffer S. Hansen <=