#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.
Attachments (0)
Change History (12)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I think I need to commit also the compiled jar file. I need some time to figure this out...
comment:4 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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 , 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 , 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 , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:8 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
[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 , 9 years ago
Thanks for fixing! Could you please also compile and upload #11571? Would be great.
comment:10 by , 9 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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 , 9 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
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 { 109 109 if (val != null) { 110 110 try { 111 111 // 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")) { 113 113 val = val.replaceAll(" ", "_"); 114 114 } 115 115 // Encode param to be included in the URL, except if it is the URL itself !
Fixed in [o31910:31911].
fixed in [o31825]
...atleast I hope it is fixed, I will test my regexp tomorrow :)