bugemacs-wiki, planner, and related modules - Bugs: bug #13741, Figure out a clean way to enable...

 
 

bug #13741: Figure out a clean way to enable this image alt behavior.

Submitted by:  Michael W. Olson <mwolson>
Submitted on:  Mon 11 Jul 2005 11:15:14 PM UTC  
 
Category: emacs-wikiSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 26 Jul 2005 01:24:58 AM UTC, comment #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="imagealt" 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>


Sorry about the delay. The patch you provided looks pretty good, except I would prefer not to modify emacs-wiki-image-regexp. Would you be willing to revise the patch so that I can use it in a future emacs-wiki release?

Michael W. Olson <mwolson>
Project Administrator
Mon 11 Jul 2005 11:15:14 PM UTC, original submission:

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="imagealt" 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]].

Michael W. Olson <mwolson>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Tue 26 Jul 2005 01:24:58 AM UTCmwolsonCarbon-Copy-=>Added "christoffers.hansen"

Back to the top


Powered by Savane 3.1-cleanup