Project

General

Profile

Actions

Defect #2826

open

trac import breaks images

Defect #2826: trac import breaks images

Added by Daniel Svensson almost 18 years ago. Updated almost 14 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Importers
Target version:
-
Resolution:
Affected version:

Description

[[Image(myimage.png)]]
and similar should be converted to
!myimage.png!

Updated by Daniel Svensson almost 18 years ago Actions #1

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:

!myimage1.png!
!myimage2.png!
!myimage3.png!
!myimage4.png!
!myimage5.png!

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

!>myimage5.png!

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

Updated by Daniel Felix almost 14 years ago Actions #2

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

Actions

Also available in: PDF Atom