Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11472 closed enhancement (fixed)

tag2link plugin support of image=*

Reported by: Klumbumbus Owned by: Don-vip
Priority: normal Milestone:
Component: Plugin 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 Changed 4 years ago by Klumbumbus

fixed in [o31825]

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

comment:2 Changed 4 years ago by Klumbumbus

Resolution: fixed
Status: newclosed

comment:3 Changed 4 years ago by Klumbumbus

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 Changed 4 years ago by simon04

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 Changed 4 years ago by Klumbumbus

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 Changed 4 years ago by simon04

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 Changed 4 years ago by Klumbumbus

Resolution: fixed
Status: closedreopened

comment:8 Changed 4 years ago by simon04

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 Changed 4 years ago by Klumbumbus

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

comment:10 Changed 4 years ago by Klumbumbus

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 Changed 4 years ago by simon04

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 Changed 4 years ago by Klumbumbus

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.