!! Version 2 # Force the test runner to ensure the extension is loaded !! hooks imagemap !! endhooks !! test imagemap test 1 !! config wgParserEnableLegacyMediaDOM=false !! wikitext Image:Foobar.jpg !! html/php
!! html/parsoid
!! end !! test imagemap test 1 (legacy) !! config wgParserEnableLegacyMediaDOM=true !! wikitext Image:Foobar.jpg !! html/php
Foobar.jpg
About this image
!! html/parsoid
!! end !! test imagemap test 2 !! config wgParserEnableLegacyMediaDOM=false !! wikitext File:Foobar.jpg poly 10.1 10.9 10 30 -30 15 [[Main Page]] !! html/php
Main Page
!! html/parsoid
!! end !! test imagemap test 2 (legacy) !! config wgParserEnableLegacyMediaDOM=true !! wikitext File:Foobar.jpg poly 10.1 10.9 10 30 -30 15 [[Main Page]] !! html/php
Main PageFoobar.jpg
About this image
!! html/parsoid
!! end !! test imagemap test 3 !! config wgParserEnableLegacyMediaDOM=false !! wikitext File:Foobar.jpg|150px|alt=Alt text default [[Main Page|Go to main page]] !! html/php
Alt text
!! html/parsoid
Alt text
!! end !! test imagemap test 3 (legacy) !! config wgParserEnableLegacyMediaDOM=true !! wikitext File:Foobar.jpg|150px|alt=Alt text default [[Main Page|Go to main page]] !! html/php
Alt text
About this image
!! html/parsoid
Alt text
!! end !! test Empty imagemap !! wikitext !! html/php

Error: Must specify an image in the first line.

!! html/parsoid

Error: imagemap_no_image

!! end !! test Invalid image title !! wikitext [[x|xx]]]] !! html/php

Error: Must specify an image in the first line.

!! html/parsoid

Error: imagemap_no_image

!! end !! test Image does not exist !! wikitext File:Nopenopenope.jpg !! html/php

Error: Image is invalid or non-existent.

!! html/parsoid

Error: imagemap_invalid_image

!! end !! test Invalid description type !! wikitext Image:Foobar.jpg desc nopenopenope !! html/php

Error: Invalid desc specification, must be one of: top-right, bottom-right, bottom-left, top-left, none.

!! html/parsoid

Error: imagemap_invalid_desc

!! end !! test Empty description type !! wikitext Image:Foobar.jpg desc !! html/php

Error: Invalid desc specification, must be one of: top-right, bottom-right, bottom-left, top-left, none.

!! html/parsoid

Error: imagemap_invalid_desc

!! end !! test No link title !! wikitext File:Foobar.jpg 123 !! html/php

Error: No valid link was found at the end of line 3.

!! html/parsoid

Error: imagemap_no_link

!! end !! test Invalid link title !! wikitext File:Foobar.jpg [[<]] !! html/php

Error: Invalid title in link at line 3.

!! html/parsoid

Error: imagemap_invalid_title

!! end ## FIXME: Note the difference in the link alt !! test Link with wikitext syntax in content !! config wgParserEnableLegacyMediaDOM=false !! wikitext File:Foobar.jpg|150px|alt=Alt text default [[Main Page|Go to ''main page'']] !! html/php
Alt text
!! html/parsoid
Alt text
!! end ## FIXME: Note the difference in the link alt !! test Link with wikitext syntax in content (legacy) !! config wgParserEnableLegacyMediaDOM=true !! wikitext File:Foobar.jpg|150px|alt=Alt text default [[Main Page|Go to ''main page'']] !! html/php
Alt text
About this image
!! html/parsoid
Alt text
!! end !! test File with link= option !! config wgParserEnableLegacyMediaDOM=false !! wikitext File:Foobar.jpg|link=|Hi ho !! html/php
Hi ho
Hi ho
!! html/parsoid
Hi ho
Hi ho
!! end !! test File with link= option (legacy) !! config wgParserEnableLegacyMediaDOM=true !! wikitext File:Foobar.jpg|link=|Hi ho !! html/php
Hi ho
About this image
!! html/parsoid
Hi ho
Hi ho
!! end !! test File with
in caption (T113791) !! config wgParserEnableLegacyMediaDOM=false !! wikitext File:Foobar.jpg|thumb|a
b
!! html/php
a
b
!! html/parsoid
a
b
!! end !! test File with
in caption (T113791) !! config wgParserEnableLegacyMediaDOM=false !! wikitext File:Foobar.jpg|thumb|a
b
!! html/php
a
b
!! html/parsoid
a
b
!! end ## In contrast with galleries !! test Imagemap without file namespace !! config wgParserEnableLegacyMediaDOM=false !! wikitext Foobar.jpg !! html/php

Error: Must specify an image in the first line.

!! html/parsoid

Error: imagemap_no_image

!! end