jenkins-bot has submitted this change and it was merged.

Change subject: add support wikitext (version 0.6.0)
......................................................................


add support wikitext (version 0.6.0)

Change-Id: I76ca1f30802dc6fd4eedbdffcb080d57a0faf0aa
---
M MultiMaps.php
M includes/BaseMapService.php
M includes/mapelements/BaseMapElement.php
D resources/multimaps.css
M services/Google/ext.google.js
M services/Leaflet/ext.leaflet.js
M services/Leaflet/leaflet/leaflet.css
M services/Yandex/ext.yandex.js
M tests/phpunit/services/Leaflet/LeafletTest.php
9 files changed, 205 insertions(+), 45 deletions(-)

Approvals:
  Pastakhov: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MultiMaps.php b/MultiMaps.php
index 8ce3509..3006d1b 100644
--- a/MultiMaps.php
+++ b/MultiMaps.php
@@ -15,7 +15,7 @@
        die( 'This file is an extension to MediaWiki and thus not a valid entry 
point.' );
 }
 
-define( 'MultiMaps_VERSION' , '0.5.2' );
+define( 'MultiMaps_VERSION' , '0.6.0' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['parserhook'][] = array(
@@ -68,7 +68,6 @@
 
 //define modules that can later be loaded during the output
 $wgResourceModules['ext.MultiMaps'] = array(
-       'styles' => array('multimaps.css'),
        'scripts' => array('multimaps.js'),
        'localBasePath' => $dir . '/resources',
        'remoteExtPath' => 'MultiMaps/resources',
diff --git a/includes/BaseMapService.php b/includes/BaseMapService.php
index d61b3e0..c53723b 100644
--- a/includes/BaseMapService.php
+++ b/includes/BaseMapService.php
@@ -167,13 +167,13 @@
                                'div',
                                array(
                                        'id' => 'multimaps_map' . $mapid++,
-                                       'style' => 
'width:'.htmlspecialchars($this->width).'; 
height:'.htmlspecialchars($this->height).';',
+                                       'style' => 
'width:'.htmlspecialchars($this->width).'; 
height:'.htmlspecialchars($this->height).'; background-color: #cccccc; 
overflow: hidden;',
                                        'class' => 'multimaps-map' . 
($this->classname != '' ? " multimaps-map-$this->classname" : ''),
                                        ),
                                \Html::element( 'p', array(), 
\wfMessage('multimaps-loading-map')->escaped() ) .
                                \Html::rawElement(
                                                'div',
-                                               array( 'class' => 
'multimaps-mapdata' ),
+                                               array( 'class' => 
'multimaps-mapdata', 'style' => 'display: none;' ),
                                                \FormatJson::encode( 
$this->getMapData() )
                                                )
                                );
diff --git a/includes/mapelements/BaseMapElement.php 
b/includes/mapelements/BaseMapElement.php
index 74fca4e..9a1e3df 100644
--- a/includes/mapelements/BaseMapElement.php
+++ b/includes/mapelements/BaseMapElement.php
@@ -105,7 +105,13 @@
                        return false;
                }
 
-               if ( is_string($value) ) {
+               if ( $name == 'title' || $name == 'text' ) {
+                       $parser = clone $GLOBALS['wgParser'];
+                       $title = $parser->getTitle();
+                       if ( $title === null ) { $title = new \Title(); }
+
+                       $this->properties[$name] = $parser->parse( trim( $value 
), $title, new \ParserOptions() )->getText();
+               } elseif ( is_string($value) ) {
                        $value = trim( $value );
                        $this->properties[$name] = htmlspecialchars( $value, 
ENT_NOQUOTES );
                } else {
diff --git a/resources/multimaps.css b/resources/multimaps.css
deleted file mode 100644
index d05b49e..0000000
--- a/resources/multimaps.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.multimaps-mapdata { display: none; }
-.multimaps-map { background-color: #cccccc; overflow: hidden; }
diff --git a/services/Google/ext.google.js b/services/Google/ext.google.js
index 35b9f7b..8715d73 100644
--- a/services/Google/ext.google.js
+++ b/services/Google/ext.google.js
@@ -55,10 +55,10 @@
                }
 
                if (properties.title !== undefined && properties.text !== 
undefined) {
-                       options.title = properties.title;
+                       options.title = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        text = '<strong>' + properties.title + '</strong><hr 
/>' + properties.text;
                } else if (properties.title !== undefined) {
-                       options.title = properties.title;
+                       options.title = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        text = '<strong>' + properties.title + '</strong>';
                } else if (properties.text  !== undefined) {
                        text = properties.text;
diff --git a/services/Leaflet/ext.leaflet.js b/services/Leaflet/ext.leaflet.js
index 2316596..11049ae 100644
--- a/services/Leaflet/ext.leaflet.js
+++ b/services/Leaflet/ext.leaflet.js
@@ -54,10 +54,10 @@
                }
 
                if (properties.title !== undefined && properties.text !== 
undefined) {
-                       options.title = properties.title;
+                       options.title = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        text = '<strong>' + properties.title + '</strong><hr 
/>' + properties.text;
                } else if (properties.title !== undefined) {
-                       options.title = properties.title;
+                       options.title = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        text = '<strong>' + properties.title + '</strong>';
                } else if (properties.text  !== undefined) {
                        text = properties.text;
diff --git a/services/Leaflet/leaflet/leaflet.css 
b/services/Leaflet/leaflet/leaflet.css
index ac0cd17..d45db3c 100644
--- a/services/Leaflet/leaflet/leaflet.css
+++ b/services/Leaflet/leaflet/leaflet.css
@@ -184,12 +184,6 @@
        background: #ddd;
        outline: 0;
        }
-.leaflet-container a {
-       color: #0078A8;
-       }
-.leaflet-container a.leaflet-active {
-       outline: 2px solid orange;
-       }
 .leaflet-zoom-box {
        border: 2px dotted #38f;
        background: rgba(255,255,255,0.5);
diff --git a/services/Yandex/ext.yandex.js b/services/Yandex/ext.yandex.js
index 32c958b..a1a4538 100644
--- a/services/Yandex/ext.yandex.js
+++ b/services/Yandex/ext.yandex.js
@@ -54,10 +54,10 @@
                }
 
                if (properties.title !== undefined && properties.text !== 
undefined) {
-                       prop.hintContent = properties.title;
+                       prop.hintContent = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        prop.balloonContent = '<strong>' + properties.title + 
'</strong><hr />' + properties.text;
                } else if (properties.title !== undefined) {
-                       prop.hintContent = properties.title;
+                       prop.hintContent = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        prop.balloonContent = '<strong>' + properties.title + 
'</strong>';
                } else if (properties.text  !== undefined) {
                        prop.balloonContent = properties.text;
diff --git a/tests/phpunit/services/Leaflet/LeafletTest.php 
b/tests/phpunit/services/Leaflet/LeafletTest.php
index 7e494ae..e3c94f3 100644
--- a/tests/phpunit/services/Leaflet/LeafletTest.php
+++ b/tests/phpunit/services/Leaflet/LeafletTest.php
@@ -5,7 +5,7 @@
 /**
  * Generated by PHPUnit_SkeletonGenerator 1.2.0 on 2013-01-30 at 09:48:20.
  */
-class LeafletTest extends \PHPUnit_Framework_TestCase {
+class LeafletTest extends \MediaWikiTestCase {
 
        /**
         * @var Leaflet
@@ -18,6 +18,7 @@
         */
        protected function setUp() {
                $this->object = new Leaflet();
+               parent::setUp();
        }
 
        /**
@@ -51,44 +52,100 @@
 
        public function testParseOneMarkerTextOnly() {
                $this->assertEquals(
-                               \FormatJson::encode( $this->object->getMapData( 
array('55.7557860, 37.6176330~~This is text', 'service=leaflet') ) ),
-                               
'{"markers":[{"pos":[{"lat":55.755786,"lon":37.617633}],"text":"This is 
text"}],"zoom":14,"center":{"lat":55.755786,"lon":37.617633}}'
-                               );
+                               $this->object->getMapData( array('55.7557860, 
37.6176330~~This is text', 'service=leaflet') ),
+                               array(
+                                       'markers' => array(
+                                               array(
+                                                       'pos'=> array( 
array('lat'=>'55.755786','lon'=>'37.617633') ),
+                                                       'text' => "<p>This is 
text\n</p>",
+                                               ),
+                                       ),
+                                       'zoom' => 14,
+                                       'center' => array( 'lat' => 
'55.755786', 'lon' => '37.617633' ),
+                               )
+                       );
        }
 
        public function testParseOneMarkerTitleOnly() {
                $this->assertEquals(
-                               \FormatJson::encode( $this->object->getMapData( 
array('55.7557860, 37.6176330~This is title ~', 'service=leaflet') ) ),
-                               
'{"markers":[{"pos":[{"lat":55.755786,"lon":37.617633}],"title":"This is 
title"}],"zoom":14,"center":{"lat":55.755786,"lon":37.617633}}'
-                               );
+                               $this->object->getMapData( array('55.7557860, 
37.6176330~This is title ~', 'service=leaflet') ),
+                               array(
+                                       'markers' => array(
+                                               array(
+                                                       'pos'=> array( 
array('lat'=>'55.755786','lon'=>'37.617633') ),
+                                                       'title' => "<p>This is 
title\n</p>",
+                                               ),
+                                       ),
+                                       'zoom' => 14,
+                                       'center' => array( 'lat' => 
'55.755786', 'lon' => '37.617633' ),
+                               )
+                       );
        }
 
        public function testParseOneMarkerTitleText() {
                $this->assertEquals(
-                               \FormatJson::encode( $this->object->getMapData( 
array('55.7557860, 37.6176330~This is title ~ This is text ', 
'service=leaflet') ) ),
-                               
'{"markers":[{"pos":[{"lat":55.755786,"lon":37.617633}],"title":"This is 
title","text":"This is 
text"}],"zoom":14,"center":{"lat":55.755786,"lon":37.617633}}'
-                               );
+                               $this->object->getMapData( array('55.7557860, 
37.6176330~This is title ~ This is text ', 'service=leaflet') ),
+                               array(
+                                       'markers' => array(
+                                               array(
+                                                       'pos'=> array( 
array('lat'=>'55.755786','lon'=>'37.617633') ),
+                                                       'title' => "<p>This is 
title\n</p>",
+                                                       'text' => "<p>This is 
text\n</p>",
+                                               ),
+                                       ),
+                                       'zoom' => 14,
+                                       'center' => array( 'lat' => 
'55.755786', 'lon' => '37.617633' ),
+                               )
+                       );
        }
 
        public function testParseOneMarkerNamedTextOnly() {
                $this->assertEquals(
-                               \FormatJson::encode( $this->object->getMapData( 
array('55.7557860, 37.6176330~Text = This is text', 'service=leaflet') ) ),
-                               
'{"markers":[{"pos":[{"lat":55.755786,"lon":37.617633}],"text":"This is 
text"}],"zoom":14,"center":{"lat":55.755786,"lon":37.617633}}'
-                               );
+                               $this->object->getMapData( array('55.7557860, 
37.6176330~Text = This is text', 'service=leaflet') ),
+                               array(
+                                       'markers' => array(
+                                               array(
+                                                       'pos'=> array( 
array('lat'=>'55.755786','lon'=>'37.617633') ),
+                                                       'text' => "<p>This is 
text\n</p>",
+                                               ),
+                                       ),
+                                       'zoom' => 14,
+                                       'center' => array( 'lat' => 
'55.755786', 'lon' => '37.617633' ),
+                               )
+                       );
        }
 
        public function testParseOneMarkerNamedTitleOnly() {
                $this->assertEquals(
-                               \FormatJson::encode( $this->object->getMapData( 
array('55.7557860, 37.6176330~ title=This is title ~', 'service=leaflet') ) ),
-                               
'{"markers":[{"pos":[{"lat":55.755786,"lon":37.617633}],"title":"This is 
title"}],"zoom":14,"center":{"lat":55.755786,"lon":37.617633}}'
-                               );
+                               $this->object->getMapData( array('55.7557860, 
37.6176330~ title=This is title ~', 'service=leaflet') ),
+                               array(
+                                       'markers' => array(
+                                               array(
+                                                       'pos'=> array( 
array('lat'=>'55.755786','lon'=>'37.617633') ),
+                                                       'title' => "<p>This is 
title\n</p>",
+                                               ),
+                                       ),
+                                       'zoom' => 14,
+                                       'center' => array( 'lat' => 
'55.755786', 'lon' => '37.617633' ),
+                               )
+                       );
        }
 
        public function testParseOneMarkerNamedTextAndTile() {
                $this->assertEquals(
-                               \FormatJson::encode( $this->object->getMapData( 
array('55.7557860, 37.6176330~tExT = This is text ~This is title ', 
'service=leaflet') ) ),
-                               
'{"markers":[{"pos":[{"lat":55.755786,"lon":37.617633}],"text":"This is 
text","title":"This is 
title"}],"zoom":14,"center":{"lat":55.755786,"lon":37.617633}}'
-                               );
+                               $this->object->getMapData( array('55.7557860, 
37.6176330~tExT = This is text ~This is title ', 'service=leaflet') ),
+                               array(
+                                       'markers' => array(
+                                               array(
+                                                       'pos'=> array( 
array('lat'=>'55.755786','lon'=>'37.617633') ),
+                                                       'title' => "<p>This is 
title\n</p>",
+                                                       'text' => "<p>This is 
text\n</p>",
+                                               ),
+                                       ),
+                                       'zoom' => 14,
+                                       'center' => array( 'lat' => 
'55.755786', 'lon' => '37.617633' ),
+                               )
+                       );
        }
 
        public function testParseOneLine() {
@@ -269,7 +326,7 @@
 
        public function testParseAllElementsWithProperties() {
                $this->assertEquals(
-                               \FormatJson::encode( $this->object->getMapData( 
array(
+                               var_export( $this->object->getMapData( array(
                                        '52.429222277955134,13.359375~Capital 
of Germany~Crazy people here!; 53.38332836757156,3.33984375; 
52.5897007687178,2.548828125;
 52.855864177853995,3.515625; 53.33087298301704,1.7578125',
                                        
'circle=57.42129439209404,23.90625:326844.60518253763~I\'m a circle~of doom!',
@@ -285,9 +342,87 @@
 
56.218923189166624,16.259765625:54.1109429427243,19.599609375:53.225768435790194,23.466796875~You\'re
 serrounded!~ ~#B0920C',
                                        
'rectangles=51.83577752045248,33.837890625:46.37725420510028,23.37890625~I\'m a 
square',
                                        'height=500px',
-                                       'service=leaflet') ) ),
-                               
'{"markers":[{"pos":[{"lat":52.429222277955,"lon":13.359375}],"title":"Capital 
of Germany","text":"Crazy people 
here!"},{"pos":[{"lat":53.383328367572,"lon":3.33984375}]},{"pos":[{"lat":52.589700768718,"lon":2.548828125}]},{"pos":[{"lat":52.855864177854,"lon":3.515625}]},{"pos":[{"lat":53.330872983017,"lon":1.7578125}]}],"lines":[{"pos":[{"lat":53.22576843579,"lon":23.466796875},{"lat":53.956085530988,"lon":29.1796875},{"lat":56.46249048389,"lon":31.11328125},{"lat":59.310767956039,"lon":30.673828125},{"lat":60.844910573649,"lon":27.333984375},{"lat":60.930432202923,"lon":21.26953125},{"lat":59.175928249271,"lon":16.611328125},{"lat":56.218923189167,"lon":16.259765625},{"lat":54.110942942724,"lon":19.599609375},{"lat":53.22576843579,"lon":23.466796875}],"title":"You\'re
 
serrounded!","color":"#B0920C"}],"polygons":[{"pos":[{"lat":62.103882522898,"lon":5.09765625},{"lat":58.309488840678,"lon":5.712890625},{"lat":58.950008233357,"lon":10.8984375},{"lat":61.68987220046,"lon":12.83203125},{"lat":63.352129285079,"lon":11.865234375},{"lat":64.129783676426,"lon":13.974609375},{"lat":65.585720023295,"lon":14.326171875},{"lat":68.560383686642,"lon":18.28125},{"lat":68.528234920399,"lon":20.126953125},{"lat":69.224996854116,"lon":20.56640625},{"lat":69.224996854116,"lon":21.708984375},{"lat":68.624543663447,"lon":23.466796875},{"lat":69.005675196588,"lon":25.400390625},{"lat":69.960439269025,"lon":26.630859375},{"lat":70.140364272072,"lon":28.564453125},{"lat":69.256149231507,"lon":28.828125},{"lat":69.839621940675,"lon":31.201171875},{"lat":70.757965626549,"lon":29.8828125},{"lat":71.102542742323,"lon":25.576171875},{"lat":70.728979462088,"lon":22.67578125},{"lat":69.990534959477,"lon":18.10546875},{"lat":67.842416473279,"lon":13.095703125},{"lat":68.334375941282,"lon":15.908203125},{"lat":63.704722429433,"lon":9.4921875},{"lat":63.782486031165,"lon":8.61328125}],"title":"Meanwhile
 in 
Norway","color":"#0B4173","fill":true,"fillcolor":"#3373CC"}],"rectangles":[{"pos":[{"lat":51.835777520452,"lon":33.837890625},{"lat":46.3772542051,"lon":23.37890625}],"title":"I\'m
 a 
square"}],"circles":[{"radius":[326844.60518254],"pos":[{"lat":57.421294392094,"lon":23.90625}],"title":"I\'m
 a circle","text":"of 
doom!"}],"bounds":{"ne":{"lat":71.102542742323,"lon":33.837890625},"sw":{"lat":46.3772542051,"lon":1.7578125}}}'
-                               );
+                                       'service=leaflet') ), true),
+                               var_export( Array(
+                                       'markers' => Array(
+                                               Array(
+                                                       'pos' => Array( 
Array('lat' => 52.429222277955, 'lon' => 13.359375) ),
+                                                       'title' => "<p>Capital 
of Germany\n</p>",
+                                                       'text' => "<p>Crazy 
people here!\n</p>",
+                                               ),
+                                               Array( 'pos' => Array( Array( 
'lat' => 53.383328367572, 'lon' => 3.33984375 ) ) ),
+                                               Array( 'pos' => Array( Array( 
'lat' => 52.589700768718, 'lon' => 2.548828125) ) ),
+                                               Array( 'pos' => Array( Array( 
'lat' => 52.855864177854, 'lon' => 3.515625 ) ) ),
+                                               Array( 'pos' => Array( Array( 
'lat' => 53.330872983017, 'lon' => 1.7578125 ) ) ),
+                                       ),
+                                       'lines' => Array( Array(
+                                               'pos' => Array(
+                                                       Array( 'lat' => 
53.22576843579, 'lon' => 23.466796875 ),
+                                                       Array( 'lat' => 
53.956085530988, 'lon' => 29.1796875 ),
+                                                       Array( 'lat' => 
56.46249048389, 'lon' => 31.11328125 ),
+                                                       Array( 'lat' => 
59.310767956039, 'lon' => 30.673828125 ),
+                                                       Array( 'lat' => 
60.844910573649, 'lon' => 27.333984375 ),
+                                                       Array( 'lat' => 
60.930432202923, 'lon' => 21.26953125 ),
+                                                       Array( 'lat' => 
59.175928249271, 'lon' => 16.611328125 ),
+                                                       Array( 'lat' => 
56.218923189167, 'lon' => 16.259765625 ),
+                                                       Array( 'lat' => 
54.110942942724, 'lon' => 19.599609375 ),
+                                                       Array( 'lat' => 
53.22576843579, 'lon' => 23.466796875 ),
+                                               ),
+                                               'title' => "<p>You're 
serrounded!\n</p>",
+                                               'color' => '#B0920C',
+                                       ) ),
+                                       'polygons' => Array( Array(
+                                               'pos' => Array(
+                            Array( 'lat' => 62.103882522898, 'lon' => 
5.09765625 ),
+                                                       Array( 'lat' => 
58.309488840678, 'lon' => 5.712890625 ),
+                                                       Array( 'lat' => 
58.950008233357, 'lon' => 10.8984375 ),
+                                                       Array( 'lat' => 
61.68987220046, 'lon' => 12.83203125 ),
+                                                       Array( 'lat' => 
63.352129285079, 'lon' => 11.865234375 ),
+                                                       Array( 'lat' => 
64.129783676426, 'lon' => 13.974609375 ),
+                                                       Array( 'lat' => 
65.585720023295, 'lon' => 14.326171875 ),
+                                                       Array( 'lat' => 
68.560383686642, 'lon' => 18.28125 ),
+                                                       Array( 'lat' => 
68.528234920399, 'lon' => 20.126953125 ),
+                                                       Array( 'lat' => 
69.224996854116, 'lon' => 20.56640625 ),
+                                                       Array( 'lat' => 
69.224996854116, 'lon' => 21.708984375 ),
+                                                       Array( 'lat' => 
68.624543663447, 'lon' => 23.466796875 ),
+                                                       Array( 'lat' => 
69.005675196588, 'lon' => 25.400390625 ),
+                                                       Array( 'lat' => 
69.960439269025, 'lon' => 26.630859375 ),
+                                                       Array( 'lat' => 
70.140364272072, 'lon' => 28.564453125 ),
+                                                       Array( 'lat' => 
69.256149231507, 'lon' => 28.828125 ),
+                                                       Array( 'lat' => 
69.839621940675, 'lon' => 31.201171875 ),
+                                                       Array( 'lat' => 
70.757965626549, 'lon' => 29.8828125 ),
+                                                       Array( 'lat' => 
71.102542742323, 'lon' => 25.576171875 ),
+                                                       Array( 'lat' => 
70.728979462088, 'lon' => 22.67578125 ),
+                                                       Array( 'lat' => 
69.990534959477, 'lon' => 18.10546875 ),
+                                                       Array( 'lat' => 
67.842416473279, 'lon' => 13.095703125 ),
+                                                       Array( 'lat' => 
68.334375941282, 'lon' => 15.908203125 ),
+                                                       Array( 'lat' => 
63.704722429433, 'lon' => 9.4921875 ),
+                                                       Array( 'lat' => 
63.782486031165, 'lon' => 8.61328125 ),
+                        ),
+                                               'title' => "<p>Meanwhile in 
Norway\n</p>",
+                                               'color' => '#0B4173',
+                                               'fill' => true,
+                                               'fillcolor' => '#3373CC',
+                                       ) ),
+                                       'rectangles' => Array( Array(
+                                               'pos' => Array(
+                                                       Array( 'lat' => 
51.835777520452, 'lon' => 33.837890625 ),
+                                                       Array( 'lat' => 
46.3772542051, 'lon' => 23.37890625 ),
+                                               ),
+                           'title' => "<p>I'm a square\n</p>",
+                                       ) ),
+                                       'circles' => Array( Array(
+                                               'radius' => Array( 
326844.60518254 ),
+                                               'pos' => Array( Array( 'lat' => 
57.421294392094, 'lon' => 23.90625 ) ),
+                                               'title' => "<p>I'm a 
circle\n</p>",
+                                               'text' => "<p>of doom!\n</p>",
+                                       ) ),
+                                       'bounds' => Array(
+                                               'ne' => Array( 'lat' => 
71.102542742323, 'lon' => 33.837890625 ),
+                                               'sw' => Array( 'lat' => 
46.3772542051, 'lon' => 1.7578125 ),
+                                       )
+                               ), true )
+                       );
                $this->assertEquals( $this->object->getErrorMessages(), array() 
);
        }
 
@@ -310,9 +445,19 @@
                $marker = new Marker();
 
                $this->assertEquals(
-                               \FormatJson::encode( $this->object->getMapData( 
array('52.429222277955134,13.359375~Capital of Germany~Crazy people here!~ ~ 
~Berlin;', 'service=leaflet') ) ),
-                               
'{"markers":[{"pos":[{"lat":52.429222277955,"lon":13.359375}],"title":"Capital 
of Germany","text":"Crazy people 
here!"}],"zoom":14,"center":{"lat":52.429222277955,"lon":13.359375}}'
-                               );
+                               $this->object->getMapData( 
array('52.429222277955134,13.359375~Capital of Germany~Crazy people here!~ ~ 
~Berlin;', 'service=leaflet') ),
+                               array(
+                                       'markers' => array(
+                                               array(
+                                                       'pos'=> array( 
array('lat'=>52.429222277955,'lon'=>13.359375) ),
+                                                       'title' => "<p>Capital 
of Germany\n</p>",
+                                                       'text' => "<p>Crazy 
people here!\n</p>",
+                                               ),
+                                       ),
+                                       'zoom' => 14,
+                                       'center' => array( 'lat' => 
52.429222277955, 'lon' => 13.359375 ),
+                               )
+                       );
 
                $this->assertEquals(
                                $this->object->getErrorMessages(),
@@ -372,4 +517,22 @@
                                );
        }
 
+       public function testParseWikitext() {
+               global $wgParser;
+               $this->assertEquals(
+                               var_export( $this->object->getMapData( 
array('52.429222277955134,13.359375~Capital of [[Germany]]~Crazy 
[[people|germans]] here!', 'service=leaflet') ), true),
+                               var_export( array(
+                                       'markers' => array(
+                                               array(
+                                                       'pos'=> array( 
array('lat'=>52.429222277955,'lon'=>13.359375) ),
+                                                       'title' => 
$wgParser->parse( 'Capital of [[Germany]]', new \Title(), new \ParserOptions() 
)->getText(),
+                                                       'text' => 
$wgParser->parse( 'Crazy [[people|germans]] here!', new \Title(), new 
\ParserOptions() )->getText(),
+                                               ),
+                                       ),
+                                       'zoom' => 14,
+                                       'center' => array( 'lat' => 
52.429222277955, 'lon' => 13.359375 ),
+                               ), true )
+                       );
+       }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/110912
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I76ca1f30802dc6fd4eedbdffcb080d57a0faf0aa
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MultiMaps
Gerrit-Branch: master
Gerrit-Owner: Pastakhov <[email protected]>
Gerrit-Reviewer: Pastakhov <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to