Edgewall Software

Opened 16 years ago

Closed 16 years ago

#3842 closed defect (fixed)

attachment: links embedded in headings don't work

Reported by: michael.warres@… Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: wiki system Version: 0.10
Severity: minor Keywords: context
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:


Embedding an attachment: link in a heading, such as:

= attachment:foo.txt =
= [attachment:foo.txt foo] =

results in a link back to the root wiki page, rather than to the attachment. Also, the color of the link text is gray (perhaps reflecting that it's broken?)

Attachments (0)

Change History (3)

comment:1 by Christian Boos, 16 years ago

Milestone: 0.11
Owner: changed from Jonas Borgström to Christian Boos
Severity: normalminor

This is another symptom of a known issue. The wiki formatter doesn't yet propagate the "context" to sub-formatters (in this specific example, the OutlineFormatter).

I think I'll get to fix that in the next release.

comment:2 by anonymous, 16 years ago

When the page has attachment and WikiInclude the page, results in a link back to the root wiki page, rather than to the attachment.

version 0.9 branches/0.9-stable/trac/attachment.py#2724

468 	            attachment = Attachment(self.env, parent_type, parent_id, filename)
469 	            return '<a class="attachment" title="Attachment %s" href="%s">%s</a>' \
470 	                   % (util.escape(attachment.title),
471 	                      util.escape(attachment.href() + params),
472 	                      util.escape(label))

version 0.10 branches/0.10-stable/trac/attachment.py#4383

617 	            attachment = Attachment(self.env, parent_type, parent_id, filename)
618 	            if formatter.req:
619 	                href = attachment.href(formatter.req) + params
620 	            return html.A(label, class_='attachment', href=href,
621 	                          title='Attachment %s' % attachment.title)

at line 618 if statement goes false, and it would not convert to the attachment.

comment:3 by Christian Boos, 16 years ago

Keywords: context added
Resolution: fixed
Status: newclosed

Fixed in r4451.

The WikiInclude plugin for 0.11 should probably be rewritten to take advantage of WikiContexts.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.