Opened 10 years ago
Closed 10 years ago
#12025 closed enhancement (fixed)
Image macro should support InterMapTxt
Reported by: | anonymous | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.5 |
Component: | wiki system | Version: | |
Severity: | normal | Keywords: | interwiki imagemacro |
Cc: | Branch: | ||
Release Notes: |
|
||
API Changes: | |||
Internal Changes: |
Description
The image macro does not seem to support InterMapTxt prefixes. This would allow to easily extend the image macro with new capabilities e.g. for frequently linked badges, build status icons etc.)
Attachments (0)
Change History (17)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Keywords: | interwiki added; intermaptxt removed |
---|
comment:4 by , 10 years ago
comment:6 by , 10 years ago
-
trac/wiki/macros.py
diff -r aebe73fe2b02 trac/wiki/macros.py
a b 38 38 from trac.wiki.formatter import ( 39 39 format_to_html, format_to_oneliner, extract_link, OutlineFormatter 40 40 ) 41 from trac.wiki.interwiki import InterWikiMap 41 42 42 43 43 44 # TODO: should be moved in .api … … 632 633 attachment = Resource(realm, id).child('attachment', filename) 633 634 elif len(parts) == 2: 634 635 realm, filename = parts 636 interwikimap = InterWikiMap(self.env) 635 637 if realm in browser_links: # source:path 636 638 # TODO: use context here as well 637 639 rev = None … … 641 643 raw_url = formatter.href.browser(filename, rev=rev, 642 644 format='raw') 643 645 desc = filespec 646 elif realm in interwikimap: 647 url, desc = interwikimap.url(realm, filename) 648 raw_url = url 644 649 else: # #ticket:attachment or WikiPage:attachment 645 650 # FIXME: do something generic about shorthand forms... 646 651 realm = None
comment:7 by , 10 years ago
Milestone: | unscheduled → 1.1.5 |
---|---|
Owner: | set to |
Status: | new → assigned |
Tests and documentation update were also needed. Proposed changes in log:rjollos.git:t12025.
comment:8 by , 10 years ago
Keywords: | imagemacro added |
---|
comment:9 by , 10 years ago
Release Notes: | modified (diff) |
---|
comment:10 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to trunk in [13988].
follow-up: 12 comment:11 by , 10 years ago
I think we should respect [wiki] safe_schemes
option when using InterMapTxt
.
follow-up: 13 comment:12 by , 10 years ago
Replying to jomae:
I think we should respect
[wiki] safe_schemes
option when usingInterMapTxt
.
That sounds good, but is that a change needed in ImageMacro
or InterWikiMap
? If the change is in InterWikiMap
, we should create a new ticket.
comment:13 by , 10 years ago
Replying to rjollos:
That sounds good, but is that a change needed in
ImageMacro
orInterWikiMap
? If the change is inInterWikiMap
, we should create a new ticket.
I've created #12053.
I noticed InterWiki allows multiple parameters. However, image macro cannot accept interwiki with multiple parameters for image. Also, the link parameter allows interwiki link with multiple parameters like this.
[[Image(/chrome/common/trac_logo_mini.png, link=gmessage:trac-users:183g75yH65w/YgJ-q8AREpwJ)]]
comment:14 by , 10 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:15 by , 10 years ago
Proposed changes in [b12d7d12c/jomae.git] to support interwiki link with multiple parameters in image macro.
comment:17 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Thanks for the reviewing. Committed in [14047].
As a workaround a custom plugin can be written: