!! options version=2 parsoid-compatible=wt2html !! end # Force the test runner to ensure the extension is loaded !! hooks maplink !! endhooks !! article Template:1x !! text {{{1}}} !! end !! test !! config wgKartographerParsoidSupport=true !! wikitext !! html/php

0°0′0″N 0°0′0″E Foo & bar

!! html/parsoid

Foo & bar

!! end !! test Localized and !! config wgKartographerParsoidSupport=true !! options language=de !! wikitext !! html/php

Foo & bar

Karte
!! html/parsoid

Foo & bar

!! end !! test - HTML sanitization !! config wgKartographerParsoidSupport=true !! wikitext !! html/php

<&

!! html/parsoid

<&

!! end !! test - counters and markers !! config wgKartographerParsoidSupport=true !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number" } } { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number" } } { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter" } } { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter" } } !! html/php

Foo

2

A

B

!! html/parsoid

Foo

2

A

B

!! end !! test - autolabelling with coordinates !! config wgKartographerParsoidSupport=true !! wikitext !! html/php

10°0′0″N 20°0′0″E 0°0′0″N 0°0′0″E

!! html/parsoid

!! end !! test auto-positioning !! config wgKartographerParsoidSupport=true !! wikitext {"type":"Feature","geometry":{"type":"Point","coordinates":[1,2]}} !! html/php
Map
!! html/parsoid
!! end !! test - class parameter !! config wgKartographerParsoidSupport=true !! wikitext !! html/php

Empty class - do nothing Whitespace only class - do nothing Valid class

<maplink>: Attribute "class" has an invalid value
<maplink>: Attribute "class" has an invalid value
!! html/parsoid

Empty class - do nothing Whitespace only class - do nothing Valid class

!! end !! test !! config wgKartographerParsoidSupport=true !! wikitext !! html/php
Map
Map
Map
Map
Map
Map
Map
Map
Map

Map Map Map Map Map

!! html/parsoid

!! end !! test with a caption !! config wgKartographerParsoidSupport=true !! wikitext !! html/php
Custom alt
Foo is a bar

<mapframe latitude=10 longitude=20 zoom=13 width=640 height=480 align=left text="Foo is a bar" /> <mapframe latitude=10 longitude=20 zoom=13 width=640 height=480 align=center text="Foo is a <script>" />

Map
Frameless gets cynically ignored here
Map
Foo is a bar

<mapframe latitude=10 longitude=20 zoom=13 width=full height=480 text="

Muhaha

" />

!! html/parsoid
Custom alt
Foo is a bar

<mapframe latitude=10 longitude=20 zoom=13 width=640 height=480 align=left text="Foo is a <b>bar" /> <mapframe latitude=10 longitude=20 zoom=13 width=640 height=480 align=center text="Foo is a <script>" />

Frameless gets cynically ignored here
Foo is a bar

<mapframe latitude=10 longitude=20 zoom=13 width=full height=480 text="<div>Muhaha" />

!! end !! test Error messages !! config wgKartographerParsoidSupport=true !! wikitext >Derp goes here { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "title": "Foo bar", "marker-symbol": "museum", "marker-size": "medium", "marker-color": "fail" } } !! html/php
<maplink>: Attribute "longitude" has an invalid value
<mapframe> problems:
  • Attribute "mapstyle" has an invalid value
  • Attribute "align" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe> problems:
  • Attribute "mapstyle" has an invalid value
  • Attribute "align" has an invalid value
<mapframe>: Either both "latitude" and "longitude" parameters should be supplied or neither of them
<mapframe>: Either both "latitude" and "longitude" parameters should be supplied or neither of them
!! html/parsoid
!! end !! test Error messages - localized !! options language=ru !! config wgKartographerParsoidSupport=true !! wikitext fail !! html/php
<maplink>: Ошибка JSON: Синтаксическая ошибка
!! html/parsoid
!! end !! test CSS sanitization !! config wgKartographerParsoidSupport=true !! wikitext !! html/php

foo

!! html/parsoid

foo

!! end !! test - marker styles !! config wgKartographerParsoidSupport=true wgKartographerUseMarkerStyle=true !! wikitext [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [1, 2] } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number", "marker-color": "#DDEEFF" } } ] !! html/php

A T355044

!! html/parsoid

A T355044

!! end !! test - marker styles disabled !! config wgKartographerUseMarkerStyle=false wgKartographerParsoidSupport=true !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html/php

A

!! html/parsoid

A

!! end !! test Wikivoyage mode enabled !! config wgKartographerParsoidSupport=true wgKartographerWikivoyageMode=true !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html/php

0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E

Map
Map
!! html/parsoid

!! end !! test Wikivoyage mode disabled !! config wgKartographerParsoidSupport=true wgKartographerWikivoyageMode=false !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html/php

0°0′0″N 0°0′0″E

Map
!! html/parsoid

!! end !! test show=... !! config wgKartographerParsoidSupport=true wgKartographerWikivoyageMode=true !! wikitext !! html/php

0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E

<maplink>: Attribute "show" has an invalid value
<maplink>: Attribute "show" has an invalid value

0°0′0″N 0°0′0″E

!! html/parsoid

!! end !! test ExternalData errors !! config wgKartographerParsoidSupport=true !! wikitext [ { "type": "ExternalData", "service": "fail", "ids": [ "Q1", "Q2" ] }, { "type": "ExternalData", "service": "lulzifier", "query": "test" } ] !! html/php
<maplink>: The JSON content is not valid GeoJSON+simplestyle. The list below shows all attempts to interpret it according to the JSON Schema. Not all are errors.
  • /0/service: Does not have a value in the enumeration ["geoshape","geoline","geopoint","geomask"]
  • /0/title: The property title is required
  • /0/service: Does not have a value in the enumeration ["page"]
  • /0: Failed to match exactly one schema
  • /0/geometries: The property geometries is required
  • /0/type: Does not have a value in the enumeration ["GeometryCollection"]
  • /0/type: Does not have a value in the enumeration ["MultiPolygon"]
  • /0/type: Does not have a value in the enumeration ["Point"]
  • /0/type: Does not have a value in the enumeration ["MultiPoint"]
  • /0/type: Does not have a value in the enumeration ["LineString"]
  • /0/type: Does not have a value in the enumeration ["MultiLineString"]
  • /0/type: Does not have a value in the enumeration ["Polygon"]
  • /0/coordinates: The property coordinates is required
  • /0/geometry: The property geometry is required
  • /0/type: Does not have a value in the enumeration ["Feature"]
  • /0/features: The property features is required
  • /0/type: Does not have a value in the enumeration ["FeatureCollection"]
  • /1/service: Does not have a value in the enumeration ["geoshape","geoline","geopoint","geomask"]
  • /1/title: The property title is required
  • /1/service: Does not have a value in the enumeration ["page"]
  • /1: Failed to match exactly one schema
  • /1/geometries: The property geometries is required
  • /1/type: Does not have a value in the enumeration ["GeometryCollection"]
  • /1/type: Does not have a value in the enumeration ["MultiPolygon"]
  • /1/type: Does not have a value in the enumeration ["Point"]
  • /1/type: Does not have a value in the enumeration ["MultiPoint"]
  • /1/type: Does not have a value in the enumeration ["LineString"]
  • /1/type: Does not have a value in the enumeration ["MultiLineString"]
  • /1/type: Does not have a value in the enumeration ["Polygon"]
  • /1/coordinates: The property coordinates is required
  • /1/geometry: The property geometry is required
  • /1/type: Does not have a value in the enumeration ["Feature"]
  • /1/features: The property features is required
  • /1/type: Does not have a value in the enumeration ["FeatureCollection"]
!! html/parsoid
  • /0/serviceDoes not have a value in the enumeration ["geoshape","geoline","geopoint","geomask"]
  • /0/titleThe property title is required
  • /0/serviceDoes not have a value in the enumeration ["page"]
  • /0Failed to match exactly one schema
  • /0/geometriesThe property geometries is required
  • /0/typeDoes not have a value in the enumeration ["GeometryCollection"]
  • /0/typeDoes not have a value in the enumeration ["MultiPolygon"]
  • /0/typeDoes not have a value in the enumeration ["Point"]
  • /0/typeDoes not have a value in the enumeration ["MultiPoint"]
  • /0/typeDoes not have a value in the enumeration ["LineString"]
  • /0/typeDoes not have a value in the enumeration ["MultiLineString"]
  • /0/typeDoes not have a value in the enumeration ["Polygon"]
  • /0/coordinatesThe property coordinates is required
  • /0/geometryThe property geometry is required
  • /0/typeDoes not have a value in the enumeration ["Feature"]
  • /0/featuresThe property features is required
  • /0/typeDoes not have a value in the enumeration ["FeatureCollection"]
  • /1/serviceDoes not have a value in the enumeration ["geoshape","geoline","geopoint","geomask"]
  • /1/titleThe property title is required
  • /1/serviceDoes not have a value in the enumeration ["page"]
  • /1Failed to match exactly one schema
  • /1/geometriesThe property geometries is required
  • /1/typeDoes not have a value in the enumeration ["GeometryCollection"]
  • /1/typeDoes not have a value in the enumeration ["MultiPolygon"]
  • /1/typeDoes not have a value in the enumeration ["Point"]
  • /1/typeDoes not have a value in the enumeration ["MultiPoint"]
  • /1/typeDoes not have a value in the enumeration ["LineString"]
  • /1/typeDoes not have a value in the enumeration ["MultiLineString"]
  • /1/typeDoes not have a value in the enumeration ["Polygon"]
  • /1/coordinatesThe property coordinates is required
  • /1/geometryThe property geometry is required
  • /1/typeDoes not have a value in the enumeration ["Feature"]
  • /1/featuresThe property features is required
  • /1/typeDoes not have a value in the enumeration ["FeatureCollection"]
!! end !! test Tag extension cache should not keep a state around between extension invocations (second link should have coordinates as text) !! config wgKartographerParsoidSupport=true !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number" } } !! html/parsoid

Foo

!! end !! test List in mapframe caption, with mapframe defined directly !! config wgKartographerParsoidSupport=true !! wikitext !! html/php
Map
A text with lines * that create a list * listy list * even with a template
!! html/parsoid
A text with lines
  • that create a list
  • listy list
  • even with a template
!! end !! article Template:Mapframe !! text {{#tag:mapframe||latitude={{{1}}}|longitude={{{2}}}|width=640|height=480|text={{{name}}} }} !! end !! test List in mapframe caption, with mapframe defined with a template !! config wgKartographerParsoidSupport=true !! wikitext {{mapframe|10|20|name=A text with lines * that create a list * listy list * {{1x|even with a template}}}} !! html/php
Map
A text

with lines

  • that create a list
  • listy list
  • even with a template
!! html/parsoid
A text with lines
  • that create a list
  • listy list
  • even with a template
!! end