Defect #2826

trac import breaks images

Added by Daniel Svensson about 10 years ago. Updated over 6 years ago.

Status:NewStart date:2009-02-24
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution: Affected version:0.8.1


and similar should be converted to


#1 Updated by Daniel Svensson about 10 years ago

The following regexp, should be placed first in the convert_wiki_text block:

text = text.gsub(/\[\[Image\(([a-zA-Z]+\:(\d+\:)?)?([^\)^,]+)[^\)]*\)\]\]/, '!\3!')

The following test cases:

puts convert_wiki_text("[[Image(myimage1.png)]]")
puts convert_wiki_text("[[Image(wiki:myimage2.png)]]")
puts convert_wiki_text("[[Image(ticket:1:myimage3.png)]]")
puts convert_wiki_text("[[Image(myimage4.png, 120px)]]")
puts convert_wiki_text("[[Image(myimage5.png, align=right)]]")

Will then output:


I think the only supported extended Image attribute supported by Redmine is align=right, which could have been converted to:


...but it's probably pretty rare, and would make the already complex regexp almost unreadable.

#2 Updated by Daniel Felix over 6 years ago

Any news on this?
Is anyone able to reproduce this with the current trunk?

Also available in: Atom PDF