Modify

Opened 4 years ago

Last modified 23 months ago

#6850 new defect

[PATCH] add relative url support

Reported by: Rémi Demarthe Owned by: trapanator
Priority: normal Component: BackLinksMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Hello,

This snippet permit to have the right URL link.
I wrote black_listed_pattern so that i can submit this ticket.

16a17
> from trac.resource import get_relative_url
73c74,79
<                 buf.write('black_listed_pattern' % self.env.href.wiki(row[0]))
---
>                 if row[0].find(":") >= 0 or row[0].startswith("/"):
>                     link = self.env.href.wiki(row[0])
>                 else:
>                     # Support relative paths; based on trac/wiki/formatter.py
>                     link = get_relative_url(self.env, formatter.resource(id=row[0]), formatter.href)
>                 buf.write('black_listed_pattern' % link )

Attachments (0)

Change History (1)

comment:1 Changed 23 months ago by rjollos

  • Component changed from BackLinksMenuMacro to BackLinksMacro

The functionality of BackLinksMenuMacro is being integrated into the BackLinksMacro.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.