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.

Submitter:  Michael W. Olson <mwolson>
Submitted:  Mon 11 Jul 2005 11:15:14 PM UTC
   
 
Category:  * emacs-wiki Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

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="*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>


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

Michael W. Olson <mwolson>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2005-07-26 mwolson Carbon-Copy- Added "christoffers.hansen"<csh@freeyoursoftware.net>

Back to the top

Powered by Savane 3.13-cf05.
Corresponding source code