Bug 348237 - wikitext doesn't handle image file names properly
Summary: wikitext doesn't handle image file names properly
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.5.2   Edit
Assignee: David Green CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-03 12:03 EDT by minoo ziaei CLA
Modified: 2011-08-29 20:34 EDT (History)
6 users (show)

See Also:


Attachments
screenshots for steps of producing the bug (172.71 KB, application/zip)
2011-06-03 12:03 EDT, minoo ziaei CLA
no flags Details
screenshot of the ant task (33.08 KB, image/png)
2011-06-06 15:12 EDT, minoo ziaei CLA
no flags Details
ant script to create the user-guide (3.26 KB, text/xml)
2011-06-15 12:50 EDT, minoo ziaei CLA
no flags Details
mylyn/context/zip (12.14 KB, application/octet-stream)
2011-08-29 19:42 EDT, David Green CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description minoo ziaei CLA 2011-06-03 12:03:55 EDT
Created attachment 197314 [details]
screenshots for steps of producing the bug

Here are the steps to produce this problem:
1- In screenshot1, I have created a wiki page to put my image which name is *lowercase.png*
2- Then I saved the wiki page but as you see in screenshot2, the requested image name is *Lowercase.png*.
 
2- When I click to upload my image to the wiki page, the *destination* is again as you see in screenshot3, *Lowercase.png*.

3- Even when I want to save the uploaded image to my local directory again, as you see in screenshot4, the pre-entered name in save text box is *Lowercase.png*.

4- Then I produced the user guide in Eclipse and I opened the produced html file with text editor, as you see in screenshot5, the parsed html file is *src="images/lowercase.png"*, as it is expected and as it is in wiki page source code.

5- But in screenshot6, when I open my file with browser in Eclipse, there is an empty box instead of image, and as you can see in the list of files in *images*, the image file name is being parsed as *Lowercase.png*, so since it's different than *src* in .html file, it isn't picked up in the browser.

So, I was wondering maybe it's possible to modify the name of the image files to all lowercase both in produced html files and retrieved image file names.

Also, I was facing the same problem with file names with *underscore* in them.
Wiki page, converts this underscores to white spaces (I should mention this is not the case with *dash* though).
So, maybe if we can manipulate the image file names to all lowercase without any separator, it would solve both problems.

Here is also a link to Jeff Johnston comment on the same issue: http://dev.eclipse.org/mhonarc/lists/linuxtools-dev/msg01009.html
Comment 1 David Green CLA 2011-06-06 14:45:54 EDT
Thanks for the bug.  Changing how we handle image names and arbitrarily modifying the filename has the potential to break others who are using Mylyn WikiText.  The goal is to handle image names consistently with how they're handled in the wiki.

Can you provide some more details as to how you're using Mylyn WikiText?  (are you using Ant tasks, generating Eclipse help from within the Eclipse UI?)
Comment 2 minoo ziaei CLA 2011-06-06 15:12:45 EDT
Created attachment 197447 [details]
screenshot of the ant task
Comment 3 minoo ziaei CLA 2011-06-06 15:15:21 EDT
Looks like something happened to my comment.

So, thanks for your review. 
I am using ant task from within Eclipse to produce the help. I attached a screenshot in my previous comment of my ant task.

If I need to provide more information please let me know.
Comment 4 David Green CLA 2011-06-14 14:35:49 EDT
Can you be specific about which Ant task you're using (if possible could you attach your Ant build script?)
Comment 5 minoo ziaei CLA 2011-06-15 12:50:52 EDT
Created attachment 198041 [details]
ant script to create the user-guide
Comment 6 minoo ziaei CLA 2011-06-15 12:52:35 EDT
Comment on attachment 198041 [details]
ant script to create the user-guide

Here is the script that I used to create the user-guide.
Hope it helps.
Comment 7 Steffen Pingel CLA 2011-08-26 14:45:12 EDT
*** Bug 355930 has been marked as a duplicate of this bug. ***
Comment 8 Steffen Pingel CLA 2011-08-26 14:46:52 EDT
This also affects the Mylyn FAQ (bug 355930). David, it would be great if we could fix this for Indigo SR1. Feel free to bounce to me if you don't get around to looking into it.
Comment 9 Torkild Resheim CLA 2011-08-26 15:06:51 EDT
For what it's worth I encountered the same issue at one time when setting up an automated build to obtain MediaWiki content in order to build documentation. I ended up building a special version of WikiText as I could not get around it otherwise. I cannot remember the details since it was a few years ago, but I can look into it if requested.
Comment 10 David Green CLA 2011-08-29 19:42:26 EDT
Fixed in changeset 513a7555ea6b8a8789e83e9080467f453680d638

Steffen I've successfully regenerated the Mylyn FAQ with this fix.  Let me know if you want me to push those changes.
Comment 11 David Green CLA 2011-08-29 19:42:28 EDT
Created attachment 202372 [details]
mylyn/context/zip
Comment 12 David Green CLA 2011-08-29 19:50:34 EDT
(In reply to comment #10)
> Steffen I've successfully regenerated the Mylyn FAQ with this fix.  Let me know
> if you want me to push those changes.

I just realized that I no longer have committer privileges on mylyn.tasks, so I won't be able to push anything.
Comment 13 Steffen Pingel CLA 2011-08-29 20:12:42 EDT
Thanks for the fixing this! I think it would be a good candidate for Indigo SR1. Is it feasible to the put the fix on the e_3_7_m_3_6_x maintenance branch or is too high risk?
Comment 14 David Green CLA 2011-08-29 20:34:21 EDT
No problem.  It's pretty low risk.  I've cherry-picked the commit and pushed it to e_3_7_m_3_6_x.  Please let me know if everything looks good to you and reopen if needed.