Edgewall Software

Ticket #3842 (closed defect: fixed)

Opened 2 years ago

Last modified 21 months ago

attachment: links embedded in headings don't work

Reported by: michael.warres@… Owned by: cboos
Priority: normal Milestone: 0.11
Component: wiki system Version: 0.10
Severity: minor Keywords: context
Cc:

Description

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

Change History

Changed 2 years ago by cboos

  • owner changed from jonas to cboos
  • severity changed from normal to minor
  • milestone set to 0.11

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.

Changed 22 months ago by anonymous

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.

Changed 21 months ago by cboos

  • keywords context added
  • status changed from new to closed
  • resolution set to fixed

Fixed in r4451.

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

Add/Change #3842 (attachment: links embedded in headings don't work)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.