Modify

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#11472 closed enhancement (fixed)

tag2link plugin support of image=*

Reported by: Klumbumbus Owned by: Don-vip
Priority: normal Milestone:
Component: Core tag2link Version:
Keywords: Cc:

Description

It would be nice if urls which are in the image tag are supported.

Example: https://www.openstreetmap.org/node/2904501132

Attachments (0)

Change History (12)

comment:1 by Klumbumbus, 9 years ago

fixed in [o31825]

...atleast I hope it is fixed, I will test my regexp tomorrow :)

comment:2 by Klumbumbus, 9 years ago

Resolution: fixed
Status: newclosed

comment:3 by Klumbumbus, 9 years ago

Resolution: fixed
Status: closedreopened

I think I need to commit also the compiled jar file. I need some time to figure this out...

comment:4 by simon04, 9 years ago

Resolution: fixed
Status: reopenedclosed

Re-compiled in [o31868].

Here's what I did:

$ cd plugins/tag2link
$ ant clean dist
$ svn ci

See DevelopersGuide/DevelopingPlugins for detailed instructions.

comment:5 by Klumbumbus, 9 years ago

It is still version 31867 in Plugins. Did you maybe accidently compile the old version?


I was fighting hard with jdk and eclipse yesterday. When I finally managed to compile this plugin it failed with 83 errors and 1 warning...

So I decided to try this again later ;)

comment:6 by simon04, 9 years ago

It is (almost) correct: It states the version when the plugin was last changed. This is somehow covered in wiki:DevelopersGuide/DevelopingPlugins#UpdatingaplugininSVN

In fact it should report 31825 and not 31867. This is due to a bug in [o30161], and fixed now in [o31886].

Building a plugin might be easier using Ant directly since setting up all the paths and dependencies for JOSM in IDEs such as Eclipse is a challenging part …

comment:7 by Klumbumbus, 9 years ago

Resolution: fixed
Status: closedreopened

comment:8 by simon04, 9 years ago

Resolution: fixed
Status: reopenedclosed

[o31902:31903].

The tag is matched against v, thus the pattern must cover the whole string, see https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#matches%28java.lang.String%29.

comment:9 by Klumbumbus, 9 years ago

Thanks for fixing! Could you please also compile and upload #11571? Would be great.

comment:10 by Klumbumbus, 9 years ago

Resolution: fixed
Status: closedreopened

The approach with File: does not work correct, because whitespaces are replaced by pluses in the URL. See e.g. http://www.openstreetmap.org/way/367011285

comment:11 by simon04, 9 years ago

Resolution: fixed
Status: reopenedclosed

This is hard work ;) – I extended the hack:

  • plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkRuleChecker.java

    diff --git a/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkRuleChecker.java b/plugins/tag2link/src/org/openst
    index 109c1bc..1fe68dc 100644
    a b public class Tag2LinkRuleChecker implements Tag2LinkConstants {  
    109109            if (val != null) {
    110110                try {
    111111                    // Special hack for Wikipedia that prevents spaces being replaced by "+" characters, but by "_"
    112                     if (s.contains("wikipedia.")) {
     112                    if (s.contains("wikipedia.") || s.contains("commons.wikimedia.org")) {
    113113                        val = val.replaceAll(" ", "_");
    114114                    }
    115115                    // Encode param to be included in the URL, except if it is the URL itself !

Fixed in [o31910:31911].

comment:12 by Klumbumbus, 9 years ago

Thanks :)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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