Changeset 14057 in josm
- Timestamp:
- 2018-07-28T01:16:04+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/validator/wikipedia.mapcss
r12415 r14057 49 49 *[wikipedia =~ /(?i)^[-a-z]{2,12}:.*%[0-9A-F][0-9A-F]/] { 50 50 throwError: tr("{0} tag should not have URL-encoded values like ''%27''", "{0.tag}"); 51 fixAdd: concat("wikipedia=", get(regexp_match(" ^([-a-z]+:)(.*)$", tag("wikipedia")),1), trim(replace(URL_decode(get(regexp_match("^([-a-z]+:)(.+)$", tag("wikipedia")),2)), "_", " ")));51 fixAdd: concat("wikipedia=", get(regexp_match("(?i)^([-a-z]+:)(.*)$", tag("wikipedia")),1), trim(replace(URL_decode(get(regexp_match("(?i)^([-a-z]+:)(.+)$", tag("wikipedia")),2)), "_", " "))); 52 52 assertMatch: "node wikipedia=en:Foo%27s"; 53 53 assertNoMatch: "node wikipedia=en:Foo"; … … 56 56 *[wikipedia =~ /(?i)^[-a-z]{2,12}: /] { 57 57 throwWarning: tr("wikipedia title should not start with a space after language code"); 58 fixAdd: concat("wikipedia=", get(regexp_match(" ^([-a-z]+:)(.*)$", tag("wikipedia")),1), trim(get(regexp_match("^([-a-z]+:)(.*)$", tag("wikipedia")),2)));58 fixAdd: concat("wikipedia=", get(regexp_match("(?i)^([-a-z]+:)(.*)$", tag("wikipedia")),1), trim(get(regexp_match("(?i)^([-a-z]+:)(.*)$", tag("wikipedia")),2))); 59 59 assertMatch: "node wikipedia=en: foo"; 60 60 assertNoMatch: "node wikipedia=en:foo"; … … 63 63 *[wikipedia =~ /(?i)^[-a-z]{2,12}:wiki\//] { 64 64 throwWarning: tr("wikipedia title should not have ''{0}'' prefix", "wiki/"); 65 fixAdd: concat("wikipedia=", get(regexp_match(" ^([-a-z]+:)wiki/(.*)$", tag("wikipedia")),1), trim(get(regexp_match("^([-a-z]+:)wiki/(.*)$", tag("wikipedia")),2)));65 fixAdd: concat("wikipedia=", get(regexp_match("(?i)^([-a-z]+:)wiki/(.*)$", tag("wikipedia")),1), trim(get(regexp_match("(?i)^([-a-z]+:)wiki/(.*)$", tag("wikipedia")),2))); 66 66 assertMatch: "node wikipedia=en:wiki/foo"; 67 67 assertNoMatch: "node wikipedia=en:foo"; … … 73 73 *[wikipedia =~ /^[-a-zA-Z]{2,12}:\p{Ll}/][wikipedia !~ /^jbo:/][wikipedia !~ /(?i)^[-a-z]{2,12}:https?:/] { 74 74 throwWarning: tr("wikipedia page title should have first letter capitalized"); 75 fixAdd: concat("wikipedia=", get(regexp_match(" ^([-a-z]+:)(.)(.*)$", tag("wikipedia")),1), upper(get(regexp_match("^([-a-z]+:)(.)(.*)$", tag("wikipedia")),2)), get(regexp_match("^([-a-z]+:)(.)(.*)$", tag("wikipedia")),3));75 fixAdd: concat("wikipedia=", get(regexp_match("(?i)^([-a-z]+:)(.)(.*)$", tag("wikipedia")),1), upper(get(regexp_match("(?i)^([-a-z]+:)(.)(.*)$", tag("wikipedia")),2)), get(regexp_match("(?i)^([-a-z]+:)(.)(.*)$", tag("wikipedia")),3)); 76 76 assertMatch: "node wikipedia=en:foo"; 77 77 assertNoMatch: "node wikipedia=en:Foo"; … … 82 82 *[wikipedia =~ /(?i)^[-a-z]{2,12}:.*_/][wikipedia !~ /(?i)^[-a-z]{2,12}:https?:/] { 83 83 throwWarning: tr("wikipedia page title should have spaces instead of underscores (''_''→'' '')"); 84 fixAdd: concat("wikipedia=", get(regexp_match(" ^([-a-z]+:)(.+)$", tag("wikipedia")),1), trim(replace(get(regexp_match("^([-a-z]+:)(.+)$", tag("wikipedia")),2), "_", " ")));84 fixAdd: concat("wikipedia=", get(regexp_match("(?i)^([-a-z]+:)(.+)$", tag("wikipedia")),1), trim(replace(get(regexp_match("(?i)^([-a-z]+:)(.+)$", tag("wikipedia")),2), "_", " "))); 85 85 assertMatch: "node wikipedia=en:foo_bar"; 86 86 assertNoMatch: "node wikipedia=en:foo bar"; … … 111 111 *[wikipedia ^= "zh:zh:"] { 112 112 throwWarning: tr("wikipedia language seems to be duplicated, e.g. en:en:Foo"); 113 fixAdd: concat("wikipedia=", get(regexp_match(" ^([-a-z]+:)([-a-z]+:)(.*)$", tag("wikipedia")),2), trim(get(regexp_match("^([-a-z]+:)([-a-z]+:)(.*)$", tag("wikipedia")),3)));113 fixAdd: concat("wikipedia=", get(regexp_match("(?i)^([-a-z]+:)([-a-z]+:)(.*)$", tag("wikipedia")),2), trim(get(regexp_match("(?i)^([-a-z]+:)([-a-z]+:)(.*)$", tag("wikipedia")),3))); 114 114 assertMatch: "node wikipedia=en:en:Foo"; 115 115 assertMatch: "node wikipedia=en:fr:Foo";
Note:
See TracChangeset
for help on using the changeset viewer.