Merge "rdbms: fix bogus $fname parameter in LoadMonitorMySQL"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 21 Mar 2018 19:39:25 +0000 (19:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 21 Mar 2018 19:39:26 +0000 (19:39 +0000)
51 files changed:
RELEASE-NOTES-1.31
autoload.php
composer.json
includes/htmlform/fields/HTMLSizeFilterField.php
includes/libs/rdbms/database/DBConnRef.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMssql.php
includes/libs/rdbms/database/DatabaseMysqlBase.php
includes/libs/rdbms/database/DatabasePostgres.php
includes/libs/rdbms/database/IDatabase.php
includes/libs/rdbms/encasing/Subquery.php [new file with mode: 0644]
includes/parser/BlockLevelPass.php
includes/parser/MWTidy.php
includes/parser/Parser.php
includes/resourceloader/ResourceLoaderClientHtml.php
languages/i18n/ar.json
languages/i18n/be-tarask.json
languages/i18n/bs.json
languages/i18n/ckb.json
languages/i18n/de.json
languages/i18n/es.json
languages/i18n/fr.json
languages/i18n/he.json
languages/i18n/hr.json
languages/i18n/hu.json
languages/i18n/io.json
languages/i18n/it.json
languages/i18n/nds-nl.json
languages/i18n/nn.json
languages/i18n/sr-ec.json
languages/i18n/th.json
package.json
tests/integration/includes/http/CurlHttpRequestTest.php
tests/integration/includes/http/PhpHttpRequestTest.php
tests/integration/includes/shell/FirejailCommandTest.php
tests/parser/parserTests.txt
tests/phpunit/includes/StatusTest.php
tests/phpunit/includes/api/ApiDisabledTest.php [new file with mode: 0644]
tests/phpunit/includes/api/ApiQueryWatchlistIntegrationTest.php
tests/phpunit/includes/content/WikitextStructureTest.php
tests/phpunit/includes/http/HttpTest.php
tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php
tests/phpunit/includes/parser/ParserIntegrationTest.php
tests/phpunit/includes/rcfeed/RCFeedIntegrationTest.php
tests/selenium/pageobjects/createaccount.page.js
tests/selenium/pageobjects/delete.page.js
tests/selenium/pageobjects/edit.page.js
tests/selenium/pageobjects/page.js
tests/selenium/pageobjects/restore.page.js
tests/selenium/wdio.conf.jenkins.js

index 7b2ece9..899f8b3 100644 (file)
@@ -293,6 +293,15 @@ changes to languages because of Phabricator reports.
   can use ApiOpenSearch::getOpenSearchTemplate() instead.
 * The global function wfBaseConvert, deprecated in 1.27, has been removed. Use
   Wikimedia\base_convert() directly.
+* RFC 157418: Whitespace is trimmed from wikitext headings, wikitext list items,
+  wikitext table captions, wikitext table headings, wikitext table cells. HTML
+  headings, HTML list items, HTML table captions, HTML table headings, HTML table cells
+  will not have this trimming behavior.
+* Calling Database::begin() explicitly during an implicit transaction or when DBO_TRX
+  is set results in an exception. Calling Database::commit() explicitly for an implicit
+  transaction also results in an exception. Previously these were logged as errors.
+  The startAtomic() and endAtomic() methods, or AtomicSectionUpdate should be used
+  instead.
 
 == Compatibility ==
 MediaWiki 1.31 requires PHP 5.5.9 or later. Although HHVM 3.18.5 or later is supported,
index b5f3e4a..6386a5e 100644 (file)
@@ -1727,6 +1727,7 @@ $wgAutoloadLocalClasses = [
        'Wikimedia\\Rdbms\\SQLiteField' => __DIR__ . '/includes/libs/rdbms/field/SQLiteField.php',
        'Wikimedia\\Rdbms\\SavepointPostgres' => __DIR__ . '/includes/libs/rdbms/database/utils/SavepointPostgres.php',
        'Wikimedia\\Rdbms\\SessionConsistentConnectionManager' => __DIR__ . '/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php',
+       'Wikimedia\\Rdbms\\Subquery' => __DIR__ . '/includes/libs/rdbms/encasing/Subquery.php',
        'Wikimedia\\Rdbms\\TransactionProfiler' => __DIR__ . '/includes/libs/rdbms/TransactionProfiler.php',
        'WikitextContent' => __DIR__ . '/includes/content/WikitextContent.php',
        'WikitextContentHandler' => __DIR__ . '/includes/content/WikitextContentHandler.php',
index 0569b03..bb01fe4 100644 (file)
@@ -38,7 +38,7 @@
                "wikimedia/ip-set": "1.2.0",
                "wikimedia/object-factory": "1.0.0",
                "wikimedia/php-session-serializer": "1.0.5",
-               "wikimedia/purtle": "1.0.6",
+               "wikimedia/purtle": "1.0.7",
                "wikimedia/relpath": "2.1.1",
                "wikimedia/remex-html": "1.0.3",
                "wikimedia/running-stat": "1.2.1",
index 5ad7ee3..145a0ec 100644 (file)
@@ -41,9 +41,26 @@ class HTMLSizeFilterField extends HTMLIntField {
                return $html;
        }
 
-       // No OOUI yet
-       public function getInputOOUI( $value ) {
-               return false;
+       protected function getInputWidget( $params ) {
+               $this->mParent->getOutput()->addModuleStyles( 'mediawiki.widgets.SizeFilterWidget.styles' );
+
+               // negative numbers represent "max", positive numbers represent "min"
+               $value = $params['value'];
+
+               $params['value'] = $value ? abs( $value ) : '';
+
+               return new MediaWiki\Widget\SizeFilterWidget( [
+                       'selectMin' => $value >= 0,
+                       'textinput' => $params,
+                       'radioselectinput' => [
+                               'name' => $this->mName . '-mode',
+                               'disabled' => !empty( $this->mParams['disabled'] ),
+                       ],
+               ] );
+       }
+
+       protected function getOOUIModules() {
+               return [ 'mediawiki.widgets.SizeFilterWidget' ];
        }
 
        /**
index 6726aea..1f8e56c 100644 (file)
@@ -362,6 +362,13 @@ class DBConnRef implements IDatabase {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
+       public function buildSelectSubquery(
+               $table, $vars, $conds = '', $fname = __METHOD__,
+               $options = [], $join_conds = []
+       ) {
+               return $this->__call( __FUNCTION__, func_get_args() );
+       }
+
        public function databasesAreIndependent() {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
index 2d90be6..00bc1cb 100644 (file)
@@ -1588,8 +1588,14 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
        }
 
        public function estimateRowCount(
-               $table, $vars = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
+               $table, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
        ) {
+               $conds = $this->normalizeConditions( $conds, $fname );
+               $column = $this->extractSingleFieldFromList( $var );
+               if ( is_string( $column ) && !in_array( $column, [ '*', '1' ] ) ) {
+                       $conds[] = "$column IS NOT NULL";
+               }
+
                $res = $this->select(
                        $table, [ 'rowcount' => 'COUNT(*)' ], $conds, $fname, $options, $join_conds
                );
@@ -1599,21 +1605,76 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
        }
 
        public function selectRowCount(
-               $tables, $vars = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
+               $tables, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
        ) {
-               $rows = 0;
-               $sql = $this->selectSQLText( $tables, '1', $conds, $fname, $options, $join_conds );
-               // The identifier quotes is primarily for MSSQL.
-               $rowCountCol = $this->addIdentifierQuotes( "rowcount" );
-               $tableName = $this->addIdentifierQuotes( "tmp_count" );
-               $res = $this->query( "SELECT COUNT(*) AS $rowCountCol FROM ($sql) $tableName", $fname );
+               $conds = $this->normalizeConditions( $conds, $fname );
+               $column = $this->extractSingleFieldFromList( $var );
+               if ( is_string( $column ) && !in_array( $column, [ '*', '1' ] ) ) {
+                       $conds[] = "$column IS NOT NULL";
+               }
+
+               $res = $this->select(
+                       [
+                               'tmp_count' => $this->buildSelectSubquery(
+                                       $tables,
+                                       '1',
+                                       $conds,
+                                       $fname,
+                                       $options,
+                                       $join_conds
+                               )
+                       ],
+                       [ 'rowcount' => 'COUNT(*)' ],
+                       [],
+                       $fname
+               );
+               $row = $res ? $this->fetchRow( $res ) : [];
+
+               return isset( $row['rowcount'] ) ? (int)$row['rowcount'] : 0;
+       }
+
+       /**
+        * @param array|string $conds
+        * @param string $fname
+        * @return array
+        */
+       final protected function normalizeConditions( $conds, $fname ) {
+               if ( $conds === null || $conds === false ) {
+                       $this->queryLogger->warning(
+                               __METHOD__
+                               . ' called from '
+                               . $fname
+                               . ' with incorrect parameters: $conds must be a string or an array'
+                       );
+                       $conds = '';
+               }
 
-               if ( $res ) {
-                       $row = $this->fetchRow( $res );
-                       $rows = ( isset( $row['rowcount'] ) ) ? (int)$row['rowcount'] : 0;
+               if ( !is_array( $conds ) ) {
+                       $conds = ( $conds === '' ) ? [] : [ $conds ];
                }
 
-               return $rows;
+               return $conds;
+       }
+
+       /**
+        * @param array|string $var Field parameter in the style of select()
+        * @return string|null Column name or null; ignores aliases
+        * @throws DBUnexpectedError Errors out if multiple columns are given
+        */
+       final protected function extractSingleFieldFromList( $var ) {
+               if ( is_array( $var ) ) {
+                       if ( !$var ) {
+                               $column = null;
+                       } elseif ( count( $var ) == 1 ) {
+                               $column = isset( $var[0] ) ? $var[0] : reset( $var );
+                       } else {
+                               throw new DBUnexpectedError( $this, __METHOD__ . ': got multiple columns.' );
+                       }
+               } else {
+                       $column = $var;
+               }
+
+               return $column;
        }
 
        /**
@@ -1963,6 +2024,15 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                return 'CAST( ' . $field . ' AS INTEGER )';
        }
 
+       public function buildSelectSubquery(
+               $table, $vars, $conds = '', $fname = __METHOD__,
+               $options = [], $join_conds = []
+       ) {
+               return new Subquery(
+                       $this->selectSQLText( $table, $vars, $conds, $fname, $options, $join_conds )
+               );
+       }
+
        public function databasesAreIndependent() {
                return false;
        }
@@ -1985,6 +2055,13 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
        }
 
        public function tableName( $name, $format = 'quoted' ) {
+               if ( $name instanceof Subquery ) {
+                       throw new DBUnexpectedError(
+                               $this,
+                               __METHOD__ . ': got Subquery instance when expecting a string.'
+                       );
+               }
+
                # Skip the entire process when we have a string quoted on both ends.
                # Note that we check the end so that we will still quote any use of
                # use of `database`.table. But won't break things if someone wants
@@ -2001,6 +2078,11 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                # any remote case where a word like on may be inside of a table name
                # surrounded by symbols which may be considered word breaks.
                if ( preg_match( '/(^|\s)(DISTINCT|JOIN|ON|AS)(\s|$)/i', $name ) !== 0 ) {
+                       $this->queryLogger->warning(
+                               __METHOD__ . ": use of subqueries is not supported this way.",
+                               [ 'trace' => ( new RuntimeException() )->getTraceAsString() ]
+                       );
+
                        return $name;
                }
 
@@ -2105,17 +2187,32 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        /**
         * Get an aliased table name
-        * e.g. tableName AS newTableName
         *
-        * @param string $name Table name, see tableName()
-        * @param string|bool $alias Alias (optional)
+        * This returns strings like "tableName AS newTableName" for aliased tables
+        * and "(SELECT * from tableA) newTablename" for subqueries (e.g. derived tables)
+        *
+        * @see Database::tableName()
+        * @param string|Subquery $table Table name or object with a 'sql' field
+        * @param string|bool $alias Table alias (optional)
         * @return string SQL name for aliased table. Will not alias a table to its own name
         */
-       protected function tableNameWithAlias( $name, $alias = false ) {
-               if ( !$alias || $alias == $name ) {
-                       return $this->tableName( $name );
+       protected function tableNameWithAlias( $table, $alias = false ) {
+               if ( is_string( $table ) ) {
+                       $quotedTable = $this->tableName( $table );
+               } elseif ( $table instanceof Subquery ) {
+                       $quotedTable = (string)$table;
+               } else {
+                       throw new InvalidArgumentException( "Table must be a string or Subquery." );
+               }
+
+               if ( !strlen( $alias ) || $alias === $table ) {
+                       if ( $table instanceof Subquery ) {
+                               throw new InvalidArgumentException( "Subquery table missing alias." );
+                       }
+
+                       return $quotedTable;
                } else {
-                       return $this->tableName( $name ) . ' ' . $this->addIdentifierQuotes( $alias );
+                       return $quotedTable . ' ' . $this->addIdentifierQuotes( $alias );
                }
        }
 
@@ -3185,16 +3282,12 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                                $msg = "$fname: Explicit transaction already active (from {$this->trxFname}).";
                                throw new DBUnexpectedError( $this, $msg );
                        } else {
-                               // @TODO: make this an exception at some point
                                $msg = "$fname: Implicit transaction already active (from {$this->trxFname}).";
-                               $this->queryLogger->error( $msg );
-                               return; // join the main transaction set
+                               throw new DBUnexpectedError( $this, $msg );
                        }
                } elseif ( $this->getFlag( self::DBO_TRX ) && $mode !== self::TRANSACTION_INTERNAL ) {
-                       // @TODO: make this an exception at some point
                        $msg = "$fname: Implicit transaction expected (DBO_TRX set).";
-                       $this->queryLogger->error( $msg );
-                       return; // let any writes be in the main transaction
+                       throw new DBUnexpectedError( $this, $msg );
                }
 
                // Avoid fatals if close() was called
@@ -3260,10 +3353,10 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                                        "$fname: No transaction to commit, something got out of sync." );
                                return; // nothing to do
                        } elseif ( $this->trxAutomatic ) {
-                               // @TODO: make this an exception at some point
-                               $msg = "$fname: Explicit commit of implicit transaction.";
-                               $this->queryLogger->error( $msg );
-                               return; // wait for the main transaction set commit round
+                               throw new DBUnexpectedError(
+                                       $this,
+                                       "$fname: Expected mass commit of all peer transactions (DBO_TRX set)."
+                               );
                        }
                }
 
@@ -3314,7 +3407,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        } elseif ( $this->getFlag( self::DBO_TRX ) ) {
                                throw new DBUnexpectedError(
                                        $this,
-                                       "$fname: Expected mass rollback of all peer databases (DBO_TRX set)."
+                                       "$fname: Expected mass rollback of all peer transactions (DBO_TRX set)."
                                );
                        }
                }
index 885880a..1f6132b 100644 (file)
@@ -505,20 +505,26 @@ class DatabaseMssql extends Database {
         * Returns -1 if count cannot be found
         * Takes same arguments as Database::select()
         * @param string $table
-        * @param string $vars
+        * @param string $var
         * @param string $conds
         * @param string $fname
         * @param array $options
         * @param array $join_conds
         * @return int
         */
-       public function estimateRowCount( $table, $vars = '*', $conds = '',
+       public function estimateRowCount( $table, $var = '*', $conds = '',
                $fname = __METHOD__, $options = [], $join_conds = []
        ) {
+               $conds = $this->normalizeConditions( $conds, $fname );
+               $column = $this->extractSingleFieldFromList( $var );
+               if ( is_string( $column ) && !in_array( $column, [ '*', '1' ] ) ) {
+                       $conds[] = "$column IS NOT NULL";
+               }
+
                // http://msdn2.microsoft.com/en-us/library/aa259203.aspx
                $options['EXPLAIN'] = true;
                $options['FOR COUNT'] = true;
-               $res = $this->select( $table, $vars, $conds, $fname, $options, $join_conds );
+               $res = $this->select( $table, $var, $conds, $fname, $options, $join_conds );
 
                $rows = -1;
                if ( $res ) {
index 7537578..c7147e4 100644 (file)
@@ -558,18 +558,24 @@ abstract class DatabaseMysqlBase extends Database {
         * Takes same arguments as Database::select()
         *
         * @param string|array $table
-        * @param string|array $vars
+        * @param string|array $var
         * @param string|array $conds
         * @param string $fname
         * @param string|array $options
         * @param array $join_conds
         * @return bool|int
         */
-       public function estimateRowCount( $table, $vars = '*', $conds = '',
+       public function estimateRowCount( $table, $var = '*', $conds = '',
                $fname = __METHOD__, $options = [], $join_conds = []
        ) {
+               $conds = $this->normalizeConditions( $conds, $fname );
+               $column = $this->extractSingleFieldFromList( $var );
+               if ( is_string( $column ) && !in_array( $column, [ '*', '1' ] ) ) {
+                       $conds[] = "$column IS NOT NULL";
+               }
+
                $options['EXPLAIN'] = true;
-               $res = $this->select( $table, $vars, $conds, $fname, $options, $join_conds );
+               $res = $this->select( $table, $var, $conds, $fname, $options, $join_conds );
                if ( $res === false ) {
                        return false;
                }
index 49c945e..13d9158 100644 (file)
@@ -409,18 +409,24 @@ class DatabasePostgres extends Database {
         * Takes same arguments as Database::select()
         *
         * @param string $table
-        * @param string $vars
+        * @param string $var
         * @param string $conds
         * @param string $fname
         * @param array $options
         * @param array $join_conds
         * @return int
         */
-       public function estimateRowCount( $table, $vars = '*', $conds = '',
+       public function estimateRowCount( $table, $var = '*', $conds = '',
                $fname = __METHOD__, $options = [], $join_conds = []
        ) {
+               $conds = $this->normalizeConditions( $conds, $fname );
+               $column = $this->extractSingleFieldFromList( $var );
+               if ( is_string( $column ) && !in_array( $column, [ '*', '1' ] ) ) {
+                       $conds[] = "$column IS NOT NULL";
+               }
+
                $options['EXPLAIN'] = true;
-               $res = $this->select( $table, $vars, $conds, $fname, $options, $join_conds );
+               $res = $this->select( $table, $var, $conds, $fname, $options, $join_conds );
                $rows = -1;
                if ( $res ) {
                        $row = $this->fetchRow( $res );
index e5e2076..a5392c8 100644 (file)
@@ -628,6 +628,11 @@ interface IDatabase {
         * This includes the user table in the query, with the alias "a" available
         * for use in field names (e.g. a.user_name).
         *
+        * A derived table, defined by the result of selectSQLText(), requires an alias
+        * key and a Subquery instance value which wraps the SQL query, for example:
+        *
+        *    [ 'c' => new Subquery( 'SELECT ...' ) ]
+        *
         * Joins using parentheses for grouping (since MediaWiki 1.31) may be
         * constructed using nested arrays. For example,
         *
@@ -777,15 +782,15 @@ interface IDatabase {
         * doing UNION queries, where the SQL text of each query is needed. In general,
         * however, callers outside of Database classes should just use select().
         *
+        * @see IDatabase::select()
+        *
         * @param string|array $table Table name
         * @param string|array $vars Field names
         * @param string|array $conds Conditions
         * @param string $fname Caller function name
         * @param string|array $options Query options
         * @param string|array $join_conds Join conditions
-        *
-        * @return string SQL query string.
-        * @see IDatabase::select()
+        * @return string SQL query string
         */
        public function selectSQLText(
                $table, $vars, $conds = '', $fname = __METHOD__,
@@ -825,7 +830,7 @@ interface IDatabase {
         * Takes the same arguments as IDatabase::select().
         *
         * @param string $table Table name
-        * @param string $vars Unused
+        * @param string $var Column for which NULL values are not counted [default "*"]
         * @param array|string $conds Filters on the table
         * @param string $fname Function name for profiling
         * @param array $options Options for select
@@ -834,7 +839,7 @@ interface IDatabase {
         * @throws DBError
         */
        public function estimateRowCount(
-               $table, $vars = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
+               $table, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
        );
 
        /**
@@ -847,7 +852,7 @@ interface IDatabase {
         * @since 1.27 Added $join_conds parameter
         *
         * @param array|string $tables Table names
-        * @param string $vars Unused
+        * @param string $var Column for which NULL values are not counted [default "*"]
         * @param array|string $conds Filters on the table
         * @param string $fname Function name for profiling
         * @param array $options Options for select
@@ -856,7 +861,7 @@ interface IDatabase {
         * @throws DBError
         */
        public function selectRowCount(
-               $tables, $vars = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
+               $tables, $var = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
        );
 
        /**
@@ -1087,6 +1092,25 @@ interface IDatabase {
         */
        public function buildIntegerCast( $field );
 
+       /**
+        * Equivalent to IDatabase::selectSQLText() except wraps the result in Subqyery
+        *
+        * @see IDatabase::selectSQLText()
+        *
+        * @param string|array $table Table name
+        * @param string|array $vars Field names
+        * @param string|array $conds Conditions
+        * @param string $fname Caller function name
+        * @param string|array $options Query options
+        * @param string|array $join_conds Join conditions
+        * @return Subquery
+        * @since 1.31
+        */
+       public function buildSelectSubquery(
+               $table, $vars, $conds = '', $fname = __METHOD__,
+               $options = [], $join_conds = []
+       );
+
        /**
         * Returns true if DBs are assumed to be on potentially different servers
         *
diff --git a/includes/libs/rdbms/encasing/Subquery.php b/includes/libs/rdbms/encasing/Subquery.php
new file mode 100644 (file)
index 0000000..fc118d0
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * This file deals with database interface functions
+ * and query specifics/optimisations.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Database
+ */
+
+namespace Wikimedia\Rdbms;
+
+class Subquery {
+       /** @var string */
+       private $sql;
+
+       /**
+        * @param string $sql SQL query defining the table
+        */
+       public function __construct( $sql ) {
+               $this->sql = $sql;
+       }
+
+       /**
+        * @return string Original SQL query
+        */
+       public function __toString() {
+               return '(' . $this->sql . ')';
+       }
+}
index 7f78912..acdc652 100644 (file)
@@ -236,7 +236,8 @@ class BlockLevelPass {
                                        $term = $t2 = '';
                                        if ( $this->findColonNoLinks( $t, $term, $t2 ) !== false ) {
                                                $t = $t2;
-                                               $output .= $term . $this->nextItem( ':' );
+                                               // Trim whitespace in list items
+                                               $output .= trim( $term ) . $this->nextItem( ':' );
                                        }
                                }
                        } elseif ( $prefixLength || $lastPrefixLength ) {
@@ -274,7 +275,8 @@ class BlockLevelPass {
                                                # @todo FIXME: This is dupe of code above
                                                if ( $this->findColonNoLinks( $t, $term, $t2 ) !== false ) {
                                                        $t = $t2;
-                                                       $output .= $term . $this->nextItem( ':' );
+                                                       // Trim whitespace in list items
+                                                       $output .= trim( $term ) . $this->nextItem( ':' );
                                                }
                                        }
                                        ++$commonPrefixLength;
@@ -371,9 +373,12 @@ class BlockLevelPass {
                                $this->inPre = false;
                        }
                        if ( $pendingPTag === false ) {
-                               $output .= $t;
                                if ( $prefixLength === 0 ) {
+                                       $output .= $t;
                                        $output .= "\n";
+                               } else {
+                                       // Trim whitespace in list items
+                                       $output .= trim( $t );
                                }
                        }
                }
index ffc884e..330859d 100644 (file)
@@ -69,7 +69,7 @@ class MWTidy {
                if ( $driver->supportsValidate() ) {
                        return $driver->validate( $text, $errorStr );
                } else {
-                       throw new MWException( __METHOD__ . ": error text return from HHVM tidy is not supported" );
+                       throw new MWException( __METHOD__ . ": tidy driver does not support validate()" );
                }
        }
 
index 9458728..e545887 100644 (file)
@@ -1113,7 +1113,11 @@ class Parser {
                                        $line = "</{$last_tag}>{$line}";
                                }
                                array_pop( $tr_attributes );
-                               $outLine = $line . str_repeat( '</dd></dl>', $indent_level );
+                               if ( $indent_level > 0 ) {
+                                       $outLine = rtrim( $line ) . str_repeat( '</dd></dl>', $indent_level );
+                               } else {
+                                       $outLine = $line;
+                               }
                        } elseif ( $first_two === '|-' ) {
                                # Now we have a table row
                                $line = preg_replace( '#^\|-+#', '', $line );
@@ -1204,13 +1208,15 @@ class Parser {
                                        # be mistaken as delimiting cell parameters
                                        # Bug T153140: Neither should language converter markup.
                                        if ( preg_match( '/\[\[|-\{/', $cell_data[0] ) === 1 ) {
-                                               $cell = "{$previous}<{$last_tag}>{$cell}";
+                                               $cell = "{$previous}<{$last_tag}>" . trim( $cell );
                                        } elseif ( count( $cell_data ) == 1 ) {
-                                               $cell = "{$previous}<{$last_tag}>{$cell_data[0]}";
+                                               // Whitespace in cells is trimmed
+                                               $cell = "{$previous}<{$last_tag}>" . trim( $cell_data[0] );
                                        } else {
                                                $attributes = $this->mStripState->unstripBoth( $cell_data[0] );
                                                $attributes = Sanitizer::fixTagAttributes( $attributes, $last_tag );
-                                               $cell = "{$previous}<{$last_tag}{$attributes}>{$cell_data[1]}";
+                                               // Whitespace in cells is trimmed
+                                               $cell = "{$previous}<{$last_tag}{$attributes}>" . trim( $cell_data[1] );
                                        }
 
                                        $outLine .= $cell;
@@ -4050,6 +4056,7 @@ class Parser {
 
                # Get all headlines for numbering them and adding funky stuff like [edit]
                # links - this is for later, but we need the number of headlines right now
+               # This regexp also trims whitespace in the heading's content
                $matches = [];
                $numMatches = preg_match_all(
                        '/<H(?P<level>[1-6])(?P<attrib>.*?>)\s*(?P<header>[\s\S]*?)\s*<\/H[1-6] *>/i',
index fe9e56f..a9e2f92 100644 (file)
@@ -131,9 +131,7 @@ class ResourceLoaderClientHtml {
                                // moduleName => state
                        ],
                        'general' => [],
-                       'styles' => [
-                               // moduleName
-                       ],
+                       'styles' => [],
                        'scripts' => [],
                        // Embedding for private modules
                        'embed' => [
@@ -182,20 +180,17 @@ class ResourceLoaderClientHtml {
                        }
 
                        // Stylesheet doesn't trigger mw.loader callback.
-                       // Set "ready" state to allow dependencies and avoid duplicate requests. (T87871)
+                       // Set "ready" state to allow script modules to depend on this module  (T87871).
+                       // And to avoid duplicate requests at run-time from mw.loader.
                        $data['states'][$name] = 'ready';
 
                        $group = $module->getGroup();
                        $context = $this->getContext( $group, ResourceLoaderModule::TYPE_STYLES );
-                       if ( $module->isKnownEmpty( $context ) ) {
-                               // Avoid needless request for empty module
-                               $data['states'][$name] = 'ready';
-                       } else {
+                       // Avoid needless request for empty module
+                       if ( !$module->isKnownEmpty( $context ) ) {
                                if ( $module->shouldEmbedModule( $this->context ) ) {
                                        // Embed via style element
                                        $data['embed']['styles'][] = $name;
-                                       // Avoid duplicate request from mw.loader
-                                       $data['states'][$name] = 'ready';
                                } else {
                                        // Load from load.php?only=styles via <link rel=stylesheet>
                                        $data['styles'][] = $name;
index 6529ef4..7c1b2ce 100644 (file)
        "wrongpasswordempty": "كلمة السر المدخلة كانت فارغة.\nمن فضلك حاول مرة أخرى.",
        "passwordtooshort": "يجب أن تتكون كلمة السر على الأقل من {{PLURAL:$1|حرف واحد|حرفين|$1 حروف|$1 حرفا|$1 حرف}}.",
        "passwordtoolong": "كلمات السر لا يجب أن تكون أطول من  {{PLURAL:$1|1 حرف|$1 حروف}}.",
-       "passwordtoopopular": "Ù\83Ù\84Ù\85ات Ø§Ù\84Ù\85رÙ\88ر Ø§Ù\84شائعة Ù\84ا Ù\8aÙ\85Ù\83Ù\86 Ø§Ø³ØªØ®Ø¯Ø§Ù\85Ù\87ا. Ø¨Ø±Ø¬Ø§Ø¡ Ø§Ø®ØªÙ\8aار Ù\83Ù\84Ù\85Ø© Ù\85رÙ\88ر Ø£Ù\83ثر Ù\81رادة.",
+       "passwordtoopopular": "Ù\84ا Ù\8aÙ\85Ù\83Ù\86 Ø§Ø³ØªØ®Ø¯Ø§Ù\85 Ù\83Ù\84Ù\85ات Ø§Ù\84Ù\85رÙ\88ر Ø§Ù\84Ù\85ختارة Ø¨Ø´Ù\83Ù\84 Ø¹Ø§Ù\85; Ù\8aÙ\8fرجÙ\8eÙ\89 Ø§Ø®ØªÙ\8aار Ù\83Ù\84Ù\85Ø© Ù\85رÙ\88ر Ù\8aصعب ØªØ®Ù\85Ù\8aÙ\86Ù\87ا.",
        "password-name-match": "يجب أن تكون كلمة المرور مختلفة عن اسم المستخدم.",
        "password-login-forbidden": "تم منع استخدام اسم المستخدم هذا وكلمة السر.",
        "mailmypassword": "أعد تعيين كلمة السر",
index ef0d078..b4fb113 100644 (file)
        "wrongpasswordempty": "Быў уведзены пусты пароль. Калі ласка, паспрабуйце яшчэ раз.",
        "passwordtooshort": "Паролі павінны ўтрымліваць ня менш за $1 {{PLURAL:$1|сымбаль|сымбалі|сымбаляў}}.",
        "passwordtoolong": "Паролі ня могуць быць даўжэй за $1 {{PLURAL:$1|сымбаль|сымбалі|сымбаляў}}.",
-       "passwordtoopopular": "Ð\9dелÑ\8cга Ð²Ñ\8bкаÑ\80Ñ\8bÑ\81Ñ\82оÑ\9eваÑ\86Ñ\8c Ð¿Ñ\80оÑ\81Ñ\82Ñ\8bÑ\8f Ð¿Ð°Ñ\80олÑ\96. Ð\9aалÑ\96 Ð»Ð°Ñ\81ка, Ð°Ð±Ñ\8fÑ\80Ñ\8bÑ\86е Ð±Ð¾Ð»Ñ\8cÑ\88 Ñ\81кладанÑ\8b Ð¿Ð°Ñ\80оль.",
+       "passwordtoopopular": "Ð\9dелÑ\8cга Ð²Ñ\8bкаÑ\80Ñ\8bÑ\81Ñ\82оÑ\9eваÑ\86Ñ\8c Ð¿Ñ\80оÑ\81Ñ\82Ñ\8bÑ\8f Ð¿Ð°Ñ\80олÑ\96. Ð\9aалÑ\96 Ð»Ð°Ñ\81ка, Ð°Ð±Ñ\8fÑ\80Ñ\8bÑ\86е Ð¿Ð°Ñ\80олÑ\8c, Ñ\8fкÑ\96 Ð·Ð½Ð°Ñ\87на Ñ\86Ñ\8fжÑ\8dй Ð¿Ð°Ð´Ð°Ð±Ñ\80аÑ\86ь.",
        "password-name-match": "Ваш пароль павінен адрозьнівацца ад Вашага імя ўдзельніка.",
        "password-login-forbidden": "Выкарыстаньне гэтага імя ўдзельніка і паролю было забароненае.",
        "mailmypassword": "Скінуць пароль",
        "right-import": "Імпарт старонак зь іншых вікі",
        "right-importupload": "Імпарт старонак праз загрузку файлаў",
        "right-patrol": "Пазначэньне рэдагаваньняў як «патруляваных»",
-       "right-autopatrol": "аўтаматычнае пазначэньне рэдагаваньняў як «патруляваных»",
+       "right-autopatrol": "Ð\90ўтаматычнае пазначэньне рэдагаваньняў як «патруляваных»",
        "right-patrolmarks": "прагляд пазначэньняў пра патруляваньне ў апошніх зьменах",
        "right-unwatchedpages": "прагляд сьпісу старонак, за якімі ніхто не назірае",
        "right-mergehistory": "аб’яднаньне гісторыі старонак",
index 378d9be..5f1419d 100644 (file)
        "undo-summary-username-hidden": "Poništi izmjenu $1 od skrivenog korisnika",
        "cantcreateaccount-text": "Pravljenje korisničkog računa sa ove IP adrese ('''$1''') je blokirano od strane [[User:$3|$3]].\n\nRazlog koji je naveo $3 je ''$2''",
        "cantcreateaccount-range-text": "Pravljenje računa sa IP adresa u rasponu <strong>$1</strong>, koji uključuje i vašu IP adresu (<strong>$4</strong>), je blokirao korisnik [[User:$3|$3]].\n\nNavedeni razlog korisnika $3 je <em>$2</em>",
-       "viewpagelogs": "Pogledaj zapisnike ove stranice",
+       "viewpagelogs": "Prikaži zapisnike ove stranice",
        "nohistory": "Ne postoji historija izmjena za ovu stranicu.",
        "currentrev": "Trenutna verzija",
        "currentrev-asof": "Trenutna verzija na dan $2 u $3",
        "emailmessage": "Poruka:",
        "emailsend": "Pošalji",
        "emailccme": "Pošalji mi kopiju moje poruke e-poštom.",
-       "emailccsubject": "Kopija Vaše poruke za $1: $2",
+       "emailccsubject": "Kopija Vaše poruke korisniku/-ci $1: $2",
        "emailsent": "Poruka poslata",
        "emailsenttext": "Vaša poruka je poslata e-poštom.",
        "emailuserfooter": "Ovu e-poruku {{GENDER:$1|poslao|poslala}} je $1 {{GENDER:$2|korisniku|korisnici}} $2 pomoću funkcije \"{{int:emailuser}}\" s {{GRAMMAR:genitiv|{{SITENAME}}}}. Ako {{GENDER:$2|odgovorite}} na ovu e-poruku, {{GENDER:$2|Vaša}} će se poruka direktno poslati {{GENDER:$1|originalnom pošiljaocu|originalnoj pošiljatejici}} i otkrit ćete {{GENDER:$1|mu|joj}} {{GENDER:$2|svoju}} adresu e-pošte.",
index 27e1729..7215225 100644 (file)
        "searchrelated": "پەیوەست",
        "searchall": "ھەموو",
        "showingresults": "لە خوارەوە {{PLURAL:$1|'''یەک''' ئەنجام|'''$1''' ئەنجام}} نیشان دراوە، بە دەست پێ کردن لە ژمارەی '''$2'''ەوە.",
+       "showingresultsinrange": "لە خوارەوە زیاتر لە <strong>$1</strong> ئەنجام لە مەودای #$2 بۆ #<strong>$3</strong> پیشان دەدرێت.",
        "search-showingresults": "{{PLURAL:$4|ئاکامی <strong>$1</strong> لە <strong>$3</strong>|ئاکامەکانی <strong>$1 - $2</strong> لە <strong>$3</strong>}}",
        "search-nonefound": "ھیچ ئاکامێک کە بە داواکارییەکەت بخوا نەدۆزرایەوە.",
        "powersearch-legend": "گەڕانی پێشکەوتوو",
index 22847e5..0873467 100644 (file)
        "wrongpasswordempty": "Es wurde kein Passwort eingegeben. Bitte versuche es erneut.",
        "passwordtooshort": "Passwörter müssen mindestens {{PLURAL:$1|1 Zeichen|$1 Zeichen}} lang sein.",
        "passwordtoolong": "Passwörter können nicht länger als {{PLURAL:$1|ein|$1}} Zeichen sein.",
-       "passwordtoopopular": "Häufig ausgewählte Passwörter können nicht verwendet werden. Bitte wähle ein einzigartigeres Passwort aus.",
+       "passwordtoopopular": "Häufig ausgewählte Passwörter können nicht verwendet werden. Bitte wähle ein Passwort aus, das schwieriger zu erraten ist.",
        "password-name-match": "Dein Passwort muss sich von deinem Benutzernamen unterscheiden.",
        "password-login-forbidden": "Die Verwendung dieses Benutzernamens und Passwortes ist nicht erlaubt.",
        "mailmypassword": "Passwort zurücksetzen",
index fb13329..2a4f1d9 100644 (file)
        "wrongpasswordempty": "No has escrito una contraseña.\nInténtalo de nuevo.",
        "passwordtooshort": "Las contraseñas deben tener al menos {{PLURAL:$1|1 carácter|$1 caracteres}}.",
        "passwordtoolong": "Las contraseñas no deben tener más de {{PLURAL:$1|1 carácter|$1 caracteres}}.",
-       "passwordtoopopular": "No se pueden usar las contraseñas más comunes. Elige una menos popular.",
+       "passwordtoopopular": "No es posible utilizar las contraseñas más comunes. Elige una que sea más difícil de descifrar.",
        "password-name-match": "Tu contraseña debe ser diferente de tu nombre de usuario.",
        "password-login-forbidden": "El uso de este nombre de usuario y contraseña han sido prohibidos.",
        "mailmypassword": "Restablecer la contraseña",
        "whatlinkshere-hideimages": "$1 enlaces a archivos",
        "whatlinkshere-filters": "Filtros",
        "whatlinkshere-submit": "Ir",
-       "autoblockid": "Bloqueo automático #$1",
+       "autoblockid": "Bloqueo automático n.º $1",
        "block": "Bloquear usuario",
        "unblock": "Desbloquear usuario",
        "blockip": "Bloquear {{GENDER:$1|al usuario|a la usuaria}}",
index ccd0a35..1095b2f 100644 (file)
        "wrongpasswordempty": "Vous n’avez entré aucun mot de passe.\nVeuillez essayer à nouveau.",
        "passwordtooshort": "Votre mot de passe doit contenir au moins $1 caractère{{PLURAL:$1||s}}.",
        "passwordtoolong": "Les mots de passe ne peuvent pas dépasser $1 caractère{{PLURAL:$1||s}}.",
-       "passwordtoopopular": "Les mots de passe trop courants ne peuvent pas être utilisés. Veuillez choisir un mot de passe plus original.",
+       "passwordtoopopular": "Les mots de passe trop courants ne peuvent pas être utilisés. Veuillez choisir un mot de passe plus difficile à deviner.",
        "password-name-match": "Votre mot de passe doit être différent de votre nom d’utilisateur.",
        "password-login-forbidden": "L’utilisation de ce nom d’utilisateur ou de ce mot de passe a été interdite.",
        "mailmypassword": "Réinitialiser le mot de passe",
index 0a665e3..c01afb9 100644 (file)
        "laggedslavemode": "<strong>אזהרה:</strong> הדף עשוי שלא להכיל עדכונים אחרונים.",
        "readonly": "בסיס הנתונים נעול",
        "enterlockreason": "יש להקליד סיבה לנעילה, כולל הערכה למועד שחרור הנעילה",
-       "readonlytext": "בסיס הנתונים נעול כרגע להזנת נתונים ולשינויים אחרים. ככל הנראה, מדובר בתחזוקה שוטפת, שלאחריה יחזור האתר לפעולתו הרגילה.\n\nמנהל המערכת שנעל את בסיס הנתונים סיפק את ההסבר הבא: $1",
+       "readonlytext": "×\91ס×\99ס ×\94נת×\95× ×\99×\9d × ×¢×\95×\9c ×\9bר×\92×¢ ×\9c×\94×\96נת × ×ª×\95× ×\99×\9d ×\97×\93ש×\99×\9d ×\95×\9cש×\99× ×\95×\99×\99×\9d ×\90×\97ר×\99×\9d. ×\9b×\9b×\9c ×\94נר×\90×\94, ×\9e×\93×\95×\91ר ×\91ת×\97×\96×\95ק×\94 ×©×\95×\98פת, ×©×\9c×\90×\97ר×\99×\94 ×\99×\97×\96×\95ר ×\94×\90תר ×\9cפע×\95×\9cת×\95 ×\94ר×\92×\99×\9c×\94.\n\n×\9e× ×\94×\9c ×\94×\9eער×\9bת ×©× ×¢×\9c ×\90ת ×\91ס×\99ס ×\94נת×\95× ×\99×\9d ×¡×\99פק ×\90ת ×\94×\94ס×\91ר ×\94×\91×\90: $1",
        "missing-article": "בסיס הנתונים לא מצא את הטקסט של הדף שהוא היה אמור למצוא, בשם \"$1\" $2.\n\nזה נגרם בדרך־כלל עקב לחיצה על קישור ישן לגרסה של דף שנמחק.\n\nאם זה אינו המקרה, זהו כנראה באג בתוכנה.\nנא לדווח על כך ל[[Special:ListUsers/sysop|מפעיל מערכת]], תוך שמירת פרטי כתובת ה־URL.",
        "missingarticle-rev": "(מספר גרסה: $1)",
        "missingarticle-diff": "(השוואת הגרסאות: $1, $2)",
        "title-invalid-interwiki": "כותרת הדף המבוקש מכילה קישור בינוויקי, שלא ניתן להשתמש בו בכותרות.",
        "title-invalid-talk-namespace": "כותרת הדף המבוקש מפנה לדף שיחה שאינו יכול להתקיים.",
        "title-invalid-characters": "כותרת הדף המבוקש מכילה תווים בלתי תקינים: \"$1\".",
-       "title-invalid-relative": "×\91×\9b×\95תרת ×\99ש × ×ª×\99×\91 ×\99×\97ס×\99. ×\9b×\95תר×\95ת ×\93פ×\99×\9d ×\99×\97ס×\99×\95ת (./, ../) ×\90×\99× ×\9f ×ª×§×\99× ×\95ת, ×\9eש×\95×\9d ×©×\9cעת×\99×\9d ×§×¨×\95×\91×\95ת ×\94×\9f ×\99×\94×\99×\95 ×\91×\9cת×\99Ö¾× ×\99תנ×\95ת ×\9c×\94ש×\92×\94 ×\9bשת×\98×\95פ×\9c× ×\94 ×¢×\9cÖ¾ידי הדפדפן של המשתמש.",
+       "title-invalid-relative": "×\91×\9b×\95תרת ×\99ש × ×ª×\99×\91 ×\99×\97ס×\99. ×\9b×\95תר×\95ת ×\93פ×\99×\9d ×\99×\97ס×\99×\95ת (./, ../) ×\90×\99× ×\9f ×ª×§×\99× ×\95ת, ×\9b×\99×\95×\95×\9f ×©×\9cעת×\99×\9d ×§×¨×\95×\91×\95ת ×\9c×\90 × ×\99ת×\9f ×\99×\94×\99×\94 ×\9c×\92שת ×\90×\9c×\99×\94×\9f ×\90×\9d ×\94×\9f ×\99×\98×\95פ×\9c×\95 ×\91ידי הדפדפן של המשתמש.",
        "title-invalid-magic-tilde": "כותרת הדף המבוקש מכילה רצף טילדות מיוחד שאינו תקין (<nowiki>~~~</nowiki>).",
        "title-invalid-too-long": "כותרת הדף המבוקש ארוכה מדי. היא צריכה להיות לכל היותר באורך של {{PLURAL:$1|בית אחד|$1 בתים}} בקידוד UTF-8.",
        "title-invalid-leading-colon": "כותרת הדף המבוקש מכילה תו נקודתיים בלתי תקין בתחילתה.",
        "wrongpasswordempty": "הסיסמה שהזנת ריקה.\nנא לנסות שוב.",
        "passwordtooshort": "סיסמאות חייבות להיות באורך {{PLURAL:$1|תו אחד|$1 תווים}} לפחות.",
        "passwordtoolong": "סיסמאות אינן יכולות להיות ארוכות {{PLURAL:$1|מתו אחד|מ־$1 תווים}}.",
-       "passwordtoopopular": "×\9c×\90 × ×\99ת×\9f ×\9c×\94שת×\9eש ×\91ס×\99ס×\9e×\90×\95ת × ×¤×\95צ×\95ת. ×\99ש ×\9c×\91×\97×\95ר ×¡×\99ס×\9e×\94 ×\99×\99×\97×\95×\93×\99ת ×\99×\95תר.",
+       "passwordtoopopular": "×\9c×\90 × ×\99ת×\9f ×\9c×\94שת×\9eש ×\91ס×\99ס×\9e×\90×\95ת × ×¤×\95צ×\95ת. ×\99ש ×\9c×\91×\97×\95ר ×¡×\99ס×\9e×\94 ×§×©×\94 ×\99×\95תר ×\9c× ×\99×\97×\95ש.",
        "password-name-match": "סיסמתך חייבת להיות שונה משם המשתמש שלך.",
        "password-login-forbidden": "השימוש בשם המשתמש והסיסמה האלה נאסר.",
        "mailmypassword": "איפוס סיסמה",
        "searchprofile-advanced": "מתקדם",
        "searchprofile-articles-tooltip": "חיפוש $1",
        "searchprofile-images-tooltip": "חיפוש קבצים",
-       "searchprofile-everything-tooltip": "×\97×\99פ×\95ש ×\91×\9b×\9c ×\94ת×\95×\9b×\9f (×\9c×\9e×¢×\98 דפי השיחה)",
+       "searchprofile-everything-tooltip": "×\97×\99פ×\95ש ×\91×\9b×\9c ×\94ת×\95×\9b×\9f (×\9b×\95×\9c×\9c דפי השיחה)",
        "searchprofile-advanced-tooltip": "חיפוש במרחבי שם מותאמים אישית",
        "search-result-size": "$1 ({{PLURAL:$2|מילה אחת|$2 מילים}})",
        "search-result-category-size": "{{PLURAL:$1|פריט אחד|$1 פריטים}} ({{PLURAL:$2|קטגוריית משנה אחת|$2 קטגוריות משנה}}, {{PLURAL:$3|קובץ אחד|$3 קבצים}})",
        "recentchanges-label-unpatrolled": "עריכה זו טרם נבדקה",
        "recentchanges-label-plusminus": "גודל הדף השתנה במספר זה של בתים",
        "recentchanges-legend-heading": "<strong>מקרא:</strong>",
-       "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} ({{GENDER:|ראה|ראי|ראו}} גם את [[Special:NewPages|רשימת הדפים החדשים]])",
+       "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (ר' גם את [[Special:NewPages|רשימת הדפים החדשים]])",
        "recentchanges-legend-plusminus": "(<em>±123</em>)",
        "recentchanges-submit": "הצגה",
        "rcfilters-tag-remove": "הסרת \"$1\"",
        "listfiles-latestversion-no": "לא",
        "file-anchor-link": "קובץ",
        "filehist": "היסטוריית הקובץ",
-       "filehist-help": "× ×\99ת×\9f ×\9c×\9c×\97×\95×¥ ×¢×\9c ×ª×\90ר×\99×\9a/שע×\94 ×\9b×\93×\99 ×\9cר×\90×\95ת ×\90ת ×\94ק×\95×\91×¥ ×\9bפ×\99 ×©× ×¨×\90×\94 ×\91עת ×\96×\95.",
+       "filehist-help": "× ×\99ת×\9f ×\9c×\9c×\97×\95×¥ ×¢×\9c ×ª×\90ר×\99×\9a/שע×\94 ×\9b×\93×\99 ×\9cר×\90×\95ת ×\90ת ×\94ק×\95×\91×¥ ×\9bפ×\99 ×©× ×¨×\90×\94 ×\91×\90×\95ת×\95 ×\96×\9e×\9f.",
        "filehist-deleteall": "מחיקת כל הגרסאות",
        "filehist-deleteone": "מחיקה",
        "filehist-revert": "שחזור",
        "filedelete-comment": "סיבה:",
        "filedelete-submit": "מחיקה",
        "filedelete-success": "הקובץ <strong>$1</strong> נמחק.",
-       "filedelete-success-old": "הגרסה של '''[[Media:$1|$1]]''' מ־$3, $2 נמחקה.",
-       "filedelete-nofile": "'''$1''' אינו קיים.",
-       "filedelete-nofile-old": "אין גרסה ישנה של '''$1''' עם התכונות המבוקשות.",
+       "filedelete-success-old": "הגרסה של הקובץ <strong>[[Media:$1|$1]]</strong> מ־$3, $2 נמחקה.",
+       "filedelete-nofile": "הקובץ <strong>$1</strong> אינו קיים.",
+       "filedelete-nofile-old": "אין גרסה ישנה של הקובץ <strong>$1</strong> עם התכונות המבוקשות.",
        "filedelete-otherreason": "סיבה נוספת/אחרת:",
        "filedelete-reason-otherlist": "סיבה אחרת",
        "filedelete-reason-dropdown": "* סיבות מחיקה נפוצות\n** הפרת זכויות יוצרים\n** קובץ כפול",
        "deletereasonotherlist": "סיבה אחרת",
        "deletereason-dropdown": "* סיבות מחיקה נפוצות\n** ספאם\n** השחתה\n** הפרת זכויות יוצרים\n** לבקשת הכותב\n** הפניה שבורה",
        "delete-edit-reasonlist": "עריכת סיבות המחיקה",
-       "delete-toobig": "×\9c×\93×£ ×\96×\94 ×\99ש ×\94×\99ס×\98×\95ר×\99×\99ת ×¢×¨×\99×\9b×\95ת ×\92×\93×\95×\9c×\94, ×\95×\94×\95×\90 ×\9e×\9b×\99×\9c יותר {{PLURAL:$1|מגרסה אחת|מ־$1 גרסאות}}.\nמחיקת דפים כאלה הוגבלה כדי למנוע בעיות בתפקוד של {{SITENAME}}.",
+       "delete-toobig": "×\9c×\93×£ ×\96×\94 ×\99ש ×\94×\99ס×\98×\95ר×\99×\99ת ×¢×¨×\99×\9b×\95ת ×\92×\93×\95×\9c×\94, ×©×\9e×\9b×\99×\9c×\94 יותר {{PLURAL:$1|מגרסה אחת|מ־$1 גרסאות}}.\nמחיקת דפים כאלה הוגבלה כדי למנוע בעיות בתפקוד של {{SITENAME}}.",
        "delete-warning-toobig": "דף זה כולל מעל {{PLURAL:$1|גרסה אחת|$1 גרסאות}} בהיסטוריית העריכות שלו. מחיקה שלו עלולה להפריע לפעולות בבסיס הנתונים; אנא שקלו שנית את המחיקה.",
        "deleteprotected": "אין {{GENDER:|באפשרותך|באפשרותך|באפשרותכם}} למחוק את הדף כי הוא מוגן.",
        "deleting-backlinks-warning": "<strong>אזהרה:</strong> [[Special:WhatLinksHere/{{FULLPAGENAME}}|דפים אחרים]] מקשרים לדף ש{{GENDER:|אתה עומד|את עומדת|אתם עומדים}} למחוק או מכלילים אותו.",
        "lockedbyandtime": "(על־ידי $1 ב־$3, $2)",
        "move-page": "העברת הדף \"$1\"",
        "move-page-legend": "העברת דף",
-       "movepagetext": "ניתן להשתמש בטופס שלהלן כדי לשנות את השם של הדף הזה ולהעביר את כל היסטוריית העריכות שלו לשם החדש.\nהשם הישן יהפוך לדף הפניה אל השם החדש.\nבאפשרותך לעדכן באופן אוטומטי דפי הפניה שכרגע מפנים לשם הנוכחי של הדף.\nנא לוודא לאחר ההעברה שאין [[Special:DoubleRedirects|הפניות כפולות]] או [[Special:BrokenRedirects|הפניות שבורות]].\nכמו כן, באחריותך לוודא שכל הקישורים ימשיכו לקשר למקומות שאליהם הם אמורים לקשר.\n\nיש לשים לב לכך שהדף <strong>לא</strong> יועבר אם כבר יש דף תחת השם החדש, אלא אם כן הדף עם השם החדש הוא הפניה ואין לו עריכות קודמות.\nזה אומר שניתן יהיה להחזיר את הדף לשם המקורי במקרה שתיעשה טעות, אבל לא ניתן \"לדרוס\" דף קיים.\n\n<strong>לתשומת לבך:</strong>\nהעברה זו עלולה להיות שינוי דרסטי ומהותי לדף פופולרי;\nיש לקחת בחשבון את התוצאות של הפעולה הזאת לפני ביצוע ההעברה.",
+       "movepagetext": "ניתן להשתמש בטופס שלהלן כדי לשנות את השם של הדף הזה ולהעביר את כל היסטוריית העריכות שלו לשם החדש.\nהשם הישן יהפוך לדף הפניה אל השם החדש.\nבאפשרותך לעדכן באופן אוטומטי דפי הפניה שכרגע מפנים לשם הנוכחי של הדף.\nנא לוודא לאחר ההעברה שאין [[Special:DoubleRedirects|הפניות כפולות]] או [[Special:BrokenRedirects|הפניות שבורות]] (אלא אם כן בחרת לבצע את העדכון האוטומטי הנ\"ל).\nכמו כן, באחריותך לוודא שכל הקישורים ימשיכו לקשר למקומות שאליהם הם אמורים לקשר.\n\nיש לשים לב לכך שהדף <strong>לא</strong> יועבר אם כבר יש דף תחת השם החדש, אלא אם כן הדף עם השם החדש הוא הפניה ואין לו עריכות קודמות.\nזה אומר שניתן יהיה להחזיר את הדף לשם המקורי במקרה שתיעשה טעות, אבל לא ניתן \"לדרוס\" דף קיים.\n\n<strong>לתשומת לבך:</strong>\nהעברה זו עלולה להיות שינוי דרסטי ומהותי לדף פופולרי;\nיש לקחת בחשבון את התוצאות של הפעולה הזאת לפני ביצוע ההעברה.",
        "movepagetext-noredirectfixer": "ניתן להשתמש בטופס שלהלן כדי לשנות את השם של הדף הזה ולהעביר את כל היסטוריית העריכות שלו לשם החדש.\nהשם הישן יהפוך לדף הפניה אל השם החדש.\nנא לוודא לאחר ההעברה שאין [[Special:DoubleRedirects|הפניות כפולות]] או [[Special:BrokenRedirects|הפניות שבורות]].\nכמו כן, באחריותך לוודא שכל הקישורים ימשיכו לקשר למקומות שאליהם הם אמורים לקשר.\n\nיש לשים לב לכך שהדף <strong>לא</strong> יועבר אם כבר יש דף תחת השם החדש, אלא אם כן הדף עם השם החדש הוא הפניה ואין לו עריכות קודמות.\nזה אומר שניתן יהיה להחזיר את הדף לשם המקורי במקרה שתיעשה טעות, אבל לא ניתן \"לדרוס\" דף קיים.\n\n<strong>לתשומת לבך:</strong>\nהעברה זו עלולה להיות שינוי דרסטי ומהותי לדף פופולרי;\nיש לקחת בחשבון את התוצאות של הפעולה הזאת לפני ביצוע ההעברה.",
        "movepagetalktext": "אם האפשרות הזאת מסומנת, דף השיחה של הדף הזה יועבר אוטומטית לשם החדש, אלא אם קיים דף שיחה שאינו ריק תחת השם החדש. במקרה כזה, יש להעביר או למזג את הדפים באופן ידני, במידת הצורך.",
        "moveuserpage-warning": "'''אזהרה:''' אתם עומדים להעביר דף משתמש. שימו לב שרק הדף יועבר וששם המשתמש '''לא''' ישתנה.",
        "tooltip-pt-login-private": "יש להיכנס לחשבון כדי להשתמש באתר הוויקי הזה",
        "tooltip-pt-logout": "יציאה מהחשבון",
        "tooltip-pt-createaccount": "מומלץ ליצור חשבון ולהיכנס אליו, אך אין חובה לעשות זאת",
-       "tooltip-ca-talk": "ש×\99×\97×\94 ×¢×\9c ×\93×£ ×\96×\94",
+       "tooltip-ca-talk": "ש×\99×\97×\94 ×¢×\9c ×\93×£ ×\94ת×\95×\9b×\9f",
        "tooltip-ca-edit": "עריכת דף זה",
        "tooltip-ca-addsection": "הוספת פסקה חדשה",
        "tooltip-ca-viewsource": "דף זה מוגן.\nבאפשרותך לצפות בקוד המקור שלו",
        "tooltip-n-currentevents": "מציאת מידע רקע על האירועים האחרונים",
        "tooltip-n-recentchanges": "רשימת השינויים האחרונים באתר",
        "tooltip-n-randompage": "טעינת דף אקראי",
-       "tooltip-n-help": "×¢×\96ר×\94 ×\91ש×\99×\9e×\95ש ×\91×\90תר",
-       "tooltip-t-whatlinkshere": "רש×\99×\9e×\94 ×©×\9c ×\9b×\9c ×\94×\93פ×\99×\9d ×©×\9e×\9b×\99×\9c×\99×\9d ×§×\99ש×\95ר×\99×\9d ×\9c×\93×£ ×\94×\96ה",
+       "tooltip-n-help": "×\94×\9eק×\95×\9d ×\9c×\9eצ×\95×\90 ×\9e×\99×\93×¢",
+       "tooltip-t-whatlinkshere": "רש×\99×\9e×\94 ×©×\9c ×\9b×\9c ×\93פ×\99 ×\94×\95×\95×\99ק×\99 ×©×\9eקשר×\99×\9d ×\94× ה",
        "tooltip-t-recentchangeslinked": "השינויים האחרונים שבוצעו בדפים המקושרים מדף זה",
        "tooltip-feed-rss": "הזנת RSS עבור דף זה",
        "tooltip-feed-atom": "הזנת Atom עבור דף זה",
index 1b66db2..2ff1f91 100644 (file)
        "category-subcat-count-limited": "Ova kategorija ima {{PLURAL:$1|podkategoriju|$1 podkategorije|$1 podkategorija}}.",
        "category-article-count": "{{PLURAL:$2|1=Ova kategorija sadržava samo sljedeću stranicu.|{{PLURAL:$1|Prikazana je $1 stranica|Prikazane su $1 stranice|Prikazano je $1 stranica}} u ovoj kategoriji, od ukupno $2.}}",
        "category-article-count-limited": "{{PLURAL:$1|stranica je|$1 stranice su|$1 stranica je}} u ovoj kategoriji.",
-       "category-file-count": "Ova kategorija sadrži $2 {{PLURAL:$2|datoteku|datoteke|datoteka}}. {{PLURAL:$1|Slijedi $1 datoteka|Slijede $1 datoteke|Slijedi $1 datoteka}}.",
+       "category-file-count": "{{PLURAL:$2|1=Ova kategorija sadržava samo sljedeću datoteku.|{{PLURAL:$1|Prikazana je $1 datoteka|Prikazane su $1 datoteke|Prikazano je $1 datoteka}} u ovoj kategoriji, od njih ukupno $2.}}",
        "category-file-count-limited": "{{PLURAL:$1|datoteka je|$1 datoteke su|$1 datoteka su}} u ovoj kategoriji.",
        "listingcontinuesabbrev": "nast.",
        "index-category": "Indeksirane stranice",
        "readonlywarning": "<strong>Upozorenje: Baza podataka je zaključana zbog održavanja, stoga trenutačno niste u mogućnosti spremiti svoja uređivanja.</strong>\nMožda biste željeli preslikati i zaljepite tekst u tekstualnu datoteku, te ju snimiti za kasnije upotrebe.'''\n\nAdministrator sustava koji je zaključao bazu ponudio je ovo objašnjenje: $1",
        "protectedpagewarning": "'''UPOZORENJE: Ova stranica je zaključana i mogu je uređivati samo suradnici s administratorskim pravima.'''\nPosljednja stavka u evidenciji navedena je niže kao napomena:",
        "semiprotectedpagewarning": "'''Napomena:''' Ova stranica je zaključana tako da je mogu uređivati samo prijavljeni suradnici.\nPosljednja stavka u evidenciji navedena je niže kao napomena:",
-       "cascadeprotectedwarning": "'''UPOZORENJE:''' Ova stranica je zaključana i mogu je uređivati samo suradnici s administratorskim pravima, jer je uključena u {{PLURAL:$1|slijedeću stranicu|slijedeće stranice}} koje su zaštićene \"prenosivom\" zaštitom:",
+       "cascadeprotectedwarning": "<strong>Upozorenje:</strong> Ova stranica je zaključana i mogu je uređivati samo suradnici s [[Special:ListGroupRights|posebnim pravima]], jer je uključena u {{PLURAL:$1|sljedeću stranicu koja je|sljedeće stranice koje su}} zaštićene \"prenosivom\" zaštitom:",
        "titleprotectedwarning": "<strong>Upozorenje: Ova je stranica zaključana i samo ju suradnici s [[Special:ListGroupRights|određenim pravima]] mogu stvoriti.</strong>\nPosljednja stavka u evidenciji navedena je niže kao napomena:",
        "templatesused": "{{PLURAL:$1|Predložak koji se rabi|Predlošci koji se rabe}} na ovoj stranici:",
        "templatesusedpreview": "{{PLURAL:$1|Predložak koji se rabi|Predlošci koji se rabe}} u ovom pretpregledu:",
        "emailmessage": "Poruka:",
        "emailsend": "Pošalji",
        "emailccme": "Pošalji mi presliku moje poruke e-poštom.",
-       "emailccsubject": "Kopija Vaše poruke za $1: $2",
+       "emailccsubject": "Kopija Vaše poruke za: $1: $2",
        "emailsent": "E-poruka je poslana!",
        "emailsenttext": "Vaša poruka je poslana.",
        "emailuserfooter": "Ovu je e-poruku {{GENDER:$1|poslao suradnik|poslala suradnica}} $1 {{GENDER:$2|suradniku $2|suradnici $2}} uporabom mogućnosti \"{{int:emailuser}}\" s projekta {{SITENAME}}. Ukoliko {{GENDER:$2|odgovorite}} na tu e-poruku, {{GENDER:$2|Vaša}} će poruka biti izravno poslana {{GENDER:$1|izvornom pošiljatelju}}, otkrivajući pritom {{GENDER:$2|Vašu}} adresu e-pošte {{GENDER:$1|pošiljatelju|pošiljateljici}}.",
index 6f59922..a4e22ce 100644 (file)
@@ -87,7 +87,7 @@
        "tog-watchlisthideminor": "Apró változtatások elrejtése",
        "tog-watchlisthideliu": "Bejelentkezett szerkesztők módosításainak elrejtése a figyelőlistáról",
        "tog-watchlistreloadautomatically": "A figyelőlista automatikus újratöltése bármelyik szűrő megváltoztatása esetén (JavaScript szükséges)",
-       "tog-watchlistunwatchlinks": "Közvetlen olvasottnak/olvasatlannak jelölő link hozzáadása a figyelőlista elemeihez (JavaScript szükséges)",
+       "tog-watchlistunwatchlinks": "Figyelőlista elemeinek eltávolítására szolgáló közvetlen link hozzáadása (JavaScript szükséges)",
        "tog-watchlisthideanons": "Névtelen szerkesztések elrejtése",
        "tog-watchlisthidepatrolled": "Az ellenőrzött szerkesztések elrejtése",
        "tog-watchlisthidecategorization": "Lapok kategorizálásának elrejtése",
index d159c91..2205dff 100644 (file)
        "nstab-media": "Media pagino",
        "nstab-special": "Specala pagino",
        "nstab-project": "Projeto pagino",
-       "nstab-image": "Failo",
+       "nstab-image": "Arkivo",
        "nstab-mediawiki": "Mesajo",
        "nstab-template": "Shablono",
        "nstab-help": "Helpo",
        "prefs-advancedwatchlist": "Progresiva selektaji (advanced options)",
        "prefs-diffs": "Diferi",
        "userrights-user-editname": "Skribez uzantonomo:",
+       "editusergroup": "Charjez grupi dil uzero",
        "userrights-groupsmember": "Membro di:",
        "group": "Grupo:",
        "group-user": "Uzanti",
index 91d6235..59aa484 100644 (file)
        "wrongpasswordempty": "Non è stata inserita alcuna password. Riprovare.",
        "passwordtooshort": "Le password devono contenere almeno {{PLURAL:$1|1 carattere|$1 caratteri}}.",
        "passwordtoolong": "La password non può contenere più di {{PLURAL:$1|1 carattere|$1 caratteri}}.",
-       "passwordtoopopular": "Password comuni non possono essere usate. Scegli una password più originale.",
+       "passwordtoopopular": "Password comuni non possono essere usate. Scegli una password più difficile da indovinare.",
        "password-name-match": "La password deve essere diversa dal nome utente.",
        "password-login-forbidden": "L'uso di questo nome utente e password è stato proibito.",
        "mailmypassword": "Reimposta password",
index e1c432c..6c5f011 100644 (file)
        "edithelp": "Hulpe mit bewarken",
        "helppage-top-gethelp": "Hulpe",
        "mainpage": "Vöärblad",
-       "mainpage-description": "Veurblad",
+       "mainpage-description": "Vöärblad",
        "policy-url": "Project:Beleid",
        "portal": "Gebrukersportål",
        "portal-url": "Project:Gebrukersportaol",
        "confirmrecreate": "Gebruker [[User:$1|$1]] ([[User talk:$1|Overleg]]) hef disse zied vortedaon naoda'j  begunnen bin mit joew wieziging, mit opgave van de volgende reden: ''$2''. Bevestig da'j t artikel herschrieven willen.",
        "confirmrecreate-noreason": "Gebruker [[User:$1|$1]] ([[User talk:$1|overleg]]) hef disse zied vortedaon naoda'j  begunnen bin mit joew wieziging. Bevestig da'j t artikel herschrieven willen.",
        "recreate": "Herschrieven",
+       "confirm-purge-title": "Herny disse syde",
        "confirm_purge_button": "Bevestig",
-       "confirm-purge-top": "Klik op 'bevestig' um t tussengeheugen van disse zied te legen.",
-       "confirm-purge-bottom": "t Leegmaken van t tussengeheugen zörgt derveur da'j de leste versie van n zied zien.",
+       "confirm-purge-top": "Klik up 'bevestig' üm et tüskengehöägen van disse syde te leagen.",
+       "confirm-purge-bottom": "Et leagmaken van et tüskengehöägen sörgt dervöär dat jy de lätste versy van een syde te syn krygen.",
        "confirm-watch-button": "Oké",
        "confirm-watch-top": "Disse zied op joew volglieste zetten?",
        "confirm-unwatch-button": "Oké",
index 0059c11..4527809 100644 (file)
        "laggedslavemode": "Åtvaring: Det er mogleg at sida ikkje er heilt oppdatert.",
        "readonly": "Databasen er skriveverna",
        "enterlockreason": "Skriv ein grunn for vernet, inkludert eit overslag for kva tid det vil bli oppheva",
-       "readonlytext": "Databasen er akkurat no skriveverna, truleg for rutinemessig vedlikehald. Administratoren som verna han har gjeve denne forklaringa:\n\n$1",
+       "readonlytext": "Databasen er nett no skriveverna for nye oppslag og andre endringar, truleg for rutinemessig vedlikehald. Etterpå vil han opnast att. Administratoren som verna han gav denne forklaringa:\n\n$1",
        "missing-article": "Databasen burde ha funne sida «$1» $2, men det gjorde han ikkje.\n\nDei vanlegaste årsakene til denne feilen er ei lenkje til ein skilnad mellom forskjellige versjonar eller lenkjer til ein gammal versjon av ei side som har vorte sletta.\n\nOm det ikkje er tilfellet kan du ha funne ein feil i programvara.\nMeld gjerne problemet til ein [[Special:ListUsers/sysop|administrator]] og oppgje då adressa til sida.",
        "missingarticle-rev": "(versjon $1)",
        "missingarticle-diff": "(jamføring av versjon $1 og $2)",
        "createacct-realname": "Sant namn (valfritt)",
        "createacct-reason": "Årsak",
        "createacct-reason-ph": "Kvifor du lagar ein ny konto",
+       "createacct-reason-help": "Melding vist i kontoopprettingsloggen",
        "createacct-submit": "Opprett kontoen din",
        "createacct-another-submit": "Opprett konto",
        "createacct-continue-submit": "Hald fram med kontooppretting",
        "wrongpasswordempty": "Du oppgav ikkje noko passord. Ver venleg og prøv igjen.",
        "passwordtooshort": "Passord må innehalda minst {{PLURAL:$1|eitt teikn|$1 teikn}}.",
        "passwordtoolong": "Passord kan ikkje vera lengre enn {{PLURAL:$1|eitt|$1}} teikn.",
-       "passwordtoopopular": "Alminneleg valde passord kan ikkje nyttast. Vel eit meir unikt passord.",
+       "passwordtoopopular": "Alminneleg valde passord kan ikkje nyttast. Ver god å velja eit passord som er vanskelegare å gissa.",
        "password-name-match": "Passordet ditt lyt vera noko anna enn brukarnamnet ditt.",
        "password-login-forbidden": "Bruk av dette brukarnamnet og passordet er vorte forbode.",
        "mailmypassword": "Attendestill passord",
        "noemail": "Det er ikkje registrert noka e-postadresse åt brukaren «$1».",
        "noemailcreate": "Du må oppgje ei gyldig e-postadresse",
        "passwordsent": "Eit nytt passord er sendt åt e-postadressa registrert på brukaren «$1».",
-       "blocked-mailpassword": "IP-adressa di er blokkert frå å endre sider, og du kan difor heller ikkje få nytt passord. Dette er for å hindre misbruk.",
-       "eauthentsent": "Ein stadfestings-e-post er sendt til den oppgjevne e-postadressa. For at adressa skal kunna brukast, må du følgje instruksjonane i e-posten for å stadfeste at ho faktisk tilhøyrer deg.",
-       "throttled-mailpassword": "Ei passordpåminning er allereie sendt {{PLURAL:$1|den siste timen|dei siste $1 timane}}. For å hindre misbruk vert det berre sendt ut nytt passord ein gong kvar {{PLURAL:$1|time|$1. time}}.",
+       "blocked-mailpassword": "IP-adressa di er blokkert frå å endre sider. For å hindre misbruk kan ein heller ikkje ikkje  få nytt passord frå denne adressa.",
+       "eauthentsent": "Det er blitt send ein stadfestings-e-post til den oppgjevne e-postadressa. \n\nFør det blir send fleire e-postar til adressa, må du følgje instruksjonane i e-posten for å stadfeste at ho faktisk tilhøyrer deg.",
+       "throttled-mailpassword": "Ei passordpåminning er allereie sendt {{PLURAL:$1|den siste timen|dei siste $1 timane}}. \nFor å hindre misbruk vert det berre sendt ut nytt passord ein gong kvar {{PLURAL:$1|time|$1. timar}}.",
        "mailerror": "Ein feil oppstod ved sending av e-post: $1",
-       "acct_creation_throttle_hit": "Vitjande på denne wikien som nytta IP-adressa di har alt oppretta {{PLURAL:$1|éin konto|$1 kontoar}} den siste dagen, noko som er det høgaste tillate talet i denne tidsperioden.\nGrunna dette vil ikkje vitjande som nyttar denne IP-adressa kunna oppretta nye kontoar nett no.",
+       "acct_creation_throttle_hit": "Vitjande på denne wikien som nytta IP-adressa di har alt oppretta {{PLURAL:$1|éin konto|$1 kontoar}} den siste $2, noko som er det høgaste tillatne talet i denne tidsperioden.\nGrunna dette vil ikkje vitjande som nyttar denne IP-adressa kunna oppretta nye kontoar nett no.",
        "emailauthenticated": "E-postadressa di vart stadfest $2 klokka $3.",
        "emailnotauthenticated": "E-postadressa di er ikkje stadfest enno. Ingen e-post vil verta send ut for desse funksjonane.",
        "noemailprefs": "Oppgje ei e-postadresse i innstillingane dine for at desse funksjonane skal verke.",
        "user-mail-no-addy": "↓Prøvde å senda e-post utan e-postadresse",
        "user-mail-no-body": "Freista å senda e-post med tom eller urimeleg stutt brødtekst.",
        "changepassword": "Skift passord",
-       "resetpass_announce": "Du logga inn med eit mellombels passord du fekk på e-post. For å fullføre innlogginga må du lage eit nytt passord her:",
+       "resetpass_announce": "For å fullføra innloggingen må du velja eit nytt passord.",
        "resetpass_text": "<!-- Legg til tekst her -->",
        "resetpass_header": "Endra passord",
        "oldpassword": "Gammalt passord",
        "retypenew": "Nytt passord om att",
        "resetpass_submit": "Oppgje passord og logg inn",
        "changepassword-success": "Passordet ditt er no endra!",
+       "changepassword-throttled": "Du har gjort for mange nylege innloggingsforsøk.\nVer god å venta $1 før du prøver igjen.",
        "botpasswords": "Botpassord",
        "resetpass_forbidden": "Passord kan ikkje endrast",
        "resetpass-no-info": "Du må vera innlogga for å få direktetilgang til denne sida.",
        "resetpass-submit-loggedin": "Endra passord",
        "resetpass-submit-cancel": "Avbryt",
        "resetpass-wrong-oldpass": "Ugyldig mellombels eller gjeldande passord.\nDu kan ha bytt passordet allereie, eller bede om å få eit nytt mellombels passord.",
+       "resetpass-recycled": "Ver god og endra passordet til noko anna enn det gjeldande passordet ditt.",
        "resetpass-temp-emailed": "Du logga inn med ein mellombels kode send med e-post.\nFor å fullføra innlogginga lyt du oppgje eit nytt passord her:",
        "resetpass-temp-password": "Mellombels passord:",
        "resetpass-abort-generic": "Passordbytet vart stogga av ei utviding.",
        "passwordreset-emailtext-ip": "Nokon (sannsynlegvis deg, frå IP-adressa $1) bad om ei nullstilling av passordet ditt for {{SITENAME}} ($4). {{PLURAL:$3|Denne brukarkontoen|Desse brukarkontoane}} er knytte til denne e-postadressa:\n\n$2\n\n{{PLURAL:$3|Dette mellombels passordet|Desse mellombels passorda}} går ut om {{PLURAL:$5|éin dag|$5 dagar}}.\nDu bør logga inn og velja eit nytt passord no. Om nokon andre enn deg bad om denne nullstillinga eller du no hugsar det opphavlege passordet og ikkje lenger ynskjer å endra det, kan du sjå bort frå denne meldinga og halda fram med å nytta det gamle passordet ditt.",
        "passwordreset-emailtext-user": "Brukaren $1 på {{SITENAME}} bad om ei påminning for kontodetaljane dine for {{SITENAME}} ($4). {{PLURAL:$3|Den fylgjande brukarkontoen|Dei fylgjande brukarkontoane}} er assosierte med denne e-postadressa:\n\n$2\n\n{{PLURAL:$3|Dette mellombels passordet|Desse mellombels passorda}} vil verta ugilde om {{PLURAL:$5|éin dag|$5 dagar}}.\nDu bør logga inn og velja eit nytt passord no. Om nokon andre enn deg bad om denne påminninga, eller du har kome i hug det opphavlege passordet og ikkje lenger ynskjer å endra det, kan du sjå bort frå denne meldinga og halda fram med å nytta det gamle passordet ditt.",
        "passwordreset-emailelement": "↓Brukarnamn: \n$1\n\nMellombels passord: \n$2",
-       "passwordreset-emailsentemail": "Ein e-post for attendestilling av passord er vorten send",
+       "passwordreset-emailsentemail": "Om denne e-postadressa er knytt til din konto, vil det verte send ein e-post for attendestilling av passordet.",
+       "passwordreset-emailsentusername": "Om ei e-postadresse er knytt til denne kontoen, vil det verte send ein e-post for attendestilling av passordet.",
+       "passwordreset-nocaller": "Du må oppgje ein brukar",
+       "passwordreset-nosuchcaller": "Brukaren finst ikkje: $1",
+       "passwordreset-ignored": "Passordtilbakestillinga vart ikkje handsama. Kanskje ingen leverandør er vorten konfigurert?",
+       "passwordreset-invalidemail": "Ugyldig e-postadresse",
+       "passwordreset-nodata": "Verken eit brukarnamn eller ei e-postadresse vart oppgjeve",
        "changeemail": "Endre eller fjern e-postadresse",
        "changeemail-header": "Fyll ut dette skjemaet for å endre e-postadressa di. Ynskjer du å fjerne tilknytinga ei e-postadresse har til kontoen din, lat feltet for ny e-postadresse stå tomt når du sender inn skjemaet.",
        "changeemail-no-info": "↓Du må vera pålogga for å få tilgang direkte til denne sida.",
        "changeemail-password": "{{SITENAME}}-passordet ditt:",
        "changeemail-submit": "Endre e-post",
        "changeemail-throttled": "Du har freista for mange gonger å logga inn. Du lyt venta $1 før du kan freista på nytt.",
+       "changeemail-nochange": "Ver god å oppgje ei ny e-postadresse.",
        "bold_sample": "Halvfeit skrift",
        "bold_tip": "Halvfeit skrift",
        "italic_sample": "Kursivskrift",
index 3fbb53f..edd2b0c 100644 (file)
        "recentchanges-legend-newpage": "[[w:sr:Посебно:НовеСтране|<u>Н</u>ова страница]]",
        "recentchanges-submit": "Прикажи",
        "rcfilters-tag-remove": "Уклоните филтер „$1”",
-       "rcfilters-legend-heading": "\n<strong>Списак скраћеница ([[w:sr:Помоћ:Надгледање страница|помоћ]]):<strong>",
+       "rcfilters-legend-heading": "\n<strong>Списак скраћеница ([[w:sr:Помоћ:Надгледање страница|помоћ]]):</strong>",
        "rcfilters-other-review-tools": "Остале алатке за преглед",
        "rcfilters-group-results-by-page": "Групиши резултате по страницама",
        "rcfilters-activefilters": "Активни филтери",
index 2533454..76a149a 100644 (file)
        "pageinfo-header-edits": "ประวัติการแก้ไข",
        "pageinfo-header-restrictions": "การล็อกหน้า",
        "pageinfo-header-properties": "คุณสมบัติหน้า",
-       "pageinfo-display-title": "หัวà¹\80รืà¹\88อà¸\87à¸\82อà¸\87หà¸\99à¹\89าà¹\80มืà¹\88อà¹\81สà¸\94à¸\87à¸\9cล",
+       "pageinfo-display-title": "à¹\81สà¸\94à¸\87à¸\9cลà¸\8aืà¹\88อà¹\80รืà¹\88อà¸\87",
        "pageinfo-default-sort": "ค่าปริยายของคำหลักในการเรียงลำดับ",
        "pageinfo-length": "ความยาวหน้า (ไบต์)",
        "pageinfo-article-id": "เลขหน้า",
index 2878eca..26a6086 100644 (file)
     "karma-firefox-launcher": "1.0.1",
     "karma-mocha-reporter": "2.2.5",
     "karma-qunit": "1.2.1",
-    "nodemw": "0.11.0",
+    "mwbot": "1.0.10",
+    "postcss-less": "1.1.3",
     "qunitjs": "2.4.1",
     "stylelint": "8.2.0",
     "stylelint-config-wikimedia": "0.4.2",
     "wdio-junit-reporter": "0.2.0",
     "wdio-mocha-framework": "0.5.8",
-    "wdio-sauce-service": "^0.3.1",
+    "wdio-sauce-service": "0.3.1",
     "wdio-spec-reporter": "0.0.5",
-    "webdriverio": "4.6.2"
+    "webdriverio": "4.12.0"
   }
 }
index 04f80f4..48a78d3 100644 (file)
@@ -1,5 +1,9 @@
 <?php
 
+/**
+ * @large
+ * @covers CurlHttpRequest
+ */
 class CurlHttpRequestTest extends MWHttpRequestTestCase {
        protected static $httpEngine = 'curl';
 }
index d0222a5..90bf532 100644 (file)
@@ -1,5 +1,9 @@
 <?php
 
+/**
+ * @large
+ * @covers PhpHttpRequest
+ */
 class PhpHttpRequestTest extends MWHttpRequestTestCase {
        protected static $httpEngine = 'php';
 }
index c69fa73..9ee157b 100644 (file)
@@ -7,7 +7,10 @@ use MediaWiki\Shell\Shell;
  * Integration tests to ensure that firejail actually prevents execution.
  * Meant to run on vagrant, although will probably work on other setups
  * as long as firejail and sudo has similar config.
+ *
+ * @large
  * @group Shell
+ * @covers FirejailCommand
  */
 class FirejailCommandIntegrationTest extends PHPUnit\Framework\TestCase {
 
index f98044b..3f4ecad 100644 (file)
@@ -534,8 +534,8 @@ parsoid=wt2html
 !! config
 wgFragmentMode=[ 'html5', 'legacy' ]
 !! wikitext
-== A <nowiki>B
-C</nowiki> ==
+==A <nowiki>B
+C</nowiki>==
 !! html/php
 <h2><span id="A_B.0AC"></span><span class="mw-headline" id="A_B
 C">A B
@@ -543,8 +543,8 @@ C</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</spa
 
 !! html/parsoid
 <h2 id="A_B
-C"><span id="A_B.0AC" typeof="mw:FallbackId"></span> A <span typeof="mw:Nowiki">B
-C</span> </h2>
+C"><span id="A_B.0AC" typeof="mw:FallbackId"></span>A <span typeof="mw:Nowiki">B
+C</span></h2>
 !! end
 
 !! test
@@ -560,48 +560,48 @@ http://fr.wikipedia.org/wiki/🍺
 !! test
 Simple list
 !! wikitext
-* Item 1
-* Item 2
+*Item 1
+*Item 2
 !! html
-<ul><li> Item 1</li>
-<li> Item 2</li></ul>
+<ul><li>Item 1</li>
+<li>Item 2</li></ul>
 
 !! end
 
 !! test
 Italics and bold
 !! wikitext
-* plain
-* plain''italic''plain
-* plain''italic''plain''italic''plain
-* plain'''bold'''plain
-* plain'''bold'''plain'''bold'''plain
-* plain''italic''plain'''bold'''plain
-* plain'''bold'''plain''italic''plain
-* plain''italic'''bold-italic'''italic''plain
-* plain'''bold''bold-italic''bold'''plain
-* plain'''''bold-italic'''italic''plain
-* plain'''''bold-italic''bold'''plain
-* plain''italic'''bold-italic'''''plain
-* plain'''bold''bold-italic'''''plain
-* plain l'''italic''plain
-* plain l''''bold''' plain
-!! html
-<ul><li> plain</li>
-<li> plain<i>italic</i>plain</li>
-<li> plain<i>italic</i>plain<i>italic</i>plain</li>
-<li> plain<b>bold</b>plain</li>
-<li> plain<b>bold</b>plain<b>bold</b>plain</li>
-<li> plain<i>italic</i>plain<b>bold</b>plain</li>
-<li> plain<b>bold</b>plain<i>italic</i>plain</li>
-<li> plain<i>italic<b>bold-italic</b>italic</i>plain</li>
-<li> plain<b>bold<i>bold-italic</i>bold</b>plain</li>
-<li> plain<i><b>bold-italic</b>italic</i>plain</li>
-<li> plain<b><i>bold-italic</i>bold</b>plain</li>
-<li> plain<i>italic<b>bold-italic</b></i>plain</li>
-<li> plain<b>bold<i>bold-italic</i></b>plain</li>
-<li> plain l'<i>italic</i>plain</li>
-<li> plain l'<b>bold</b> plain</li></ul>
+*plain
+*plain''italic''plain
+*plain''italic''plain''italic''plain
+*plain'''bold'''plain
+*plain'''bold'''plain'''bold'''plain
+*plain''italic''plain'''bold'''plain
+*plain'''bold'''plain''italic''plain
+*plain''italic'''bold-italic'''italic''plain
+*plain'''bold''bold-italic''bold'''plain
+*plain'''''bold-italic'''italic''plain
+*plain'''''bold-italic''bold'''plain
+*plain''italic'''bold-italic'''''plain
+*plain'''bold''bold-italic'''''plain
+*plain l'''italic''plain
+*plain l''''bold''' plain
+!! html
+<ul><li>plain</li>
+<li>plain<i>italic</i>plain</li>
+<li>plain<i>italic</i>plain<i>italic</i>plain</li>
+<li>plain<b>bold</b>plain</li>
+<li>plain<b>bold</b>plain<b>bold</b>plain</li>
+<li>plain<i>italic</i>plain<b>bold</b>plain</li>
+<li>plain<b>bold</b>plain<i>italic</i>plain</li>
+<li>plain<i>italic<b>bold-italic</b>italic</i>plain</li>
+<li>plain<b>bold<i>bold-italic</i>bold</b>plain</li>
+<li>plain<i><b>bold-italic</b>italic</i>plain</li>
+<li>plain<b><i>bold-italic</i>bold</b>plain</li>
+<li>plain<i>italic<b>bold-italic</b></i>plain</li>
+<li>plain<b>bold<i>bold-italic</i></b>plain</li>
+<li>plain l'<i>italic</i>plain</li>
+<li>plain l'<b>bold</b> plain</li></ul>
 
 !! end
 
@@ -1247,32 +1247,32 @@ Text-level semantic html elements in wikitext
 !! test
 Ruby markup (W3C-style)
 !! wikitext
-; Mono-ruby for individual base characters
-: <ruby>日<rt>に</rt>本<rt>ほん</rt>語<rt>ご</rt></ruby>
-; Group ruby
-: <ruby>今日<rt>きょう</rt></ruby>
-; Jukugo ruby
-: <ruby>法<rb>華</rb><rb>経</rb><rt>ほ</rt><rt>け</rt><rt>きょう</rt></ruby>
-; Inline ruby
-: <ruby>東<rb>京</rb><rp>(</rp><rt>とう</rt><rt>きょう</rt><rp>)</rp></ruby>
-; Double-sided ruby
-: <ruby><rb>旧</rb><rb>金</rb><rb>山</rb><rt>jiù</rt><rt>jīn</rt><rt>shān</rt><rtc>San Francisco</rtc></ruby>
+;Mono-ruby for individual base characters
+:<ruby>日<rt>に</rt>本<rt>ほん</rt>語<rt>ご</rt></ruby>
+;Group ruby
+:<ruby>今日<rt>きょう</rt></ruby>
+;Jukugo ruby
+:<ruby>法<rb>華</rb><rb>経</rb><rt>ほ</rt><rt>け</rt><rt>きょう</rt></ruby>
+;Inline ruby
+:<ruby>東<rb>京</rb><rp>(</rp><rt>とう</rt><rt>きょう</rt><rp>)</rp></ruby>
+;Double-sided ruby
+:<ruby><rb>旧</rb><rb>金</rb><rb>山</rb><rt>jiù</rt><rt>jīn</rt><rt>shān</rt><rtc>San Francisco</rtc></ruby>
 <ruby>
 <rb>♥</rb><rtc><rt>Heart</rt></rtc><rtc lang="fr"><rt>Cœur</rt></rtc>
 <rb>☘</rb><rtc><rt>Shamrock</rt></rtc><rtc lang="fr"><rt>Trèfle</rt></rtc>
 <rb>✶</rb><rtc><rt>Star</rt></rtc><rtc lang="fr"><rt>Étoile</rt></rtc>
 </ruby>
 !! html
-<dl><dt> Mono-ruby for individual base characters</dt>
-<dd> <ruby>日<rt>に</rt>本<rt>ほん</rt>語<rt>ご</rt></ruby></dd>
-<dt> Group ruby</dt>
-<dd> <ruby>今日<rt>きょう</rt></ruby></dd>
-<dt> Jukugo ruby</dt>
-<dd> <ruby>法<rb>華</rb><rb>経</rb><rt>ほ</rt><rt>け</rt><rt>きょう</rt></ruby></dd>
-<dt> Inline ruby</dt>
-<dd> <ruby>東<rb>京</rb><rp>(</rp><rt>とう</rt><rt>きょう</rt><rp>)</rp></ruby></dd>
-<dt> Double-sided ruby</dt>
-<dd> <ruby><rb>旧</rb><rb>金</rb><rb>山</rb><rt>jiù</rt><rt>jīn</rt><rt>shān</rt><rtc>San Francisco</rtc></ruby></dd></dl>
+<dl><dt>Mono-ruby for individual base characters</dt>
+<dd><ruby>日<rt>に</rt>本<rt>ほん</rt>語<rt>ご</rt></ruby></dd>
+<dt>Group ruby</dt>
+<dd><ruby>今日<rt>きょう</rt></ruby></dd>
+<dt>Jukugo ruby</dt>
+<dd><ruby>法<rb>華</rb><rb>経</rb><rt>ほ</rt><rt>け</rt><rt>きょう</rt></ruby></dd>
+<dt>Inline ruby</dt>
+<dd><ruby>東<rb>京</rb><rp>(</rp><rt>とう</rt><rt>きょう</rt><rp>)</rp></ruby></dd>
+<dt>Double-sided ruby</dt>
+<dd><ruby><rb>旧</rb><rb>金</rb><rb>山</rb><rt>jiù</rt><rt>jīn</rt><rt>shān</rt><rtc>San Francisco</rtc></ruby></dd></dl>
 <p><ruby>
 <rb>♥</rb><rtc><rt>Heart</rt></rtc><rtc lang="fr"><rt>Cœur</rt></rtc>
 <rb>☘</rb><rtc><rt>Shamrock</rt></rtc><rtc lang="fr"><rt>Trèfle</rt></rtc>
@@ -2751,7 +2751,7 @@ Templates: Strip leading and trailing whitespace from named-param values
 </p><p>b
 </p><p>c
 </p>
-<ul><li> d</li></ul>
+<ul><li>d</li></ul>
 
 !! end
 
@@ -2772,7 +2772,7 @@ Templates: Don't strip whitespace from positional-param values
  e}}
 
 {{echo|
-* f}}
+*f}}
 
 {{echo|
  }}g
@@ -2792,7 +2792,7 @@ Templates: Don't strip whitespace from positional-param values
 </pre>
 <p><br />
 </p>
-<ul><li> f</li></ul>
+<ul><li>f</li></ul>
 <p><br />
 </p>
 <pre>g
 2c. Indent-Pre and tables (T44252)
 !! wikitext
 {|
- |+ foo
- !  | bar
+ |+foo
+ !  |bar
 |}
 !! html
 <table>
-<caption> foo
+<caption>foo
 </caption>
 <tr>
-<th> bar
+<th>bar
 </th></tr></table>
 
 !!end
 !! wikitext
  a
  {|
- | b
+ |b
  |}
 !! html/php
 <pre>a
 </pre>
 <table>
 <tr>
-<td> b
+<td>b
 </td></tr></table>
 
 !! html/parsoid
@@ -3699,19 +3699,19 @@ HTML-pre: 3: other wikitext
 !! test
 Simple definition
 !! wikitext
-; name : Definition
+;name :Definition
 !! html
-<dl><dt> name&#160;</dt>
-<dd> Definition</dd></dl>
+<dl><dt>name&#160;</dt>
+<dd>Definition</dd></dl>
 
 !! end
 
 !! test
 Definition list for indentation only
 !! wikitext
-: Indented text
+:Indented text
 !! html
-<dl><dd> Indented text</dd></dl>
+<dl><dd>Indented text</dd></dl>
 
 !! end
 
@@ -3728,10 +3728,10 @@ Definition list with no space
 !! test
 Definition list with URL link
 !! wikitext
-; http://example.com/ : definition
+;http://example.com/ :definition
 !! html
-<dl><dt> <a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>&#160;</dt>
-<dd> definition</dd></dl>
+<dl><dt><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>&#160;</dt>
+<dd>definition</dd></dl>
 
 !! end
 
@@ -3748,10 +3748,10 @@ Definition list with bracketed URL link
 !! test
 Definition list with wikilink containing colon
 !! wikitext
-; [[Help:FAQ]]: The least-read page on Wikipedia
+; [[Help:FAQ]]:The least-read page on Wikipedia
 !! html
-<dl><dt> <a href="/index.php?title=Help:FAQ&amp;action=edit&amp;redlink=1" class="new" title="Help:FAQ (page does not exist)">Help:FAQ</a></dt>
-<dd> The least-read page on Wikipedia</dd></dl>
+<dl><dt><a href="/index.php?title=Help:FAQ&amp;action=edit&amp;redlink=1" class="new" title="Help:FAQ (page does not exist)">Help:FAQ</a></dt>
+<dd>The least-read page on Wikipedia</dd></dl>
 
 !! end
 
@@ -3759,13 +3759,13 @@ Definition list with wikilink containing colon
 !! test
 Definition list with news link containing colon
 !! wikitext
-;  news:alt.wikipedia.rox: This isn't even a real newsgroup!
+;news:alt.wikipedia.rox: This isn't even a real newsgroup!
 !! html/php
-<dl><dt>  <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a></dt>
-<dd> This isn't even a real newsgroup!</dd></dl>
+<dl><dt><a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a></dt>
+<dd>This isn't even a real newsgroup!</dd></dl>
 
 !! html/parsoid
-<dl><dt>  <a rel="mw:ExtLink" class="external free" href="news:alt.wikipedia.rox" data-parsoid='{"stx":"url"}'>news:alt.wikipedia.rox</a></dt><dd data-parsoid='{"stx":"row"}'> This isn't even a real newsgroup!</dd></dl>
+<dl><dt>  <a rel="mw:ExtLink" class="external free" href="news:alt.wikipedia.rox" data-parsoid='{"stx":"url"}'>news:alt.wikipedia.rox</a></dt><dd data-parsoid='{"stx":"row"}'>This isn't even a real newsgroup!</dd></dl>
 !! end
 
 !! test
@@ -3773,17 +3773,17 @@ Malformed definition list with colon
 !! wikitext
 ;  news:alt.wikipedia.rox -- don't crash or enter an infinite loop
 !! html
-<dl><dt>  <a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop</dt></dl>
+<dl><dt><a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop</dt></dl>
 
 !! end
 
 !! test
 Definition lists: colon in external link text
 !! wikitext
-; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up
+;[http://www.wikipedia2.org/ Wikipedia :The Next Generation] :OK, I made that up
 !! html
-<dl><dt> <a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia&#160;: The Next Generation</a></dt>
-<dd> OK, I made that up</dd></dl>
+<dl><dt><a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia&#160;:The Next Generation</a>&#160;</dt>
+<dd>OK, I made that up</dd></dl>
 
 !! end
 
@@ -3799,30 +3799,30 @@ Definition lists: colon in HTML attribute
 !! test
 Definition lists: self-closed tag
 !! wikitext
-;one<br/>two : two-line fun
+;one<br/>two :two-line fun
 !! html
 <dl><dt>one<br />two&#160;</dt>
-<dd> two-line fun</dd></dl>
+<dd>two-line fun</dd></dl>
 
 !! end
 
 !! test
 Definition lists: ignore colons inside tags
 !! wikitext
-;one <b>two : tag <i>fun:</i>:</b>: def
+;one <b>two : tag <i>fun:</i>:</b>:def
 !! html
 <dl><dt>one <b>two&#160;: tag <i>fun:</i>:</b></dt>
-<dd> def</dd></dl>
+<dd>def</dd></dl>
 
 !! end
 
 !! test
 Definition lists: excess closed tags
 !! wikitext
-;one</b>two : bad tag fun
+;one</b>two :bad tag fun
 !! html/php+tidy
 <dl><dt>onetwo&#160;</dt>
-<dd> bad tag fun</dd></dl>
+<dd>bad tag fun</dd></dl>
 !! html/parsoid
 <dl>
 <dt>onetwo</dt>
@@ -3853,14 +3853,14 @@ T13748: Literal closing tags
 Definition and unordered list using wiki syntax nested in unordered list using html tags.
 !! wikitext
 <ul><li>
-; term : description
-* unordered
+;term :description
+*unordered
 </li></ul>
 !! html
 <ul><li>
-<dl><dt> term&#160;</dt>
-<dd> description</dd></dl>
-<ul><li> unordered</li></ul>
+<dl><dt>term&#160;</dt>
+<dd>description</dd></dl>
+<ul><li>unordered</li></ul>
 </li></ul>
 
 !! end
@@ -3868,10 +3868,10 @@ Definition and unordered list using wiki syntax nested in unordered list using h
 !! test
 Definition list with empty definition and following paragraph
 !! wikitext
-; term:
+;term:
 Paragraph text
 !! html
-<dl><dt> term</dt>
+<dl><dt>term</dt>
 <dd></dd></dl>
 <p>Paragraph text
 </p>
@@ -4049,22 +4049,22 @@ Table / list interaction: indented table with lists in table contents
 !! wikitext
 :{|
 |-
-| a
-* b
+|a
+*b
 |-
-| c
-* d
+|c
+*d
 |}
 !! html
 <dl><dd><table>
 
 <tr>
-<td> a
-<ul><li> b</li></ul>
+<td>a
+<ul><li>b</li></ul>
 </td></tr>
 <tr>
-<td> c
-<ul><li> d</li></ul>
+<td>c
+<ul><li>d</li></ul>
 </td></tr></table></dd></dl>
 
 !! end
@@ -4172,30 +4172,30 @@ Definition Lists: Nesting: Test 4
 !! test
 Definition Lists: Mixed Lists: Test 1
 !! wikitext
-:;* foo
-::* bar
-:; baz
+:;*foo
+::*bar
+:;baz
 !! html/php
-<dl><dd><dl><dt><ul><li> foo</li>
-<li> bar</li></ul></dt></dl>
-<dl><dt> baz</dt></dl></dd></dl>
+<dl><dd><dl><dt><ul><li>foo</li>
+<li>bar</li></ul></dt></dl>
+<dl><dt>baz</dt></dl></dd></dl>
 
 !! html/php+tidy
-<dl><dd><dl><dt><ul><li> foo</li>
-<li> bar</li></ul></dt></dl>
-<dl><dt> baz</dt></dl></dd></dl>
+<dl><dd><dl><dt><ul><li>foo</li>
+<li>bar</li></ul></dt></dl>
+<dl><dt>baz</dt></dl></dd></dl>
 !! html/parsoid
 <dl>
 <dd><dl>
 <dt><ul>
-<li> foo
+<li>foo
 </li>
 </ul></dt>
 <dd><ul>
-<li> bar
+<li>bar
 </li>
 </ul></dd>
-<dt> baz</dt>
+<dt>baz</dt>
 </dl></dd>
 </dl>
 !! end
@@ -4203,11 +4203,11 @@ Definition Lists: Mixed Lists: Test 1
 !! test
 Definition Lists: Mixed Lists: Test 2
 !! wikitext
-*: d1
-*: d2
+*:d1
+*:d2
 !! html
-<ul><li><dl><dd> d1</dd>
-<dd> d2</dd></dl></li></ul>
+<ul><li><dl><dd>d1</dd>
+<dd>d2</dd></dl></li></ul>
 
 !! end
 
@@ -4215,11 +4215,11 @@ Definition Lists: Mixed Lists: Test 2
 !! test
 Definition Lists: Mixed Lists: Test 3
 !! wikitext
-*::: d1
-*::: d2
+*:::d1
+*:::d2
 !! html
-<ul><li><dl><dd><dl><dd><dl><dd> d1</dd>
-<dd> d2</dd></dl></dd></dl></dd></dl></li></ul>
+<ul><li><dl><dd><dl><dd><dl><dd>d1</dd>
+<dd>d2</dd></dl></dd></dl></dd></dl></li></ul>
 
 !! end
 
@@ -4242,10 +4242,10 @@ Definition Lists: Mixed Lists: Test 4
 Definition Lists: Mixed Lists: Test 5
 !! wikitext
 *:d1
-*:: d2
+*::d2
 !! html
 <ul><li><dl><dd>d1
-<dl><dd> d2</dd></dl></dd></dl></li></ul>
+<dl><dd>d2</dd></dl></dd></dl></li></ul>
 
 !! end
 
@@ -4254,10 +4254,10 @@ Definition Lists: Mixed Lists: Test 5
 Definition Lists: Mixed Lists: Test 6
 !! wikitext
 #*:d1
-#*::: d3
+#*:::d3
 !! html
 <ol><li><ul><li><dl><dd>d1
-<dl><dd><dl><dd> d3</dd></dl></dd></dl></dd></dl></li></ul></li></ol>
+<dl><dd><dl><dd>d3</dd></dl></dd></dl></dd></dl></li></ul></li></ol>
 
 !! end
 
@@ -4265,11 +4265,11 @@ Definition Lists: Mixed Lists: Test 6
 !! test
 Definition Lists: Mixed Lists: Test 7
 !! wikitext
-:* d1
-:* d2
+:*d1
+:*d2
 !! html
-<dl><dd><ul><li> d1</li>
-<li> d2</li></ul></dd></dl>
+<dl><dd><ul><li>d1</li>
+<li>d2</li></ul></dd></dl>
 
 !! end
 
@@ -4277,11 +4277,11 @@ Definition Lists: Mixed Lists: Test 7
 !! test
 Definition Lists: Mixed Lists: Test 8
 !! wikitext
-:* d1
-::* d2
+:*d1
+::*d2
 !! html
-<dl><dd><ul><li> d1</li></ul>
-<dl><dd><ul><li> d2</li></ul></dd></dl></dd></dl>
+<dl><dd><ul><li>d1</li></ul>
+<dl><dd><ul><li>d2</li></ul></dd></dl></dd></dl>
 
 !! end
 
@@ -4382,10 +4382,10 @@ Definition Lists: Mixed Lists: Test 12
 !! test
 Definition Lists: Weird Ones: Test 1
 !! wikitext
-*#;*::;; foo : bar (who uses this?)
+*#;*::;;foo :bar (who uses this?)
 !! html/php+tidy
-<ul><li><ol><li><dl><dt> foo&#160;</dt>
-<dd><ul><li><dl><dd><dl><dd><dl><dt><dl><dt> bar (who uses this?)</dt></dl></dt></dl></dd></dl></dd></dl></li></ul></dd></dl></li></ol></li></ul>
+<ul><li><ol><li><dl><dt>foo&#160;</dt>
+<dd><ul><li><dl><dd><dl><dd><dl><dt><dl><dt>bar (who uses this?)</dt></dl></dt></dl></dd></dl></dd></dl></li></ul></dd></dl></li></ol></li></ul>
 !! html/parsoid
 <ul>
 <li>
@@ -4402,8 +4402,8 @@ Definition Lists: Weird Ones: Test 1
 <dl>
 <dt>
 <dl>
-<dt> foo<span typeof="mw:DisplaySpace mw:Placeholder" data-parsoid='{"src":" ","isDisplayHack":true}'> </span></dt>
-<dd data-parsoid='{"stx":"row"}'> bar (who uses this?)</dd>
+<dt>foo<span typeof="mw:DisplaySpace mw:Placeholder" data-parsoid='{"src":" ","isDisplayHack":true}'> </span></dt>
+<dd data-parsoid='{"stx":"row"}'>bar (who uses this?)</dd>
 </dl></dt>
 </dl></dd>
 </dl></dd>
@@ -4460,29 +4460,29 @@ Definition Lists: colons occurring in tags
 Definition Lists: colons and tables 1
 !! wikitext
 :{|
-| x
+|x
 |}
 :{|
-| y
+|y
 |}
 !! html/php
 <dl><dd><table>
 <tr>
-<td> x
+<td>x
 </td></tr></table></dd></dl>
 <dl><dd><table>
 <tr>
-<td> y
+<td>y
 </td></tr></table></dd></dl>
 
 !! html/parsoid
 <dl><dd><table>
 <tr>
-<td> x
+<td>x
 </td></tr></table></dd>
 <dd><table>
 <tr>
-<td> y
+<td>y
 </td></tr></table></dd></dl>
 !! end
 
@@ -5543,61 +5543,61 @@ IPv6 urls, autolink format (T23261)
 http://[2404:130:0:1000::187:2]/index.php
 
 Examples from RFC 2373, section 2.2:
-* http://[1080::8:800:200C:417A]/unicast
-* http://[FF01::101]/multicast
-* http://[::1]/loopback
-* http://[::]/unspecified
-* http://[::13.1.68.3]/ipv4compat
-* http://[::FFFF:129.144.52.38]/ipv4compat
+*http://[1080::8:800:200C:417A]/unicast
+*http://[FF01::101]/multicast
+*http://[::1]/loopback
+*http://[::]/unspecified
+*http://[::13.1.68.3]/ipv4compat
+*http://[::FFFF:129.144.52.38]/ipv4compat
 
 Examples from RFC 2732, section 2:
-* http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html
-* http://[1080:0:0:0:8:800:200C:417A]/index.html
-* http://[3ffe:2a00:100:7031::1]
-* http://[1080::8:800:200C:417A]/foo
-* http://[::192.9.5.5]/ipng
-* http://[::FFFF:129.144.52.38]:80/index.html
-* http://[2010:836B:4179::836B:4179]
+*http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html
+*http://[1080:0:0:0:8:800:200C:417A]/index.html
+*http://[3ffe:2a00:100:7031::1]
+*http://[1080::8:800:200C:417A]/foo
+*http://[::192.9.5.5]/ipng
+*http://[::FFFF:129.144.52.38]:80/index.html
+*http://[2010:836B:4179::836B:4179]
 
 !! html/php
 <p><a rel="nofollow" class="external free" href="http://[2404:130:0:1000::187:2]/index.php">http://[2404:130:0:1000::187:2]/index.php</a>
 </p><p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc2373">RFC 2373</a>, section 2.2:
 </p>
-<ul><li> <a rel="nofollow" class="external free" href="http://[1080::8:800:200C:417A]/unicast">http://[1080::8:800:200C:417A]/unicast</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[FF01::101]/multicast">http://[FF01::101]/multicast</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[::1]/loopback">http://[::1]/loopback</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[::]/unspecified">http://[::]/unspecified</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[::13.1.68.3]/ipv4compat">http://[::13.1.68.3]/ipv4compat</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[::FFFF:129.144.52.38]/ipv4compat">http://[::FFFF:129.144.52.38]/ipv4compat</a></li></ul>
+<ul><li><a rel="nofollow" class="external free" href="http://[1080::8:800:200C:417A]/unicast">http://[1080::8:800:200C:417A]/unicast</a></li>
+<li><a rel="nofollow" class="external free" href="http://[FF01::101]/multicast">http://[FF01::101]/multicast</a></li>
+<li><a rel="nofollow" class="external free" href="http://[::1]/loopback">http://[::1]/loopback</a></li>
+<li><a rel="nofollow" class="external free" href="http://[::]/unspecified">http://[::]/unspecified</a></li>
+<li><a rel="nofollow" class="external free" href="http://[::13.1.68.3]/ipv4compat">http://[::13.1.68.3]/ipv4compat</a></li>
+<li><a rel="nofollow" class="external free" href="http://[::FFFF:129.144.52.38]/ipv4compat">http://[::FFFF:129.144.52.38]/ipv4compat</a></li></ul>
 <p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc2732">RFC 2732</a>, section 2:
 </p>
-<ul><li> <a rel="nofollow" class="external free" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">http://[1080:0:0:0:8:800:200C:417A]/index.html</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[3ffe:2a00:100:7031::1]">http://[3ffe:2a00:100:7031::1]</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[1080::8:800:200C:417A]/foo">http://[1080::8:800:200C:417A]/foo</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[::192.9.5.5]/ipng">http://[::192.9.5.5]/ipng</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[::FFFF:129.144.52.38]:80/index.html">http://[::FFFF:129.144.52.38]:80/index.html</a></li>
-<li> <a rel="nofollow" class="external free" href="http://[2010:836B:4179::836B:4179]">http://[2010:836B:4179::836B:4179]</a></li></ul>
+<ul><li><a rel="nofollow" class="external free" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html</a></li>
+<li><a rel="nofollow" class="external free" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">http://[1080:0:0:0:8:800:200C:417A]/index.html</a></li>
+<li><a rel="nofollow" class="external free" href="http://[3ffe:2a00:100:7031::1]">http://[3ffe:2a00:100:7031::1]</a></li>
+<li><a rel="nofollow" class="external free" href="http://[1080::8:800:200C:417A]/foo">http://[1080::8:800:200C:417A]/foo</a></li>
+<li><a rel="nofollow" class="external free" href="http://[::192.9.5.5]/ipng">http://[::192.9.5.5]/ipng</a></li>
+<li><a rel="nofollow" class="external free" href="http://[::FFFF:129.144.52.38]:80/index.html">http://[::FFFF:129.144.52.38]:80/index.html</a></li>
+<li><a rel="nofollow" class="external free" href="http://[2010:836B:4179::836B:4179]">http://[2010:836B:4179::836B:4179]</a></li></ul>
 
 !! html/parsoid
 <p><a rel="mw:ExtLink" class="external free" href="http://[2404:130:0:1000::187:2]/index.php">http://[2404:130:0:1000::187:2]/index.php</a></p>
 
 <p>Examples from <a href="https://tools.ietf.org/html/rfc2373" rel="mw:ExtLink" class="external text">RFC 2373</a>, section 2.2:</p>
-<ul><li> <a rel="mw:ExtLink" class="external free" href="http://[1080::8:800:200C:417A]/unicast">http://[1080::8:800:200C:417A]/unicast</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[FF01::101]/multicast">http://[FF01::101]/multicast</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[::1]/loopback">http://[::1]/loopback</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[::]/unspecified">http://[::]/unspecified</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[::13.1.68.3]/ipv4compat">http://[::13.1.68.3]/ipv4compat</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[::FFFF:129.144.52.38]/ipv4compat">http://[::FFFF:129.144.52.38]/ipv4compat</a></li></ul>
+<ul><li><a rel="mw:ExtLink" class="external free" href="http://[1080::8:800:200C:417A]/unicast">http://[1080::8:800:200C:417A]/unicast</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[FF01::101]/multicast">http://[FF01::101]/multicast</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[::1]/loopback">http://[::1]/loopback</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[::]/unspecified">http://[::]/unspecified</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[::13.1.68.3]/ipv4compat">http://[::13.1.68.3]/ipv4compat</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[::FFFF:129.144.52.38]/ipv4compat">http://[::FFFF:129.144.52.38]/ipv4compat</a></li></ul>
 
 <p>Examples from <a href="https://tools.ietf.org/html/rfc2732" rel="mw:ExtLink" class="external text">RFC 2732</a>, section 2:</p>
-<ul><li> <a rel="mw:ExtLink" class="external free" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">http://[1080:0:0:0:8:800:200C:417A]/index.html</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[3ffe:2a00:100:7031::1]">http://[3ffe:2a00:100:7031::1]</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[1080::8:800:200C:417A]/foo">http://[1080::8:800:200C:417A]/foo</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[::192.9.5.5]/ipng">http://[::192.9.5.5]/ipng</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[::FFFF:129.144.52.38]:80/index.html">http://[::FFFF:129.144.52.38]:80/index.html</a></li>
-<li> <a rel="mw:ExtLink" class="external free" href="http://[2010:836B:4179::836B:4179]">http://[2010:836B:4179::836B:4179]</a></li></ul>
+<ul><li><a rel="mw:ExtLink" class="external free" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">http://[1080:0:0:0:8:800:200C:417A]/index.html</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[3ffe:2a00:100:7031::1]">http://[3ffe:2a00:100:7031::1]</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[1080::8:800:200C:417A]/foo">http://[1080::8:800:200C:417A]/foo</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[::192.9.5.5]/ipng">http://[::192.9.5.5]/ipng</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[::FFFF:129.144.52.38]:80/index.html">http://[::FFFF:129.144.52.38]:80/index.html</a></li>
+<li><a rel="mw:ExtLink" class="external free" href="http://[2010:836B:4179::836B:4179]">http://[2010:836B:4179::836B:4179]</a></li></ul>
 !! end
 
 !! test
@@ -5606,61 +5606,61 @@ IPv6 urls, bracketed format (T23261)
 [http://[2404:130:0:1000::187:2]/index.php test]
 
 Examples from RFC 2373, section 2.2:
-* [http://[1080::8:800:200C:417A] unicast]
-* [http://[FF01::101] multicast]
-* [http://[::1]/ loopback]
-* [http://[::] unspecified]
-* [http://[::13.1.68.3] ipv4compat]
-* [http://[::FFFF:129.144.52.38] ipv4compat]
+*[http://[1080::8:800:200C:417A] unicast]
+*[http://[FF01::101] multicast]
+*[http://[::1]/ loopback]
+*[http://[::] unspecified]
+*[http://[::13.1.68.3] ipv4compat]
+*[http://[::FFFF:129.144.52.38] ipv4compat]
 
 Examples from RFC 2732, section 2:
-* [http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1]
-* [http://[1080:0:0:0:8:800:200C:417A]/index.html 2]
-* [http://[3ffe:2a00:100:7031::1] 3]
-* [http://[1080::8:800:200C:417A]/foo 4]
-* [http://[::192.9.5.5]/ipng 5]
-* [http://[::FFFF:129.144.52.38]:80/index.html 6]
-* [http://[2010:836B:4179::836B:4179] 7]
+*[http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1]
+*[http://[1080:0:0:0:8:800:200C:417A]/index.html 2]
+*[http://[3ffe:2a00:100:7031::1] 3]
+*[http://[1080::8:800:200C:417A]/foo 4]
+*[http://[::192.9.5.5]/ipng 5]
+*[http://[::FFFF:129.144.52.38]:80/index.html 6]
+*[http://[2010:836B:4179::836B:4179] 7]
 
 !! html/php
 <p><a rel="nofollow" class="external text" href="http://[2404:130:0:1000::187:2]/index.php">test</a>
 </p><p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc2373">RFC 2373</a>, section 2.2:
 </p>
-<ul><li> <a rel="nofollow" class="external text" href="http://[1080::8:800:200C:417A]">unicast</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[FF01::101]">multicast</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[::1]/">loopback</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[::]">unspecified</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[::13.1.68.3]">ipv4compat</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[::FFFF:129.144.52.38]">ipv4compat</a></li></ul>
+<ul><li><a rel="nofollow" class="external text" href="http://[1080::8:800:200C:417A]">unicast</a></li>
+<li><a rel="nofollow" class="external text" href="http://[FF01::101]">multicast</a></li>
+<li><a rel="nofollow" class="external text" href="http://[::1]/">loopback</a></li>
+<li><a rel="nofollow" class="external text" href="http://[::]">unspecified</a></li>
+<li><a rel="nofollow" class="external text" href="http://[::13.1.68.3]">ipv4compat</a></li>
+<li><a rel="nofollow" class="external text" href="http://[::FFFF:129.144.52.38]">ipv4compat</a></li></ul>
 <p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc2732">RFC 2732</a>, section 2:
 </p>
-<ul><li> <a rel="nofollow" class="external text" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">1</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">2</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[3ffe:2a00:100:7031::1]">3</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[1080::8:800:200C:417A]/foo">4</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[::192.9.5.5]/ipng">5</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[::FFFF:129.144.52.38]:80/index.html">6</a></li>
-<li> <a rel="nofollow" class="external text" href="http://[2010:836B:4179::836B:4179]">7</a></li></ul>
+<ul><li><a rel="nofollow" class="external text" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">1</a></li>
+<li><a rel="nofollow" class="external text" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">2</a></li>
+<li><a rel="nofollow" class="external text" href="http://[3ffe:2a00:100:7031::1]">3</a></li>
+<li><a rel="nofollow" class="external text" href="http://[1080::8:800:200C:417A]/foo">4</a></li>
+<li><a rel="nofollow" class="external text" href="http://[::192.9.5.5]/ipng">5</a></li>
+<li><a rel="nofollow" class="external text" href="http://[::FFFF:129.144.52.38]:80/index.html">6</a></li>
+<li><a rel="nofollow" class="external text" href="http://[2010:836B:4179::836B:4179]">7</a></li></ul>
 
 !! html/parsoid
 <p><a rel="mw:ExtLink" class="external text" href="http://[2404:130:0:1000::187:2]/index.php">test</a></p>
 
 <p>Examples from <a href="https://tools.ietf.org/html/rfc2373" rel="mw:ExtLink" class="external text">RFC 2373</a>, section 2.2:</p>
-<ul><li> <a rel="mw:ExtLink" class="external text" href="http://[1080::8:800:200C:417A]">unicast</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[FF01::101]">multicast</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[::1]/">loopback</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[::]">unspecified</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[::13.1.68.3]">ipv4compat</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[::FFFF:129.144.52.38]">ipv4compat</a></li></ul>
+<ul><li><a rel="mw:ExtLink" class="external text" href="http://[1080::8:800:200C:417A]">unicast</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[FF01::101]">multicast</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[::1]/">loopback</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[::]">unspecified</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[::13.1.68.3]">ipv4compat</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[::FFFF:129.144.52.38]">ipv4compat</a></li></ul>
 
 <p>Examples from <a href="https://tools.ietf.org/html/rfc2732" rel="mw:ExtLink" class="external text">RFC 2732</a>, section 2:</p>
-<ul><li> <a rel="mw:ExtLink" class="external text" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">1</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">2</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[3ffe:2a00:100:7031::1]">3</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[1080::8:800:200C:417A]/foo">4</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[::192.9.5.5]/ipng">5</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[::FFFF:129.144.52.38]:80/index.html">6</a></li>
-<li> <a rel="mw:ExtLink" class="external text" href="http://[2010:836B:4179::836B:4179]">7</a></li></ul>
+<ul><li><a rel="mw:ExtLink" class="external text" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">1</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">2</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[3ffe:2a00:100:7031::1]">3</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[1080::8:800:200C:417A]/foo">4</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[::192.9.5.5]/ipng">5</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[::FFFF:129.144.52.38]:80/index.html">6</a></li>
+<li><a rel="mw:ExtLink" class="external text" href="http://[2010:836B:4179::836B:4179]">7</a></li></ul>
 !! end
 
 !! test
@@ -5988,15 +5988,15 @@ A table with no data (take 2)
 A table with nothing but a caption
 !! wikitext
 {|
-|+ caption
+|+caption
 |}
 !! html/php
 <table>
-<caption> caption
+<caption>caption
 </caption><tr><td></td></tr></table>
 
 !! html/parsoid
-<table><caption> caption</caption></table>
+<table><caption>caption</caption></table>
 !! end
 
 !! test
@@ -6005,14 +6005,14 @@ A table with caption with default-spaced attributes and a table row
 {|
 |+ style="color: red;" | caption1
 |-
-| foo
+|foo
 |}
 !! html
 <table>
-<caption style="color: red;"> caption1
+<caption style="color: red;">caption1
 </caption>
 <tr>
-<td> foo
+<td>foo
 </td></tr></table>
 
 !! end
@@ -6022,18 +6022,18 @@ A table with captions with non-default spaced attributes and a table row
 !! wikitext
 {|
 |+style="color: red;"|caption2
-|+ style="color: red;"| caption3
+|+ style="color: red;"|caption3
 |-
-| foo
+|foo
 |}
 !! html
 <table>
 <caption style="color: red;">caption2
 </caption>
-<caption style="color: red;"> caption3
+<caption style="color: red;">caption3
 </caption>
 <tr>
-<td> foo
+<td>foo
 </td></tr></table>
 
 !! end
@@ -6042,23 +6042,23 @@ A table with captions with non-default spaced attributes and a table row
 Table td-cell syntax variations
 !! wikitext
 {|
-| foo bar foo | baz
-| foo bar foo || baz
-| style='color:red;' | baz
-| style='color:red;' || baz
+|foo bar foo|baz
+|foo bar foo||baz
+|style='color:red;'|baz
+|style='color:red;'||baz
 |}
 !! html
 <table>
 <tr>
-<td> baz
+<td>baz
 </td>
-<td> foo bar foo </td>
-<td> baz
+<td>foo bar foo</td>
+<td>baz
 </td>
-<td style="color:red;"> baz
+<td style="color:red;">baz
 </td>
-<td> style='color:red;' </td>
-<td> baz
+<td>style='color:red;'</td>
+<td>baz
 </td></tr></table>
 
 !! end
@@ -6067,19 +6067,19 @@ Table td-cell syntax variations
 Simple table
 !! wikitext
 {|
-| 1 || 2
+|1||2
 |-
-| 3 || 4
+|3||4
 |}
 !! html
 <table>
 <tr>
-<td> 1 </td>
-<td> 2
+<td>1</td>
+<td>2
 </td></tr>
 <tr>
-<td> 3 </td>
-<td> 4
+<td>3</td>
+<td>4
 </td></tr></table>
 
 !! end
@@ -6088,17 +6088,17 @@ Simple table
 Simple table but with multiple dashes for row wikitext
 !! wikitext
 {|
-| foo
+|foo
 |-----
-| bar
+|bar
 |}
 !! html
 <table>
 <tr>
-<td> foo
+<td>foo
 </td></tr>
 <tr>
-<td> bar
+<td>bar
 </td></tr></table>
 
 !! end
@@ -6109,67 +6109,67 @@ Multiplication table
 {| border="1" cellpadding="2"
 |+Multiplication table
 |-
-! &times; !! 1 !! 2 !! 3
+!&times;!!1!!2!!3
 |-
-! 1
-| 1 || 2 || 3
+!1
+|1||2||3
 |-
-! 2
-| 2 || 4 || 6
+!2
+|2||4||6
 |-
-! 3
-| 3 || 6 || 9
+!3
+|3||6||9
 |-
-! 4
-| 4 || 8 || 12
+!4
+|4||8||12
 |-
-! 5
-| 5 || 10 || 15
+!5
+|5||10||15
 |}
 !! html
 <table border="1" cellpadding="2">
 <caption>Multiplication table
 </caption>
 <tr>
-<th> &#215; </th>
-<th> 1 </th>
-<th> 2 </th>
-<th> 3
+<th>&#215;</th>
+<th>1</th>
+<th>2</th>
+<th>3
 </th></tr>
 <tr>
-<th> 1
+<th>1
 </th>
-<td> 1 </td>
-<td> 2 </td>
-<td> 3
+<td>1</td>
+<td>2</td>
+<td>3
 </td></tr>
 <tr>
-<th> 2
+<th>2
 </th>
-<td> 2 </td>
-<td> 4 </td>
-<td> 6
+<td>2</td>
+<td>4</td>
+<td>6
 </td></tr>
 <tr>
-<th> 3
+<th>3
 </th>
-<td> 3 </td>
-<td> 6 </td>
-<td> 9
+<td>3</td>
+<td>6</td>
+<td>9
 </td></tr>
 <tr>
-<th> 4
+<th>4
 </th>
-<td> 4 </td>
-<td> 8 </td>
-<td> 12
+<td>4</td>
+<td>8</td>
+<td>12
 </td></tr>
 <tr>
-<th> 5
+<th>5
 </th>
-<td> 5 </td>
-<td> 10 </td>
-<td> 15
+<td>5</td>
+<td>10</td>
+<td>15
 </td></tr></table>
 
 !! end
@@ -6178,13 +6178,13 @@ Multiplication table
 Accept "||" in table headings
 !! wikitext
 {|
-!h1 || h2
+!h1||h2
 |}
 !! html
 <table>
 <tr>
-<th>h1 </th>
-<th> h2
+<th>h1</th>
+<th>h2
 </th></tr></table>
 
 !! end
@@ -6193,12 +6193,12 @@ Accept "||" in table headings
 Accept "!!" in table data
 !! wikitext
 {|
-| Foo!! ||
+|Foo!!||
 |}
 !! html
 <table>
 <tr>
-<td> Foo!! </td>
+<td>Foo!!</td>
 <td>
 </td></tr></table>
 
@@ -6212,13 +6212,13 @@ Accept "!!" in table data
 Accept "||" in indented table headings
 !! wikitext
 :{|
-!h1 || h2
+!h1||h2
 |}
 !! html
 <dl><dd><table>
 <tr>
-<th>h1 </th>
-<th> h2
+<th>h1</th>
+<th>h2
 </th></tr></table></dd></dl>
 
 !! end
@@ -6293,9 +6293,9 @@ Accept empty attributes in td/th cells (td/th cells starting with leading ||)
 !! html
 <table>
 <tr>
-<th> h1
+<th>h1
 </th>
-<td> a
+<td>a
 </td></tr></table>
 
 !! end
@@ -6305,13 +6305,13 @@ Accept "| !" at start of line in tables (ignore !-attribute)
 !! wikitext
 {|
 |-
-| !style="color:red" | bar
+|!style="color:red"|bar
 |}
 !! html
 <table>
 
 <tr>
-<td> bar
+<td>bar
 </td></tr></table>
 
 !!end
@@ -6324,8 +6324,8 @@ Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present
 |style='color:red;'|+1
 |style='color:blue;'|-1
 |-
-| 1 || 2 || 3
-| 1 ||+2 ||-3
+|1||2||3
+|1||+2||-3
 |-
 | +1
 | -1
@@ -6339,18 +6339,18 @@ Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present
 <td style="color:blue;">-1
 </td></tr>
 <tr>
-<td> 1 </td>
-<td> 2 </td>
-<td> 3
+<td>1</td>
+<td>2</td>
+<td>3
 </td>
-<td> 1 </td>
-<td>+2 </td>
+<td>1</td>
+<td>+2</td>
 <td>-3
 </td></tr>
 <tr>
-<td> +1
+<td>+1
 </td>
-<td> -1
+<td>-1
 </td></tr></table>
 
 !!end
@@ -6359,26 +6359,26 @@ Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present
 Table rowspan
 !! wikitext
 {| border=1
-| Cell 1, row 1
-|rowspan=2| Cell 2, row 1 (and 2)
-| Cell 3, row 1
+|Cell 1, row 1
+|rowspan=2|Cell 2, row 1 (and 2)
+|Cell 3, row 1
 |-
-| Cell 1, row 2
-| Cell 3, row 2
+|Cell 1, row 2
+|Cell 3, row 2
 |}
 !! html
 <table border="1">
 <tr>
-<td> Cell 1, row 1
+<td>Cell 1, row 1
 </td>
-<td rowspan="2"> Cell 2, row 1 (and 2)
+<td rowspan="2">Cell 2, row 1 (and 2)
 </td>
-<td> Cell 3, row 1
+<td>Cell 3, row 1
 </td></tr>
 <tr>
-<td> Cell 1, row 2
+<td>Cell 1, row 2
 </td>
-<td> Cell 3, row 2
+<td>Cell 3, row 2
 </td></tr></table>
 
 !! end
@@ -6399,7 +6399,7 @@ Nested table
 !! html
 <table border="1">
 <tr>
-<td> &#945;
+<td>&#945;
 </td>
 <td>
 <table bgcolor="#ABCDEF" border="2">
@@ -6444,7 +6444,7 @@ Table cell attributes: Pipes protected by nowikis should be treated as a plain c
 </td>
 <td title="foo&#124;">bar
 </td>
-<td> title="foo|" bar
+<td>title="foo|" bar
 </td></tr></table>
 
 !! html/parsoid
@@ -6484,17 +6484,17 @@ parsoid=wt2html,html2html
 Element attributes with double ! should not be broken up by <th>
 !! wikitext
 {|
-! hi <div class="!!">ha</div> ho
+!hi <div class="!!">ha</div> ho
 |}
 !! html/php
 <table>
 <tr>
-<th> hi <div class="!!">ha</div> ho
+<th>hi <div class="!!">ha</div> ho
 </th></tr></table>
 
 !! html/parsoid
 <table>
-<tbody><tr><th> hi <div class="!!" data-parsoid='{"stx":"html"}'>ha</div> ho</th></tr>
+<tbody><tr><th>hi <div class="!!" data-parsoid='{"stx":"html"}'>ha</div> ho</th></tr>
 </tbody></table>
 !! end
 
@@ -6502,17 +6502,17 @@ Element attributes with double ! should not be broken up by <th>
 ! and || in element attributes should not be parsed as <th>/<td>
 !! wikitext
 {|
-| <div style="color: red !important;" data-contrived="put this here ||">hi</div>
+|<div style="color: red !important;" data-contrived="put this here ||">hi</div>
 |}
 !! html/php
 <table>
 <tr>
-<td> <div style="color: red !important;" data-contrived="put this here &#124;&#124;">hi</div>
+<td><div style="color: red !important;" data-contrived="put this here &#124;&#124;">hi</div>
 </td></tr></table>
 
 !! html/parsoid
 <table>
-<tbody><tr><td> <div style="color: red !important;" data-contrived="put this here ||" data-parsoid='{"stx":"html"}'>hi</div></td></tr>
+<tbody><tr><td><div style="color: red !important;" data-contrived="put this here ||" data-parsoid='{"stx":"html"}'>hi</div></td></tr>
 </tbody></table>
 !! end
 
@@ -6523,18 +6523,18 @@ Element attributes with double ! should not be broken up by <th>
 parsoid=wt2html
 !! wikitext
 {|
-| style="color: red !important;" data-contrived="put this here ||" | foo
+|style="color: red !important;" data-contrived="put this here ||"|foo
 |}
 !! html/php
 <table>
 <tr>
-<td> style="color: red !important;" data-contrived="put this here </td>
-<td> foo
+<td>style="color: red !important;" data-contrived="put this here</td>
+<td>foo
 </td></tr></table>
 
 !! html/parsoid
 <table>
-<tbody><tr><td> style="color: red !important;" data-contrived="put this here </td><td data-parsoid='{"stx":"row","a":{"\"":null},"sa":{"\"":""},"autoInsertedEnd":true}'> foo</td></tr>
+<tbody><tr><td>style="color: red !important;" data-contrived="put this here</td><td data-parsoid='{"stx":"row","a":{"\"":null},"sa":{"\"":""},"autoInsertedEnd":true}'>foo</td></tr>
 </tbody></table>
 !! end
 
@@ -6580,22 +6580,22 @@ Invalid text in table attributes should be discarded
 parsoid=wt2html
 !! wikitext
 {| <span>boo</span> style='border:1px solid black'
-|  <span>boo</span> style='color:blue'  | 1
-|<span>boo</span> style='color:blue'| 2
+|  <span>boo</span> style='color:blue'  |1
+|<span>boo</span> style='color:blue'|2
 |}
 !! html/php
 <table style="border:1px solid black">
 <tr>
-<td style="color:blue"> 1
+<td style="color:blue">1
 </td>
-<td style="color:blue"> 2
+<td style="color:blue">2
 </td></tr></table>
 
 !! html/parsoid
 <table style="border:1px solid black">
 <tr>
-<td style="color:blue"> 1</td>
-<td style="color:blue"> 2</td>
+<td style="color:blue">1</td>
+<td style="color:blue">2</td>
 </tr>
 </table>
 !! end
@@ -6640,7 +6640,7 @@ parsoid={
 </td>
 <td style="color:red;">Foo
 </td>
-<td> style="color:red;"</td>
+<td>style="color:red;"</td>
 <td>Bar
 </td>
 <td style="color:red;">Foo
@@ -6754,14 +6754,14 @@ parsoid=wt2html,html2html
 {|
 |-
 
-! foo
+!foo
 |}
 !! html/*
 <table>
 
 
 <tr>
-<th> foo
+<th>foo
 </th></tr></table>
 
 !! end
@@ -6774,14 +6774,14 @@ parsoid=wt2html,html2html
 {|
 
 |-
-| foo
+|foo
 |}
 !! html/*
 <table>
 
 
 <tr>
-<td> foo
+<td>foo
 </td></tr></table>
 
 !! end
@@ -6792,17 +6792,17 @@ Table attributes with empty value
 parsoid=wt2html,html2html
 !! wikitext
 {|
-| style=| hello
+| style=|hello
 |}
 !! html/php
 <table>
 <tr>
-<td style=""> hello
+<td style="">hello
 </td></tr></table>
 
 !! html/parsoid
 <table>
-<tbody><tr><td style=""> hello</td></tr>
+<tbody><tr><td style="">hello</td></tr>
 </tbody></table>
 !! end
 
@@ -6811,7 +6811,7 @@ Wikitext table with a lot of comments
 !! wikitext
 {|
 <!-- c0 -->
-| foo
+|foo
 <!-- c1 -->
 |-<!-- c2 -->
 <!-- c3 -->
@@ -6821,7 +6821,7 @@ Wikitext table with a lot of comments
 !! html
 <table>
 <tr>
-<td> foo
+<td>foo
 </td></tr>
 <tr>
 <td>
@@ -6834,18 +6834,18 @@ Wikitext table comments represented in parsoid dom
 !! wikitext
 {|<!--c1--><!--c2-->
 |-<!--c3-->
-| x
+|x
 |}
 !! html/php+tidy
 <table>
 
 <tbody><tr>
-<td> x
+<td>x
 </td></tr></tbody></table>
 !! html/parsoid
 <table><!--c1--><!--c2-->
 <tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'><!--c3-->
-<td data-parsoid='{"autoInsertedEnd":true}'> x</td></tr>
+<td data-parsoid='{"autoInsertedEnd":true}'>x</td></tr>
 </tbody></table>
 !! end
 
@@ -6871,14 +6871,14 @@ Table cell with a single comment
 !! wikitext
 {|
 | <!-- c1 -->
-| a
+|a
 |}
 !! html
 <table>
 <tr>
 <td>
 </td>
-<td> a
+<td>a
 </td></tr></table>
 
 !! end
@@ -6889,21 +6889,21 @@ Table-cell after a comment-only-empty-line
 {|
 |a
 <!--c1-->
-<!--c2-->| b
+<!--c2-->|b
 |}
 !! html
 <table>
 <tr>
 <td>a
 </td>
-<td> b
+<td>b
 </td></tr></table>
 
 !! html/parsoid
 <table>
 <tbody><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td data-parsoid='{"autoInsertedEnd":true}'>a</td>
 <!--c1-->
-<!--c2--><td data-parsoid='{"autoInsertedEnd":true}'> b</td></tr>
+<!--c2--><td data-parsoid='{"autoInsertedEnd":true}'>b</td></tr>
 </tbody></table>
 
 !! end
@@ -6912,21 +6912,21 @@ Table-cell after a comment-only-empty-line
 Build table with {{!}}
 !! wikitext
 {{{!}} class="wikitable"
-! header
-! second header
+!header
+!second header
 {{!}}- style="color:red;"
-{{!}} data {{!}}{{!}} style="color:red;" {{!}} second data
+{{!}}data{{!}}{{!}} style="color:red;" {{!}}second data
 {{!}}}
 !! html
 <table class="wikitable">
 <tr>
-<th> header
+<th>header
 </th>
-<th> second header
+<th>second header
 </th></tr>
 <tr style="color:red;">
-<td> data </td>
-<td style="color:red;"> second data
+<td>data</td>
+<td style="color:red;">second data
 </td></tr></table>
 
 !! end
@@ -6935,33 +6935,33 @@ Build table with {{!}}
 Build table with pipe as data
 !! wikitext
 {| class="wikitable"
-! header
-! second header
+!header
+!second header
 |- style="color:red;"
-| data || style="color:red;" | second data
+|data|| style="color:red;" |second data
 |-
-| style="color:red;" | data with | || style="color:red;" | second data with |
+| style="color:red;" |data with | || style="color:red;" | second data with |
 |-
-|| data with | ||| second data with |
+||data with | |||second data with |
 |}
 !! html
 <table class="wikitable">
 <tr>
-<th> header
+<th>header
 </th>
-<th> second header
+<th>second header
 </th></tr>
 <tr style="color:red;">
-<td> data </td>
-<td style="color:red;"> second data
+<td>data</td>
+<td style="color:red;">second data
 </td></tr>
 <tr>
-<td style="color:red;"> data with | </td>
-<td style="color:red;"> second data with |
+<td style="color:red;">data with |</td>
+<td style="color:red;">second data with |
 </td></tr>
 <tr>
-<td> data with | </td>
-<td> second data with |
+<td>data with |</td>
+<td>second data with |
 </td></tr></table>
 
 !! end
@@ -6970,25 +6970,25 @@ Build table with pipe as data
 Build table with wikilink
 !! wikitext
 {| class="wikitable"
-! header || second header
+!header||second header
 |- style="color:red;"
-| data [[Main Page|linktext]] || second data [[Main Page|linktext]]
+|data [[Main Page|linktext]]||second data [[Main Page|linktext]]
 |-
-| data || second data [[Main Page|link|text with pipe]]
+|data||second data [[Main Page|link|text with pipe]]
 |}
 !! html
 <table class="wikitable">
 <tr>
-<th> header </th>
-<th> second header
+<th>header</th>
+<th>second header
 </th></tr>
 <tr style="color:red;">
-<td> data <a href="/wiki/Main_Page" title="Main Page">linktext</a> </td>
-<td> second data <a href="/wiki/Main_Page" title="Main Page">linktext</a>
+<td>data <a href="/wiki/Main_Page" title="Main Page">linktext</a></td>
+<td>second data <a href="/wiki/Main_Page" title="Main Page">linktext</a>
 </td></tr>
 <tr>
-<td> data </td>
-<td> second data <a href="/wiki/Main_Page" title="Main Page">link|text with pipe</a>
+<td>data</td>
+<td>second data <a href="/wiki/Main_Page" title="Main Page">link|text with pipe</a>
 </td></tr></table>
 
 !! end
@@ -7069,20 +7069,20 @@ Template generated table cell with attributes
 !! wikitext
 {|
 |-
-{{table_attribs_4}} || a || b
+{{table_attribs_4}} ||a||b
 |}
 !! html/php+tidy
 <table>
 
 <tbody><tr>
-<td style="background-color:#DC241f;" width="10px"> </td>
-<td> a </td>
-<td> b
+<td style="background-color:#DC241f;" width="10px"></td>
+<td>a</td>
+<td>b
 </td></tr></tbody></table>
 !! html/parsoid
 <table>
 <tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'>
-<td style="background-color:#DC241f;" width="10px" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"autoInsertedEnd":true,"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"table_attribs_4","href":"./Template:Table_attribs_4"},"params":{},"i":0}}," || a || b"]}'> </td><td about="#mwt1"> a </td><td about="#mwt1"> b</td></tr>
+<td style="background-color:#DC241f;" width="10px" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"autoInsertedEnd":true,"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"table_attribs_4","href":"./Template:Table_attribs_4"},"params":{},"i":0}}," ||a||b"]}'></td><td about="#mwt1">a</td><td about="#mwt1">b</td></tr>
 !! end
 
 !! test
@@ -7147,17 +7147,17 @@ Parsoid: Row-syntax table headings followed by comment & table cells
 parsoid=wt2html,wt2wt
 !! wikitext
 {|
-! foo || bar
-<!-- foo -->  || baz || quux
+!foo||bar
+<!-- foo -->  ||baz||quux
 |}
 !! html/php
 <table>
 <tr>
-<th> foo </th>
-<th> bar
+<th>foo</th>
+<th>bar
 </th>
-<td> baz </td>
-<td> quux
+<td>baz</td>
+<td>quux
 </td></tr></table>
 
 !! html/parsoid
@@ -9251,9 +9251,9 @@ Redirect followed by block on the same line
 !! options
 parsoid=wt2html
 !! wikitext
-#REDIRECT [[Main Page]]<!-- haha -->== hi ==
+#REDIRECT [[Main Page]]<!-- haha -->==hi==
 !! html/parsoid
-<link rel="mw:PageProp/redirect" href="./Main_Page"/><!-- haha --><h2 id="hi"> hi </h2>
+<link rel="mw:PageProp/redirect" href="./Main_Page"/><!-- haha --><h2 id="hi">hi</h2>
 !! end
 
 !! test
@@ -9480,11 +9480,11 @@ Horizontal ruler -- Supports content following dashes on same line
 Common list
 !! wikitext
 *Common list
-* item 2
+*item 2
 *item 3
 !! html
 <ul><li>Common list</li>
-<li> item 2</li>
+<li>item 2</li>
 <li>item 3</li></ul>
 
 !! end
@@ -9494,11 +9494,11 @@ Numbered list
 !! wikitext
 #Numbered list
 #item 2
-# item 3
+#item 3
 !! html
 <ol><li>Numbered list</li>
 <li>item 2</li>
-<li> item 3</li></ol>
+<li>item 3</li></ol>
 
 !! end
 
@@ -9506,9 +9506,9 @@ Numbered list
 Mixed list
 !! wikitext
 *Mixed list
-*# with numbers
-** and bullets
-*# and numbers
+*#with numbers
+**and bullets
+*#and numbers
 *bullets again
 **bullet level 2
 ***bullet level 3
@@ -9518,13 +9518,13 @@ Mixed list
 **#Number on level 3
 *#number level 2
 *Level 1
-*** Level 3
-#** Level 3, but ordered
+***Level 3
+#**Level 3, but ordered
 !! html
 <ul><li>Mixed list
-<ol><li> with numbers</li></ol>
-<ul><li> and bullets</li></ul>
-<ol><li> and numbers</li></ol></li>
+<ol><li>with numbers</li></ol>
+<ul><li>and bullets</li></ul>
+<ol><li>and numbers</li></ol></li>
 <li>bullets again
 <ul><li>bullet level 2
 <ul><li>bullet level 3
@@ -9534,43 +9534,43 @@ Mixed list
 <li>Number on level 3</li></ol></li></ul>
 <ol><li>number level 2</li></ol></li>
 <li>Level 1
-<ul><li><ul><li> Level 3</li></ul></li></ul></li></ul>
-<ol><li><ul><li><ul><li> Level 3, but ordered</li></ul></li></ul></li></ol>
+<ul><li><ul><li>Level 3</li></ul></li></ul></li></ul>
+<ol><li><ul><li><ul><li>Level 3, but ordered</li></ul></li></ul></li></ol>
 
 !! end
 
 !! test
 1. Nested mixed wikitext and html list
 !! wikitext
-* hi
-* <ul><li>ho</li></ul>
-* hi
-** ho
+*hi
+*<ul><li>ho</li></ul>
+*hi
+**ho
 !! html/php
-<ul><li> hi</li>
-<li> <ul><li>ho</li></ul></li>
-<li> hi
-<ul><li> ho</li></ul></li></ul>
+<ul><li>hi</li>
+<li><ul><li>ho</li></ul></li>
+<li>hi
+<ul><li>ho</li></ul></li></ul>
 
 !! html/parsoid
-<ul><li> hi</li>
-<li> <ul data-parsoid='{"stx":"html"}'><li data-parsoid='{"stx":"html"}'>ho</li></ul></li>
-<li> hi
-<ul><li> ho</li></ul></li></ul>
+<ul><li>hi</li>
+<li><ul data-parsoid='{"stx":"html"}'><li data-parsoid='{"stx":"html"}'>ho</li></ul></li>
+<li>hi
+<ul><li>ho</li></ul></li></ul>
 !! end
 
 !! test
 2. Nested mixed wikitext and html list (incompatible)
 !! wikitext
-; hi
-: {{echo|<li>ho</li>}}
+;hi
+:{{echo|<li>ho</li>}}
 !! html/php
-<dl><dt> hi</dt>
-<dd> <li>ho</li></dd></dl>
+<dl><dt>hi</dt>
+<dd><li>ho</li></dd></dl>
 
 !! html/parsoid
-<dl><dt> hi</dt>
-<dd> <li about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>ho&lt;/li>"}},"i":0}}]}'>ho</li></dd></dl>
+<dl><dt>hi</dt>
+<dd><li about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>ho&lt;/li>"}},"i":0}}]}'>ho</li></dd></dl>
 !! end
 
 !! test
@@ -9642,24 +9642,24 @@ Nested lists 6 (both elements empty)
 !! test
 Nested lists 7 (skip initial nesting levels)
 !! wikitext
-*** foo
+***foo
 !! html
-<ul><li><ul><li><ul><li> foo</li></ul></li></ul></li></ul>
+<ul><li><ul><li><ul><li>foo</li></ul></li></ul></li></ul>
 
 !! end
 
 !! test
 Nested lists 8 (multiple nesting transitions)
 !! wikitext
-* foo
-*** bar
-** baz
-* boo
+*foo
+***bar
+**baz
+*boo
 !! html
-<ul><li> foo
-<ul><li><ul><li> bar</li></ul></li>
-<li> baz</li></ul></li>
-<li> boo</li></ul>
+<ul><li>foo
+<ul><li><ul><li>bar</li></ul></li>
+<li>baz</li></ul></li>
+<li>boo</li></ul>
 
 !! end
 
@@ -9700,60 +9700,61 @@ parsoid
 !! test
 List items are not parsed correctly following a <pre> block (T2785)
 !! wikitext
-* <pre>foo</pre>
-* <pre>bar</pre>
-* zar
+*<pre>foo</pre>
+*<pre>bar</pre>
+*zar
 !! html/php
-<ul><li> <pre>foo</pre></li>
-<li> <pre>bar</pre></li>
-<li> zar</li></ul>
+<ul><li><pre>foo</pre></li>
+<li><pre>bar</pre></li>
+<li>zar</li></ul>
 
 !! html/parsoid
-<ul><li> <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"foo"}}'>foo</pre></li>
-<li> <pre typeof="mw:Extension/pre" about="#mwt4" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"bar"}}'>bar</pre></li>
-<li> zar</li></ul>
+<ul><li><pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"foo"}}'>foo</pre></li>
+<li><pre typeof="mw:Extension/pre" about="#mwt4" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"bar"}}'>bar</pre></li>
+<li>zar</li></ul>
 !! end
 
+# FIXME: Might benefit from a html/parsoid since this has a template
 !! test
 List items from template
 !! wikitext
 
 {{inner list}}
-* item 2
+*item 2
 
-* item 0
+*item 0
 {{inner list}}
-* item 2
+*item 2
 
-* item 0
-* notSOL{{inner list}}
-* item 2
+*item 0
+*notSOL{{inner list}}
+*item 2
 !! html
-<ul><li> item 1</li>
-<li> item 2</li></ul>
-<ul><li> item 0</li>
-<li> item 1</li>
-<li> item 2</li></ul>
-<ul><li> item 0</li>
-<li> notSOL</li>
-<li> item 1</li>
-<li> item 2</li></ul>
+<ul><li>item 1</li>
+<li>item 2</li></ul>
+<ul><li>item 0</li>
+<li>item 1</li>
+<li>item 2</li></ul>
+<ul><li>item 0</li>
+<li>notSOL</li>
+<li>item 1</li>
+<li>item 2</li></ul>
 
 !! end
 
 !! test
 List interrupted by empty line or heading
 !! wikitext
-* foo
+*foo
 
-** bar
-== A heading ==
-* Another list item
+**bar
+==A heading==
+*Another list item
 !! html
-<ul><li> foo</li></ul>
-<ul><li><ul><li> bar</li></ul></li></ul>
+<ul><li>foo</li></ul>
+<ul><li><ul><li>bar</li></ul></li></ul>
 <h2><span class="mw-headline" id="A_heading">A heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: A heading">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-<ul><li> Another list item</li></ul>
+<ul><li>Another list item</li></ul>
 
 !!end
 
@@ -9775,6 +9776,10 @@ Multiple list tags generated by templates
 </li><li>b
 </li><li>c
 </li>
+!! html/parsoid
+<li about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[0,44,null,null],"pi":[[{"k":"1"}],[{"k":"1"}],[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>"}},"i":0}},"a\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>"}},"i":1}},"b\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>"}},"i":2}},"c"]}'>a
+</li><li about="#mwt1">b
+</li><li about="#mwt1" data-parsoid='{"stx":"html","autoInsertedEnd":true,"dsr":[null,44,null,0]}'>c</li>
 !!end
 
 !!test
@@ -9821,29 +9826,29 @@ Test the li-hack (a hack from Tidy days, but doesn't work as advertised with Rem
 !!options
 parsoid=wt2html,wt2wt
 !! wikitext
-* foo
-* <li>li-hack
-* {{echo|<li>templated li-hack}}
-* <!--foo--> <li> unsupported li-hack with preceding comments
+*foo
+*<li>li-hack
+*{{echo|<li>templated li-hack}}
+*<!--foo--><li> unsupported li-hack with preceding comments
 
 <ul>
 <li><li>not a li-hack
 </li>
 </ul>
 !! html+tidy
-<ul><li> foo</li>
-<li class="mw-empty-elt"> </li><li>li-hack</li>
-<li class="mw-empty-elt"> </li><li>templated li-hack</li>
-<li class="mw-empty-elt">  </li><li> unsupported li-hack with preceding comments</li></ul>
+<ul><li>foo</li>
+<li class="mw-empty-elt"></li><li>li-hack</li>
+<li class="mw-empty-elt"></li><li>templated li-hack</li>
+<li class="mw-empty-elt"></li><li> unsupported li-hack with preceding comments</li></ul>
 <ul>
 <li class="mw-empty-elt"></li><li>not a li-hack
 </li>
 </ul>
 !! html/parsoid
 <ul><li> foo</li>
-<li data-parsoid='{"stx":"html","autoInsertedEnd":true,"liHackSrc":"* "}'>li-hack</li>
-<li about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","autoInsertedEnd":true,,"pi":[[{"k":"1"}]]}' data-mw='{"parts":["* ",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>templated li-hack"}},"i":0}}]}'>templated li-hack</li>
-<li data-parsoid='{"autoInsertedEnd":true}'> <!--foo--> </li><li data-parsoid='{"stx":"html","autoInsertedEnd":true}'> unsupported li-hack with preceding comments</li></ul>
+<li data-parsoid='{"stx":"html","autoInsertedEnd":true,"liHackSrc":"*"}'>li-hack</li>
+<li about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","autoInsertedEnd":true,,"pi":[[{"k":"1"}]]}' data-mw='{"parts":["*",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;li>templated li-hack"}},"i":0}}]}'>templated li-hack</li>
+<li data-parsoid='{"autoInsertedEnd":true}'><!--foo--></li><li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>unsupported li-hack with preceding comments</li></ul>
 
 <ul data-parsoid='{"stx":"html"}'>
 <li class="mw-empty-elt" data-parsoid='{"stx":"html","autoInsertedEnd":true}'></li><li data-parsoid='{"stx":"html"}'>not a li-hack
@@ -9857,24 +9862,24 @@ Parsoid: Make sure nested lists are serialized on their own line even if HTML co
 !! options
 parsoid
 !! wikitext
-# foo
-## bar
-* foo
-** bar
-: foo
-:: bar
+#foo
+##bar
+*foo
+**bar
+:foo
+::bar
 !! html
 <ol>
-<li> foo<ol>
-<li> bar</li>
+<li>foo<ol>
+<li>bar</li>
 </ol></li>
 </ol><ul>
-<li> foo<ul>
-<li> bar</li>
+<li>foo<ul>
+<li>bar</li>
 </ul></li>
 </ul><dl>
-<dd> foo<dl>
-<dd> bar</dd>
+<dd>foo<dl>
+<dd>bar</dd>
 </dl></dd>
 </dl>
 !! end
@@ -9908,7 +9913,7 @@ Unbalanced closing block tags break a list
 <div>
 <ul><li>a</li></ul></div><div>
 <li>b</li></div>
-!! html+parsoid
+!! html/parsoid
 <div><ul>
 <li>a</li>
 </ul></div>
@@ -9944,14 +9949,14 @@ Unclosed formatting tags that straddle lists are closed and reopened
 !! options
 parsoid=wt2html,wt2wt,html2html
 !! wikitext
-# <s> a
-# b </s>
+#<s> a
+#b </s>
 !! html/php+tidy
-<ol><li> <s> a</s></li><s>
-</s><li><s> b </s></li></ol>
+<ol><li><s> a</s></li><s>
+</s><li><s>b </s></li></ol>
 !! html/parsoid
-<ol><li> <s> a</s><s></s></li>
-<li><s> b </s></li></ol>
+<ol><li><s> a</s></li>
+<li><s>b </s></li></ol>
 !! end
 
 # Output is ugly because of all the misnested tag fixups.
@@ -9966,16 +9971,16 @@ parsoid=wt2html,wt2wt,html2html
 1. List embedded in a formatting tag
 !! wikitext
 <small>
-* foo
+*foo
 </small>
 !! html/php+tidy
 <p><small>
-</small></p><small><ul><li> foo</li></ul></small><small></small><p><small></small>
+</small></p><small><ul><li>foo</li></ul></small><small></small><p><small></small>
 </p>
 !! html/parsoid
 <small>
 <ul>
-<li> foo</li>
+<li>foo</li>
 </ul>
 </small>
 !!end
@@ -10156,35 +10161,35 @@ Magic Word: {{CURRENTTIMESTAMP}}
 !! test
 Magic Words LOCAL (UTC)
 !! wikitext
-* {{LOCALMONTH}}
-* {{LOCALMONTH1}}
-* {{LOCALMONTHNAME}}
-* {{LOCALMONTHNAMEGEN}}
-* {{LOCALMONTHABBREV}}
-* {{LOCALDAY}}
-* {{LOCALDAY2}}
-* {{LOCALDAYNAME}}
-* {{LOCALYEAR}}
-* {{LOCALTIME}}
-* {{LOCALHOUR}}
-* {{LOCALWEEK}}
-* {{LOCALDOW}}
-* {{LOCALTIMESTAMP}}
-!! html
-<ul><li> 01</li>
-<li> 1</li>
-<li> January</li>
-<li> January</li>
-<li> Jan</li>
-<li> 1</li>
-<li> 01</li>
-<li> Thursday</li>
-<li> 1970</li>
-<li> 00:02</li>
-<li> 00</li>
-<li> 1</li>
-<li> 4</li>
-<li> 19700101000203</li></ul>
+*{{LOCALMONTH}}
+*{{LOCALMONTH1}}
+*{{LOCALMONTHNAME}}
+*{{LOCALMONTHNAMEGEN}}
+*{{LOCALMONTHABBREV}}
+*{{LOCALDAY}}
+*{{LOCALDAY2}}
+*{{LOCALDAYNAME}}
+*{{LOCALYEAR}}
+*{{LOCALTIME}}
+*{{LOCALHOUR}}
+*{{LOCALWEEK}}
+*{{LOCALDOW}}
+*{{LOCALTIMESTAMP}}
+!! html
+<ul><li>01</li>
+<li>1</li>
+<li>January</li>
+<li>January</li>
+<li>Jan</li>
+<li>1</li>
+<li>01</li>
+<li>Thursday</li>
+<li>1970</li>
+<li>00:02</li>
+<li>00</li>
+<li>1</li>
+<li>4</li>
+<li>19700101000203</li></ul>
 
 !! end
 
@@ -11250,11 +11255,11 @@ Templates with templated name
 !! html
 <p>foo
 </p>
-<ul><li> item 1</li></ul>
+<ul><li>item 1</li></ul>
 
 !! html/parsoid
 <p about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"{{echo|echo}}","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p>
-<ul about="#mwt4" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"{{echo|inner list}} ","href":"./Template:Inner_list"},"params":{},"i":0}}]}'><li> item 1</li></ul>
+<ul about="#mwt4" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"{{echo|inner list}} ","href":"./Template:Inner_list"},"params":{},"i":0}}]}'><li>item 1</li></ul>
 !! end
 
 ## Regression test; the output here isn't really that interesting.
@@ -11338,28 +11343,28 @@ T2553: link with two variables in a piped link
 Abort table cell attribute parsing on wikilink
 !! wikitext
 {|
-| testing [[one|two]] | three || four
-| testing one two | three || four
-| testing="[[one|two]]" | three || four
+|testing [[one|two]] |three||four
+|testing one two |three||four
+|testing="[[one|two]]" |three||four
 |}
 !! html/php
 <table>
 <tr>
-<td> testing <a href="/index.php?title=One&amp;action=edit&amp;redlink=1" class="new" title="One (page does not exist)">two</a> | three </td>
-<td> four
+<td>testing <a href="/index.php?title=One&amp;action=edit&amp;redlink=1" class="new" title="One (page does not exist)">two</a> |three</td>
+<td>four
 </td>
-<td> three </td>
-<td> four
+<td>three</td>
+<td>four
 </td>
-<td> testing="<a href="/index.php?title=One&amp;action=edit&amp;redlink=1" class="new" title="One (page does not exist)">two</a>" | three </td>
-<td> four
+<td>testing="<a href="/index.php?title=One&amp;action=edit&amp;redlink=1" class="new" title="One (page does not exist)">two</a>" |three</td>
+<td>four
 </td></tr></table>
 
 !! html/parsoid
 <table>
-<tbody><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td data-parsoid='{"autoInsertedEnd":true}'> testing <a rel="mw:WikiLink" href="./One" title="One" data-parsoid='{"stx":"piped","a":{"href":"./One"},"sa":{"href":"one"}}'>two</a> | three </td><td data-parsoid='{"stx":"row","autoInsertedEnd":true}'> four</td>
-<td data-parsoid='{"a":{"testing":null,"one":null,"two":null},"sa":{"testing":"","one":"","two":""},"autoInsertedEnd":true}'> three </td><td data-parsoid='{"stx":"row","autoInsertedEnd":true}'> four</td>
-<td> testing="<a rel="mw:WikiLink" href="./One" title="One" data-parsoid='{"stx":"piped","a":{"href":"./One"},"sa":{"href":"one"}}'>two</a>" | three </td><td data-parsoid='{"stx":"row","autoInsertedEnd":true}'> four</td></tr>
+<tbody><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td data-parsoid='{"autoInsertedEnd":true}'>testing <a rel="mw:WikiLink" href="./One" title="One" data-parsoid='{"stx":"piped","a":{"href":"./One"},"sa":{"href":"one"}}'>two</a> |three</td><td data-parsoid='{"stx":"row","autoInsertedEnd":true}'>four</td>
+<td data-parsoid='{"a":{"testing":null,"one":null,"two":null},"sa":{"testing":"","one":"","two":""},"autoInsertedEnd":true}'>three</td><td data-parsoid='{"stx":"row","autoInsertedEnd":true}'>four</td>
+<td>testing="<a rel="mw:WikiLink" href="./One" title="One" data-parsoid='{"stx":"piped","a":{"href":"./One"},"sa":{"href":"one"}}'>two</a>" |three</td><td data-parsoid='{"stx":"row","autoInsertedEnd":true}'>four</td></tr>
 </tbody></table>
 !! end
 
@@ -11367,11 +11372,11 @@ Abort table cell attribute parsing on wikilink
 Don't abort table cell attribute parsing if wikilink is found in template arg
 !! wikitext
 {|
-| Test {{#tag:ref|One two "[[three]]" four}}
+|Test {{#tag:ref|One two "[[three]]" four}}
 |}
 !! html/parsoid
 <table>
-<tbody><tr><td> Test <ref about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"#tag:ref","function":"tag"},"params":{"1":{"wt":"One two \"[[three]]\" four"}},"i":0}}]}'>One two "<a rel="mw:WikiLink" href="./Three" title="Three">three</a>" four</ref></td></tr>
+<tbody><tr><td>Test <ref about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"#tag:ref","function":"tag"},"params":{"1":{"wt":"One two \"[[three]]\" four"}},"i":0}}]}'>One two "<a rel="mw:WikiLink" href="./Three" title="Three">three</a>" four</ref></td></tr>
 </tbody></table>
 !! end
 
@@ -11485,12 +11490,12 @@ foo {{table}}
 </p>
 <table>
 <tr>
-<td> 1 </td>
-<td> 2
+<td>1</td>
+<td>2
 </td></tr>
 <tr>
-<td> 3 </td>
-<td> 4
+<td>3</td>
+<td>4
 </td></tr></table>
 
 !! end
@@ -11505,12 +11510,12 @@ foo
 </p>
 <table>
 <tr>
-<td> 1 </td>
-<td> 2
+<td>1</td>
+<td>2
 </td></tr>
 <tr>
-<td> 3 </td>
-<td> 4
+<td>3</td>
+<td>4
 </td></tr></table>
 
 !! end
@@ -11828,32 +11833,32 @@ Includes and comments at SOL
 !! options
 parsoid=wt2html,html2html
 !! wikitext
-<!-- comment --><noinclude><!-- comment --></noinclude><!-- comment -->== hu ==
+<!-- comment --><noinclude><!-- comment --></noinclude><!-- comment -->==hu==
 
 <noinclude>
 some
-</noinclude>* stuff
-* here
+</noinclude>*stuff
+*here
 
-<includeonly>can have stuff</includeonly>=== here ===
+<includeonly>can have stuff</includeonly>===here===
 
 !! html/php
 <h2><span class="mw-headline" id="hu">hu</span></h2>
 <p>some
 </p>
-<ul><li> stuff</li>
-<li> here</li></ul>
+<ul><li>stuff</li>
+<li>here</li></ul>
 <h3><span class="mw-headline" id="here">here</span></h3>
 
 !! html/parsoid
-<!-- comment --><meta typeof="mw:Includes/NoInclude" data-parsoid='{"src":"&lt;noinclude>"}'/><!-- comment --><meta typeof="mw:Includes/NoInclude/End" data-parsoid='{"src":"&lt;/noinclude>"}'/><!-- comment --><h2 id="hu"> hu </h2>
+<!-- comment --><meta typeof="mw:Includes/NoInclude" data-parsoid='{"src":"&lt;noinclude>"}'/><!-- comment --><meta typeof="mw:Includes/NoInclude/End" data-parsoid='{"src":"&lt;/noinclude>"}'/><!-- comment --><h2 id="hu">hu</h2>
 
 <meta typeof="mw:Includes/NoInclude" data-parsoid='{"src":"&lt;noinclude>"}'/>
 <p>some</p>
-<meta typeof="mw:Includes/NoInclude/End" data-parsoid='{"src":"&lt;/noinclude>"}'/><ul><li> stuff</li>
-<li> here</li></ul>
+<meta typeof="mw:Includes/NoInclude/End" data-parsoid='{"src":"&lt;/noinclude>"}'/><ul><li>stuff</li>
+<li>here</li></ul>
 
-<meta typeof="mw:Includes/IncludeOnly" data-parsoid='{"src":"&lt;includeonly>can have stuff&lt;/includeonly>"}'/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid='{"src":""}'/><h3 id="here"> here </h3>
+<meta typeof="mw:Includes/IncludeOnly" data-parsoid='{"src":"&lt;includeonly>can have stuff&lt;/includeonly>"}'/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid='{"src":""}'/><h3 id="here">here</h3>
 
 !! end
 
@@ -12072,10 +12077,10 @@ Preprocessor precedence 5: tplarg takes precedence over template
 !! wikitext
 {{Precedence5|Bullet}}
 !! html/php
-<ul><li> Bar</li></ul>
+<ul><li>Bar</li></ul>
 
 !! html/parsoid
-<ul typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Precedence5","href":"./Template:Precedence5"},"params":{"1":{"wt":"Bullet"}},"i":0}}]}'><li> Bar</li></ul>
+<ul typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Precedence5","href":"./Template:Precedence5"},"params":{"1":{"wt":"Bullet"}},"i":0}}]}'><li>Bar</li></ul>
 !! end
 
 !! test
@@ -12165,14 +12170,14 @@ Preprocessor precedence 9: groups of braces
 {{Preprocessor precedence 9|Four|Bullet|1|2}}
 !! html/php
 <dl><dt>4</dt>
-<dd> {Four}</dd>
+<dd>{Four}</dd>
 <dt>5</dt>
-<dd> </dd></dl>
-<ul><li> Bar</li></ul>
+<dd></dd></dl>
+<ul><li>Bar</li></ul>
 <dl><dt>6</dt>
-<dd> Four</dd>
+<dd>Four</dd>
 <dt>7</dt>
-<dd> {Bullet}</dd></dl>
+<dd>{Bullet}</dd></dl>
 
 !! html/parsoid
 <dl about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Preprocessor precedence 9","href":"./Template:Preprocessor_precedence_9"},"params":{"1":{"wt":"Four"},"2":{"wt":"Bullet"},"3":{"wt":"1"},"4":{"wt":"2"}},"i":0}}]}'>
@@ -12210,21 +12215,21 @@ language=zh
 {{Preprocessor precedence 10|Three|raw2|Bullet|1|2}}
 !! html/php
 <dl><dt>1</dt>
-<dd> raw</dd>
+<dd>raw</dd>
 <dt>2</dt>
-<dd> -</dd></dl>
-<ul><li> Bar-</li></ul>
+<dd>-</dd></dl>
+<ul><li>Bar-</li></ul>
 <dl><dt>3</dt>
-<dd> -Three-</dd>
+<dd>-Three-</dd>
 <dt>4</dt>
-<dd> raw2</dd>
+<dd>raw2</dd>
 <dt>5</dt>
-<dd> -</dd></dl>
-<ul><li> Bar-</li></ul>
+<dd>-</dd></dl>
+<ul><li>Bar-</li></ul>
 <dl><dt>6</dt>
-<dd> -Three-</dd>
+<dd>-Three-</dd>
 <dt>7</dt>
-<dd> raw2</dd></dl>
+<dd>raw2</dd></dl>
 
 !! html/parsoid
 <dl about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Preprocessor precedence 10","href":"./Template:Preprocessor_precedence_10"},"params":{"1":{"wt":"Three"},"2":{"wt":"raw2"},"3":{"wt":"Bullet"},"4":{"wt":"1"},"5":{"wt":"2"}},"i":0}}]}'>
@@ -12278,14 +12283,14 @@ Preprocessor precedence 12: broken language converter closed by brace.
 parsoid=wt2html
 !! wikitext
 This form breaks the template, which is unfortunate:
-* {{echo|foo-{bar}bat}}
+*{{echo|foo-{bar}bat}}
 
 But if the broken language converter markup is inside an extension
 tag, nothing bad happens:
-* <nowiki>foo-{bar}bat</nowiki>
-* {{echo|<nowiki>foo-{bar}bat</nowiki>}}
-* <pre>foo-{bar}bat</pre>
-* {{echo|<pre>foo-{bar}bat</pre>}}
+*<nowiki>foo-{bar}bat</nowiki>
+*{{echo|<nowiki>foo-{bar}bat</nowiki>}}
+*<pre>foo-{bar}bat</pre>
+*{{echo|<pre>foo-{bar}bat</pre>}}
 
 <tag>foo-{bar}bat</tag>
 {{echo|<tag>foo-{bar}bat</tag>}}
@@ -12293,14 +12298,14 @@ tag, nothing bad happens:
 !! html/php+tidy
 <p>This form breaks the template, which is unfortunate:
 </p>
-<ul><li> {{echo|foo-{bar}bat}}</li></ul>
+<ul><li>{{echo|foo-{bar}bat}}</li></ul>
 <p>But if the broken language converter markup is inside an extension
 tag, nothing bad happens:
 </p>
-<ul><li> foo-&#123;bar}bat</li>
-<li> foo-&#123;bar}bat</li>
-<li> <pre>foo-{bar}bat</pre></li>
-<li> <pre>foo-{bar}bat</pre></li></ul>
+<ul><li>foo-&#123;bar}bat</li>
+<li>foo-&#123;bar}bat</li>
+<li><pre>foo-{bar}bat</pre></li>
+<li><pre>foo-{bar}bat</pre></li></ul>
 <pre>'foo-{bar}bat'
 array (
 )
@@ -12329,13 +12334,13 @@ Preprocessor precedence 13: broken language converter in external link
 !! options
 parsoid=wt2html
 !! wikitext
-* [http://example.com/-{foo Example in URL]
-* [http://example.com Example in -{link} description]
-* {{echo|[http://example.com/-{foo Breaks template, however]}}
+*[http://example.com/-{foo Example in URL]
+*[http://example.com Example in -{link} description]
+*{{echo|[http://example.com/-{foo Breaks template, however]}}
 !! html/php+tidy
-<ul><li> <a rel="nofollow" class="external text" href="http://example.com/-{foo">Example in URL</a></li>
-<li> <a rel="nofollow" class="external text" href="http://example.com">Example in -{link} description</a></li>
-<li> {{echo|<a rel="nofollow" class="external text" href="http://example.com/-{foo">Breaks template, however</a>}}</li></ul>
+<ul><li><a rel="nofollow" class="external text" href="http://example.com/-{foo">Example in URL</a></li>
+<li><a rel="nofollow" class="external text" href="http://example.com">Example in -{link} description</a></li>
+<li>{{echo|<a rel="nofollow" class="external text" href="http://example.com/-{foo">Breaks template, however</a>}}</li></ul>
 !! html/parsoid
 <ul>
 <li><a rel="mw:ExtLink" class="external text" href="http://example.com/-{foo">Example in URL</a></li>
@@ -12347,18 +12352,18 @@ parsoid=wt2html
 !! test
 Preprocessor precedence 14: broken language converter in comment
 !! wikitext
-* <!--{{foo}}--> ...should be ok
-* <!---{{foo}}--> ...extra dashes
-* {{echo|foo<!-- -{bar} -->bat}} ...should be ok
+*<!--{{foo}}-->...should be ok
+*<!---{{foo}}-->...extra dashes
+*{{echo|foo<!-- -{bar} -->bat}}...should be ok
 !! html/php+tidy
-<ul><li>  ...should be ok</li>
-<li>  ...extra dashes</li>
-<li> foobat ...should be ok</li></ul>
+<ul><li>...should be ok</li>
+<li>...extra dashes</li>
+<li>foobat...should be ok</li></ul>
 !! html/parsoid
 <ul>
-<li><!--{{foo}}--> ...should be ok</li>
-<li><!--&#x2D;{{foo}}--> ...extra dashes</li>
-<li><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo&lt;!-- -{bar} -->bat"}},"i":0}}]}'>foo</span><span about="#mwt1"><!-- &#x2D;{bar} --></span><span about="#mwt1">bat</span> ...should be ok</li>
+<li><!--{{foo}}-->...should be ok</li>
+<li><!--&#x2D;{{foo}}-->...extra dashes</li>
+<li><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo&lt;!-- -{bar} -->bat"}},"i":0}}]}'>foo</span><span about="#mwt1"><!-- &#x2D;{bar} --></span><span about="#mwt1">bat</span>...should be ok</li>
 </ul>
 !! end
 
@@ -12908,17 +12913,17 @@ Templates: Support for templates generating attributes and content
 4. Entities and nowikis inside templated attributes should be handled correctly inside templated tables
 !! wikitext
 {|
-| {{table_attribs_6}} hi
+|{{table_attribs_6}} hi
 |}
 !! html/php
 <table>
 <tr>
-<td style="background: red;"> hi
+<td style="background: red;">hi
 </td></tr></table>
 
 !! html/parsoid
 <table>
-<tbody><tr><td style="background:  red;" typeof="mw:Transclusion" about="#mwt1" data-parsoid='{"autoInsertedEnd":true,"pi":[[]]}' data-mw='{"parts":["| ",{"template":{"target":{"wt":"table_attribs_6","href":"./Template:Table_attribs_6"},"params":{},"i":0}}," hi"]}'> hi</td></tr>
+<tbody><tr><td style="background:  red;" typeof="mw:Transclusion" about="#mwt1" data-parsoid='{"autoInsertedEnd":true,"pi":[[]]}' data-mw='{"parts":["|",{"template":{"target":{"wt":"table_attribs_6","href":"./Template:Table_attribs_6"},"params":{},"i":0}}," hi"]}'> hi</td></tr>
 </tbody></table>
 !! end
 
@@ -13037,10 +13042,14 @@ Templates: Wiki Tables: 1a. Fostering of entire template content
 a
 <tr><td></td></tr></table>
 
-!! html+tidy
+!! html/php+tidy
 
 a
 <table><tbody><tr><td></td></tr></tbody></table>
+!! html/parsoid
+<p about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"fostered":true,"autoInsertedEnd":true,"firstWikitextNode":"TABLE","pi":[[{"k":"1"}]]}' data-mw='{"parts":["{|\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a"}},"i":0}},"\n|}"]}'>a</p><table about="#mwt2">
+
+</table>
 !! end
 
 !!test
@@ -15156,6 +15165,10 @@ Image: caption containing leading space
 <figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption> bar</figcaption></figure>
 !!end
 
+# html/php output not have newlines after table, td, th, etc. because
+# Linker::makeThumbLink2() replaces the newlines with spaces since
+# the table is inside a caption.
+# FIXME: Verify if that circa 2004 fix is still required.
 !! test
 Image: caption containing a table
 !! options
@@ -15163,21 +15176,21 @@ parsoid=wt2html,wt2wt,html2html
 !! wikitext
 [[Image:Foobar.jpg|thumb|200px|This is an example image thumbnail caption with a table
 {|
-! Foo !! Bar
+!Foo!!Bar
 |-
-| Foo1 || Bar1
+|Foo1||Bar1
 |}
 and some more text.]]
 !! html/php
-<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is an example image thumbnail caption with a table <table> <tr> <th> Foo </th> <th> Bar </th></tr> <tr> <td> Foo1 </td> <td> Bar1 </td></tr></table> and some more text.</div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is an example image thumbnail caption with a table <table> <tr> <th>Foo</th> <th>Bar </th></tr> <tr> <td>Foo1</td> <td>Bar1 </td></tr></table> and some more text.</div></div></div>
 
 !! html/parsoid
 <figure typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="23" width="200"/></a><figcaption>This is an example image thumbnail caption with a table
 <table>
 <tbody>
-<tr><th>Foo </th><th>Bar</th></tr>
+<tr><th>Foo</th><th>Bar</th></tr>
 <tr>
-<td>Foo1 </td>
+<td>Foo1</td>
 <td>Bar1</td></tr></tbody></table>and some more text.</figcaption></figure>
 !! end
 
@@ -16287,7 +16300,7 @@ es:1 fr:1
 !! test
 Basic section headings
 !! wikitext
-== Headline 1 ==
+==Headline 1==
 Some text
 
 ==Headline 2==
@@ -16309,12 +16322,12 @@ Blah blah
 !! test
 Section headings with TOC
 !! wikitext
-== Headline 1 ==
-=== Subheadline 1 ===
-===== Skipping a level =====
-====== Skipping a level ======
+==Headline 1==
+===Subheadline 1===
+=====Skipping a level=====
+======Skipping a level======
 
-== Headline 2 ==
+==Headline 2==
 Some text
 ===Another headline===
 !! html
@@ -16356,10 +16369,10 @@ Some text
 TOC anchors don't collide
 !! wikitext
 __FORCETOC__
-== Headline 2 ==
-== Headline ==
-== Headline 2 ==
-== Headline ==
+==Headline 2==
+==Headline==
+==Headline 2==
+==Headline==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -16384,16 +16397,16 @@ Handling of sections up to level 6 and beyond
 !! options
 parsoid=wt2html
 !! wikitext
-= Level 1 Heading=
-== Level 2 Heading==
-=== Level 3 Heading===
-==== Level 4 Heading====
-===== Level 5 Heading=====
-====== Level 6 Heading======
-======= Level 7 Heading=======
-======== Level 8 Heading========
-========= Level 9 Heading=========
-========== Level 10 Heading==========
+=Level 1 Heading=
+==Level 2 Heading==
+===Level 3 Heading===
+====Level 4 Heading====
+=====Level 5 Heading=====
+======Level 6 Heading======
+=======Level 7 Heading=======
+========Level 8 Heading========
+=========Level 9 Heading=========
+==========Level 10 Heading==========
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -16408,10 +16421,10 @@ parsoid=wt2html
 <li class="toclevel-5 tocsection-5"><a href="#Level_5_Heading"><span class="tocnumber">1.1.1.1.1</span> <span class="toctext">Level 5 Heading</span></a>
 <ul>
 <li class="toclevel-6 tocsection-6"><a href="#Level_6_Heading"><span class="tocnumber">1.1.1.1.1.1</span> <span class="toctext">Level 6 Heading</span></a></li>
-<li class="toclevel-6 tocsection-7"><a href="#.3D_Level_7_Heading.3D"><span class="tocnumber">1.1.1.1.1.2</span> <span class="toctext">= Level 7 Heading=</span></a></li>
-<li class="toclevel-6 tocsection-8"><a href="#.3D.3D_Level_8_Heading.3D.3D"><span class="tocnumber">1.1.1.1.1.3</span> <span class="toctext">== Level 8 Heading==</span></a></li>
-<li class="toclevel-6 tocsection-9"><a href="#.3D.3D.3D_Level_9_Heading.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.4</span> <span class="toctext">=== Level 9 Heading===</span></a></li>
-<li class="toclevel-6 tocsection-10"><a href="#.3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.5</span> <span class="toctext">==== Level 10 Heading====</span></a></li>
+<li class="toclevel-6 tocsection-7"><a href="#.3DLevel_7_Heading.3D"><span class="tocnumber">1.1.1.1.1.2</span> <span class="toctext">=Level 7 Heading=</span></a></li>
+<li class="toclevel-6 tocsection-8"><a href="#.3D.3DLevel_8_Heading.3D.3D"><span class="tocnumber">1.1.1.1.1.3</span> <span class="toctext">==Level 8 Heading==</span></a></li>
+<li class="toclevel-6 tocsection-9"><a href="#.3D.3D.3DLevel_9_Heading.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.4</span> <span class="toctext">===Level 9 Heading===</span></a></li>
+<li class="toclevel-6 tocsection-10"><a href="#.3D.3D.3D.3DLevel_10_Heading.3D.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.5</span> <span class="toctext">====Level 10 Heading====</span></a></li>
 </ul>
 </li>
 </ul>
@@ -16431,33 +16444,33 @@ parsoid=wt2html
 <h4><span class="mw-headline" id="Level_4_Heading">Level 4 Heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Level 4 Heading">edit</a><span class="mw-editsection-bracket">]</span></span></h4>
 <h5><span class="mw-headline" id="Level_5_Heading">Level 5 Heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Level 5 Heading">edit</a><span class="mw-editsection-bracket">]</span></span></h5>
 <h6><span class="mw-headline" id="Level_6_Heading">Level 6 Heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: Level 6 Heading">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
-<h6><span class="mw-headline" id=".3D_Level_7_Heading.3D">= Level 7 Heading=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=7" title="Edit section: = Level 7 Heading=">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
-<h6><span class="mw-headline" id=".3D.3D_Level_8_Heading.3D.3D">== Level 8 Heading==</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=8" title="Edit section: == Level 8 Heading==">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
-<h6><span class="mw-headline" id=".3D.3D.3D_Level_9_Heading.3D.3D.3D">=== Level 9 Heading===</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=9" title="Edit section: === Level 9 Heading===">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
-<h6><span class="mw-headline" id=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D">==== Level 10 Heading====</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=10" title="Edit section: ==== Level 10 Heading====">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
+<h6><span class="mw-headline" id=".3DLevel_7_Heading.3D">=Level 7 Heading=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=7" title="Edit section: =Level 7 Heading=">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
+<h6><span class="mw-headline" id=".3D.3DLevel_8_Heading.3D.3D">==Level 8 Heading==</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=8" title="Edit section: ==Level 8 Heading==">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
+<h6><span class="mw-headline" id=".3D.3D.3DLevel_9_Heading.3D.3D.3D">===Level 9 Heading===</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=9" title="Edit section: ===Level 9 Heading===">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
+<h6><span class="mw-headline" id=".3D.3D.3D.3DLevel_10_Heading.3D.3D.3D.3D">====Level 10 Heading====</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=10" title="Edit section: ====Level 10 Heading====">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
 
 !! html/parsoid
-<h1 id="Level_1_Heading" data-parsoid='{}'> Level 1 Heading</h1>
-<h2 id="Level_2_Heading" data-parsoid='{}'> Level 2 Heading</h2>
-<h3 id="Level_3_Heading" data-parsoid='{}'> Level 3 Heading</h3>
-<h4 id="Level_4_Heading" data-parsoid='{}'> Level 4 Heading</h4>
-<h5 id="Level_5_Heading" data-parsoid='{}'> Level 5 Heading</h5>
-<h6 id="Level_6_Heading" data-parsoid='{}'> Level 6 Heading</h6>
-<h6 id="=_Level_7_Heading=" data-parsoid='{}'><span id=".3D_Level_7_Heading.3D" typeof="mw:FallbackId"></span>= Level 7 Heading=</h6>
-<h6 id="==_Level_8_Heading==" data-parsoid='{}'><span id=".3D.3D_Level_8_Heading.3D.3D" typeof="mw:FallbackId"></span>== Level 8 Heading==</h6>
-<h6 id="===_Level_9_Heading===" data-parsoid='{}'><span id=".3D.3D.3D_Level_9_Heading.3D.3D.3D" typeof="mw:FallbackId"></span>=== Level 9 Heading===</h6>
-<h6 id="====_Level_10_Heading====" data-parsoid='{}'><span id=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D" typeof="mw:FallbackId"></span>==== Level 10 Heading====</h6>
+<h1 id="Level_1_Heading" data-parsoid='{}'>Level 1 Heading</h1>
+<h2 id="Level_2_Heading" data-parsoid='{}'>Level 2 Heading</h2>
+<h3 id="Level_3_Heading" data-parsoid='{}'>Level 3 Heading</h3>
+<h4 id="Level_4_Heading" data-parsoid='{}'>Level 4 Heading</h4>
+<h5 id="Level_5_Heading" data-parsoid='{}'>Level 5 Heading</h5>
+<h6 id="Level_6_Heading" data-parsoid='{}'>Level 6 Heading</h6>
+<h6 id="=Level_7_Heading=" data-parsoid='{}'><span id=".3D_Level_7_Heading.3D" typeof="mw:FallbackId"></span>=Level 7 Heading=</h6>
+<h6 id="==Level_8_Heading==" data-parsoid='{}'><span id=".3D.3D_Level_8_Heading.3D.3D" typeof="mw:FallbackId"></span>==Level 8 Heading==</h6>
+<h6 id="===Level_9_Heading===" data-parsoid='{}'><span id=".3D.3D.3D_Level_9_Heading.3D.3D.3D" typeof="mw:FallbackId"></span>===Level 9 Heading===</h6>
+<h6 id="====Level_10_Heading====" data-parsoid='{}'><span id=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D" typeof="mw:FallbackId"></span>====Level 10 Heading====</h6>
 !! end
 
 !! test
 TOC regression (T11764)
 !! wikitext
-== title 1 ==
-=== title 1.1 ===
-==== title 1.1.1 ====
-=== title 1.2 ===
-== title 2 ==
-=== title 2.1 ===
+==title 1==
+===title 1.1===
+====title 1.1.1====
+===title 1.2===
+==title 2==
+===title 2.1===
 !! html
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -16509,12 +16522,12 @@ TOC with wgMaxTocLevel=3 (T8204)
 !! options
 wgMaxTocLevel=3
 !! wikitext
-== title 1 ==
-=== title 1.1 ===
-==== title 1.1.1 ====
-=== title 1.2 ===
-== title 2 ==
-=== title 2.1 ===
+==title 1==
+===title 1.1===
+====title 1.1.1====
+===title 1.2===
+==title 2==
+===title 2.1===
 !! html
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -16575,8 +16588,8 @@ wgMaxTocLevel=3
 !! test
 Resolving duplicate section names
 !! wikitext
-== Foo bar ==
-== Foo bar ==
+==Foo bar==
+==Foo bar==
 !! html
 <h2><span class="mw-headline" id="Foo_bar">Foo bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Foo_bar_2">Foo bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
@@ -16586,8 +16599,8 @@ Resolving duplicate section names
 !! test
 Resolving duplicate section names with differing case (T12721)
 !! wikitext
-== Foo bar ==
-== Foo Bar ==
+==Foo bar==
+==Foo Bar==
 !! html
 <h2><span class="mw-headline" id="Foo_bar">Foo bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Foo_Bar_2">Foo Bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
@@ -16641,9 +16654,9 @@ Link inside a section heading
 TOC regression (T14077)
 !! wikitext
 __TOC__
-== title 1 ==
-=== title 1.1 ===
-== title 2 ==
+==title 1==
+===title 1.1===
+==title 2==
 !! html
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -16704,19 +16717,19 @@ Header with special characters (T27462)
 !! wikitext
 The tooltips shall not show entities to the user (ie. be double escaped)
 
-== text > text ==
+==text > text==
 section 1
 
-== text < text ==
+==text < text==
 section 2
 
-== text & text ==
+==text & text==
 section 3
 
-== text ' text ==
+==text ' text==
 section 4
 
-== text " text ==
+==text " text==
 section 5
 !! html/php
 <p>The tooltips shall not show entities to the user (ie. be double escaped)
@@ -16749,19 +16762,19 @@ section 5
 !! html/parsoid
 <p>The tooltips shall not show entities to the user (ie. be double escaped)</p>
 
-<h2 id="text_>_text"><span id="text_.3E_text" typeof="mw:FallbackId"></span> text > text </h2>
+<h2 id="text_>_text"><span id="text_.3E_text" typeof="mw:FallbackId"></span>text > text</h2>
 <p>section 1</p>
 
-<h2 id="text_&lt;_text"><span id="text_.3C_text" typeof="mw:FallbackId"></span> text &lt; text </h2>
+<h2 id="text_&lt;_text"><span id="text_.3C_text" typeof="mw:FallbackId"></span>text &lt; text</h2>
 <p>section 2</p>
 
-<h2 id="text_&amp;_text"><span id="text_.26_text" typeof="mw:FallbackId"></span> text &amp; text </h2>
+<h2 id="text_&amp;_text"><span id="text_.26_text" typeof="mw:FallbackId"></span>text &amp; text</h2>
 <p>section 3</p>
 
-<h2 id="text_'_text"><span id="text_.27_text" typeof="mw:FallbackId"></span> text ' text </h2>
+<h2 id="text_'_text"><span id="text_.27_text" typeof="mw:FallbackId"></span>text ' text</h2>
 <p>section 4</p>
 
-<h2 id='text_"_text'><span id="text_.22_text" typeof="mw:FallbackId"></span> text " text </h2>
+<h2 id='text_"_text'><span id="text_.22_text" typeof="mw:FallbackId"></span>text " text</h2>
 <p>section 5</p>
 !! end
 
@@ -16770,22 +16783,22 @@ Header with space, plus and underscore as entity
 !! wikitext
 Id should not contain + for spaces
 
-== Space between Text ==
+==Space between Text==
 section 1
 
-== Space-Entity&#32;between&#32;Text ==
+==Space-Entity&#32;between&#32;Text==
 section 2
 
-== Plus+between+Text ==
+==Plus+between+Text==
 section 3
 
-== Plus-Entity&#43;between&#43;Text ==
+==Plus-Entity&#43;between&#43;Text==
 section 4
 
-== Underscore_between_Text ==
+==Underscore_between_Text==
 section 5
 
-== Underscore-Entity&#95;between&#95;Text ==
+==Underscore-Entity&#95;between&#95;Text==
 section 6
 
 [[#Space between Text]]
@@ -16835,22 +16848,22 @@ section 6
 !! html/parsoid
 <p>Id should not contain + for spaces</p>
 
-<h2 id="Space_between_Text"> Space between Text </h2>
+<h2 id="Space_between_Text">Space between Text</h2>
 <p>section 1</p>
 
-<h2 id="Space-Entity_between_Text"> Space-Entity<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#32;","srcContent":" "}'> </span>between<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#32;","srcContent":" "}'> </span>Text </h2>
+<h2 id="Space-Entity_between_Text">Space-Entity<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#32;","srcContent":" "}'> </span>between<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#32;","srcContent":" "}'> </span>Text</h2>
 <p>section 2</p>
 
-<h2 id="Plus+between+Text"><span id="Plus.2Bbetween.2BText" typeof="mw:FallbackId"></span> Plus+between+Text </h2>
+<h2 id="Plus+between+Text"><span id="Plus.2Bbetween.2BText" typeof="mw:FallbackId"></span>Plus+between+Text</h2>
 <p>section 3</p>
 
-<h2 id="Plus-Entity+between+Text"><span id="Plus-Entity.2Bbetween.2BText" typeof="mw:FallbackId"></span> Plus-Entity<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#43;","srcContent":"+"}'>+</span>between<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#43;","srcContent":"+"}'>+</span>Text </h2>
+<h2 id="Plus-Entity+between+Text"><span id="Plus-Entity.2Bbetween.2BText" typeof="mw:FallbackId"></span>Plus-Entity<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#43;","srcContent":"+"}'>+</span>between<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#43;","srcContent":"+"}'>+</span>Text</h2>
 <p>section 4</p>
 
-<h2 id="Underscore_between_Text"> Underscore_between_Text </h2>
+<h2 id="Underscore_between_Text">Underscore_between_Text</h2>
 <p>section 5</p>
 
-<h2 id="Underscore-Entity_between_Text"> Underscore-Entity<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#95;","srcContent":"_"}'>_</span>between<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#95;","srcContent":"_"}'>_</span>Text </h2>
+<h2 id="Underscore-Entity_between_Text">Underscore-Entity<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#95;","srcContent":"_"}'>_</span>between<span typeof="mw:Entity" data-parsoid='{"src":"&amp;#95;","srcContent":"_"}'>_</span>Text</h2>
 <p>section 6</p>
 
 <p><a rel="mw:WikiLink" href="./Main_Page#Space_between_Text" data-parsoid='{"stx":"simple","a":{"href":"./Main_Page#Space_between_Text"},"sa":{"href":"#Space between Text"}}'>#Space between Text</a>
@@ -16899,13 +16912,13 @@ HTML headers vs TOC (T25393)
 (__NOEDITSECTION__ for clearer output, doesn't matter here)
 !! wikitext
 <h1>Header 1</h1>
-== Header 1.1 ==
-== Header 1.2 ==
+==Header 1.1==
+==Header 1.2==
 
 <h1>Header 2
 </h1>
-== Header 2.1 ==
-== Header 2.2 ==
+==Header 2.1==
+==Header 2.2==
 __NOEDITSECTION__
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
@@ -16934,13 +16947,13 @@ __NOEDITSECTION__
 
 !! html/parsoid
 <h1 id="Header_1" data-parsoid='{"stx":"html"}'>Header 1</h1>
-<h2 id="Header_1.1" data-parsoid='{}'> Header 1.1 </h2>
-<h2 id="Header_1.2" data-parsoid='{}'> Header 1.2 </h2>
+<h2 id="Header_1.1" data-parsoid='{}'>Header 1.1</h2>
+<h2 id="Header_1.2" data-parsoid='{}'>Header 1.2</h2>
 
 <h1 id="Header_2" data-parsoid='{"stx":"html"}'>Header 2
 </h1>
-<h2 id="Header_2.1" data-parsoid='{}'> Header 2.1 </h2>
-<h2 id="Header_2.2" data-parsoid='{}'> Header 2.2 </h2>
+<h2 id="Header_2.1" data-parsoid='{}'>Header 2.1</h2>
+<h2 id="Header_2.2" data-parsoid='{}'>Header 2.2</h2>
 <meta property="mw:PageProp/noeditsection"/>
 !! end
 
@@ -17104,17 +17117,17 @@ table with multiple empty attribute values
 parsoid=wt2html,html2html
 !! wikitext
 {| title= id=
-| hi
+|hi
 |}
 !! html/php
 <table title="id=">
 <tr>
-<td> hi
+<td>hi
 </td></tr></table>
 
 !! html/parsoid
 <table title="id=">
-<tbody><tr><td> hi</td></tr>
+<tbody><tr><td>hi</td></tr>
 </tbody></table>
 !! end
 
@@ -17155,12 +17168,12 @@ HTML multiple attributes correction
 Table multiple attributes correction
 !! wikitext
 {|
-!+ class="error" class="awesome"| status
+!+ class="error" class="awesome"|status
 |}
 !! html
 <table>
 <tr>
-<th class="awesome"> status
+<th class="awesome">status
 </th></tr></table>
 
 !!end
@@ -17386,9 +17399,8 @@ Media link with nasty text
 !! html/php
 <a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link&lt;div style="display:none"&gt;" onmouseover="alert(document.cookie)" onfoo="&lt;/div&gt;</a>
 
-!! html+php/tidy
-<p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link</a></p>
-<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div>
+!! html/php+tidy
+<p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link</a></p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg"><div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div></a>
 !! html/parsoid
 <p><a rel="mw:MediaLink" href="//example.com/images/3/3a/Foobar.jpg" title="Foobar.jpg" data-parsoid='{"autoInsertedEnd":true}'>Safe Link</a></p><div style="display:none" data-parsoid='{"stx":"html"}'><a rel="mw:MediaLink" href="//example.com/images/3/3a/Foobar.jpg" title="Foobar.jpg" data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'>" onmouseover="alert(document.cookie)" onfoo="</a></div>
 
@@ -17912,12 +17924,12 @@ MSIE 6 CSS safety test: Repetition markers (T57332)
 Table attribute legitimate extension
 !! wikitext
 {|
-!+ style="<nowiki>color:blue</nowiki>"| status
+!+ style="<nowiki>color:blue</nowiki>"|status
 |}
 !! html
 <table>
 <tr>
-<th style="color:blue"> status
+<th style="color:blue">status
 </th></tr></table>
 
 !!end
@@ -17926,12 +17938,12 @@ Table attribute legitimate extension
 Table attribute safety
 !! wikitext
 {|
-!+ style="<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>"| status
+!+ style="<nowiki>border-width:expression(0+alert(document.cookie))</nowiki>"|status
 |}
 !! html
 <table>
 <tr>
-<th style="/* insecure input */"> status
+<th style="/* insecure input */">status
 </th></tr></table>
 
 !! end
@@ -18809,7 +18821,7 @@ Fuzz testing: Parser13
 !! test
 Fuzz testing: Parser14
 !! wikitext
-== onmouseover= ==
+==onmouseover===
 http://__TOC__
 !! html/php
 <h2><span class="mw-headline" id="onmouseover.3D">onmouseover=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: onmouseover=">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
@@ -18828,7 +18840,7 @@ http://</p><div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><
 </ul>
 </div>
 !! html/parsoid
-<h2 id="onmouseover="><span id="onmouseover.3D" typeof="mw:FallbackId"></span> onmouseover= </h2>
+<h2 id="onmouseover="><span id="onmouseover.3D" typeof="mw:FallbackId"></span>onmouseover=</h2>
 <p><a rel="mw:ExtLink" class="external free" href="http://__TOC__" data-parsoid='{"stx":"url"}'>http://__TOC__</a></p>
 !! end
 
@@ -18880,12 +18892,12 @@ Fuzz testing: Parser16
 Fuzz testing: Parser21
 !! wikitext
 {|
-! irc://{{ftp://a" onmouseover="alert('hello world');"
+!irc://{{ftp://a" onmouseover="alert('hello world');"
 |
 !! html
 <table>
 <tr>
-<th> <a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
+<th><a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
 </th>
 <td>
 </td>
@@ -20056,23 +20068,23 @@ xxx
 !! test
 Handling of &#x0A; in URLs
 !! wikitext
-*irc://&#x0A;a
+*irc://&#x0A;a
 !! html/php
-<ul><li><ul><li> <a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul></li></ul>
+<ul><li><a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul>
 
 !! html/parsoid
-<ul><li><ul><li> <a rel="mw:ExtLink" class="external free" href="irc://%0Aa" data-parsoid='{"stx":"url","a":{"href":"irc://%0Aa"},"sa":{"href":"irc://&amp;#x0A;a"}}'>irc://%0Aa</a></li></ul></li></ul>
+<ul><li><a rel="mw:ExtLink" class="external free" href="irc://%0Aa" data-parsoid='{"stx":"url","a":{"href":"irc://%0Aa"},"sa":{"href":"irc://&amp;#x0A;a"}}'>irc://%0Aa</a></li></ul>
 !! end
 
 !! test
 Handling of %0A in URLs
 !! wikitext
-*irc://%0Aa
+*irc://%0Aa
 !! html/php
-<ul><li><ul><li> <a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul></li></ul>
+<ul><li><a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul>
 
 !! html/parsoid
-<ul><li><ul><li> <a rel="mw:ExtLink" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul></li></ul>
+<ul><li><a rel="mw:ExtLink" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul>
 !! end
 
 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
@@ -20142,51 +20154,51 @@ Say the magic word
 !! options
 title=[[Parser test]]
 !! wikitext
-* {{PAGENAME}}
-* {{PAGENAMEE}}
-* {{FULLPAGENAME}}
-* {{FULLPAGENAMEE}}
-* {{BASEPAGENAME}}
-* {{BASEPAGENAMEE}}
-* {{SUBPAGENAME}}
-* {{SUBPAGENAMEE}}
-* {{ROOTPAGENAME}}
-* {{ROOTPAGENAMEE}}
-* {{TALKPAGENAME}}
-* {{TALKPAGENAMEE}}
-* {{SUBJECTPAGENAME}}
-* {{SUBJECTPAGENAMEE}}
-* {{NAMESPACEE}}
-* {{NAMESPACE}}
-* {{NAMESPACENUMBER}}
-* {{TALKSPACE}}
-* {{TALKSPACEE}}
-* {{SUBJECTSPACE}}
-* {{SUBJECTSPACEE}}
-* {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}}
-!! html
-<ul><li> Parser test</li>
-<li> Parser_test</li>
-<li> Parser test</li>
-<li> Parser_test</li>
-<li> Parser test</li>
-<li> Parser_test</li>
-<li> Parser test</li>
-<li> Parser_test</li>
-<li> Parser test</li>
-<li> Parser_test</li>
-<li> Talk:Parser test</li>
-<li> Talk:Parser_test</li>
-<li> Parser test</li>
-<li> Parser_test</li>
-<li> </li>
-<li> </li>
-<li> 0</li>
-<li> Talk</li>
-<li> Talk</li>
-<li> </li>
-<li> </li>
-<li> <a href="/index.php?title=Template:Dynamic&amp;action=edit&amp;redlink=1" class="new" title="Template:Dynamic (page does not exist)">Template:Dynamic</a></li></ul>
+*{{PAGENAME}}
+*{{PAGENAMEE}}
+*{{FULLPAGENAME}}
+*{{FULLPAGENAMEE}}
+*{{BASEPAGENAME}}
+*{{BASEPAGENAMEE}}
+*{{SUBPAGENAME}}
+*{{SUBPAGENAMEE}}
+*{{ROOTPAGENAME}}
+*{{ROOTPAGENAMEE}}
+*{{TALKPAGENAME}}
+*{{TALKPAGENAMEE}}
+*{{SUBJECTPAGENAME}}
+*{{SUBJECTPAGENAMEE}}
+*{{NAMESPACEE}}
+*{{NAMESPACE}}
+*{{NAMESPACENUMBER}}
+*{{TALKSPACE}}
+*{{TALKSPACEE}}
+*{{SUBJECTSPACE}}
+*{{SUBJECTSPACEE}}
+*{{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}}
+!! html
+<ul><li>Parser test</li>
+<li>Parser_test</li>
+<li>Parser test</li>
+<li>Parser_test</li>
+<li>Parser test</li>
+<li>Parser_test</li>
+<li>Parser test</li>
+<li>Parser_test</li>
+<li>Parser test</li>
+<li>Parser_test</li>
+<li>Talk:Parser test</li>
+<li>Talk:Parser_test</li>
+<li>Parser test</li>
+<li>Parser_test</li>
+<li></li>
+<li></li>
+<li>0</li>
+<li>Talk</li>
+<li>Talk</li>
+<li></li>
+<li></li>
+<li><a href="/index.php?title=Template:Dynamic&amp;action=edit&amp;redlink=1" class="new" title="Template:Dynamic (page does not exist)">Template:Dynamic</a></li></ul>
 
 !! end
 ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included.
@@ -20902,20 +20914,20 @@ Illegal character references (T106578)
 ; Surrogate: &#xD83D;&#xDCA9;
 ; This is an okay astral character: &#x1F4A9;
 !! html+tidy
-<dl><dt> Null</dt>
-<dd> &amp;#00;</dd>
-<dt> FF</dt>
-<dd> &amp;#xC;</dd>
-<dt> CR</dt>
-<dd> &amp;#xD;</dd>
-<dt> Control (low)</dt>
-<dd> &amp;#8;</dd>
-<dt> Control (high)</dt>
-<dd> &amp;#x7F; &amp;#x9F;</dd>
-<dt> Surrogate</dt>
-<dd> &amp;#xD83D;&amp;#xDCA9;</dd>
-<dt> This is an okay astral character</dt>
-<dd> &#x1f4a9;</dd></dl>
+<dl><dt>Null</dt>
+<dd>&amp;#00;</dd>
+<dt>FF</dt>
+<dd>&amp;#xC;</dd>
+<dt>CR</dt>
+<dd>&amp;#xD;</dd>
+<dt>Control (low)</dt>
+<dd>&amp;#8;</dd>
+<dt>Control (high)</dt>
+<dd>&amp;#x7F; &amp;#x9F;</dd>
+<dt>Surrogate</dt>
+<dd>&amp;#xD83D;&amp;#xDCA9;</dd>
+<dt>This is an okay astral character</dt>
+<dd>&#x1f4a9;</dd></dl>
 !! end
 
 !! test
@@ -21279,20 +21291,20 @@ parsoid=wt2html
 !! test
 Definition list code coverage
 !! wikitext
-; title   : def
-; title : def
+;title   : def
+;title : def
 ;title: def
 !! html/php
-<dl><dt> title  &#160;</dt>
-<dd> def</dd>
-<dt> title&#160;</dt>
-<dd> def</dd>
+<dl><dt>title  &#160;</dt>
+<dd>def</dd>
+<dt>title&#160;</dt>
+<dd>def</dd>
 <dt>title</dt>
-<dd> def</dd></dl>
+<dd>def</dd></dl>
 
 !! html/parsoid
-<dl><dt> title  <span typeof="mw:Placeholder"> </span></dt><dd> def</dd>
-<dt> title<span typeof="mw:Placeholder"> </span></dt><dd> def</dd>
+<dl><dt>title  <span typeof="mw:Placeholder"> </span></dt><dd> def</dd>
+<dt>title<span typeof="mw:Placeholder"> </span></dt><dd> def</dd>
 <dt>title</dt><dd> def</dd></dl>
 !! end
 
@@ -21537,7 +21549,7 @@ anchorencode encodes like the TOC generator: (T20431)
 !! config
 wgFragmentMode=[ 'html5', 'legacy' ]
 !! wikitext
-=== _ +:.3A%3A _ &&amp;]] x ===
+===_ +:.3A%3A _ &&amp;]] x===
 {{anchorencode: _ +:.3A%3A _ &&amp;]] x}}
 __NOEDITSECTION__
 !! html/php
@@ -21545,7 +21557,7 @@ __NOEDITSECTION__
 <p>+:.3A%3A_&amp;&amp;&#93;&#93;_x
 </p>
 !! html/parsoid
-<h3 id="+:.3A%3A_&amp;&amp;]]_x"><span id=".2B:.3A.253A_.26.26.5D.5D_x" typeof="mw:FallbackId"></span> _ +:.3A%3A _ &amp;<span typeof="mw:Entity" data-parsoid='{"src":"&amp;amp;","srcContent":"&amp;","dsr":[18,23,null,null]}'>&amp;</span>]] x </h3>
+<h3 id="+:.3A%3A_&amp;&amp;]]_x"><span id=".2B:.3A.253A_.26.26.5D.5D_x" typeof="mw:FallbackId"></span>_ +:.3A%3A _ &amp;<span typeof="mw:Entity" data-parsoid='{"src":"&amp;amp;","srcContent":"&amp;","dsr":[18,23,null,null]}'>&amp;</span>]] x</h3>
 <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"anchorencode: _ +:.3A%3A _ &amp;&amp;amp;]] x","function":"anchorencode"},"params":{},"i":0}}]}'>+:.3A%3A_&amp;&amp;<span typeof="mw:Entity">]</span><span typeof="mw:Entity">]</span>_x</p>
 <meta property="mw:PageProp/noeditsection"/>
 !! end
@@ -21555,7 +21567,7 @@ anchorencode encodes like the TOC generator: (T20431) (legacy)
 !! config
 wgFragmentMode=[ 'legacy' ]
 !! wikitext
-=== _ +:.3A%3A&&amp;]] ===
+===_ +:.3A%3A&&amp;]]===
 {{anchorencode: _ +:.3A%3A&&amp;]] }}
 __NOEDITSECTION__
 !! html/php
@@ -21839,12 +21851,12 @@ wgFragmentMode=[ 'html5', 'legacy' ]
 !! options
 language=sr variant=sr-ec
 !! wikitext
-== -{Naslov}- ==
+==-{Naslov}-==
 
 Note that even an unprotected headline ID is not affected by language
 conversion:
 
-== Latinski ==
+==Latinski==
 !! html/php
 <h2><span id="-.7BNaslov.7D-"></span><span class="mw-headline" id="-{Naslov}-">Naslov</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Уреди одељак „Naslov“">уреди</a><span class="mw-editsection-bracket">]</span></span></h2>
 <p>Ноте тхат евен ан унпротецтед хеадлине ИД ис нот аффецтед бy лангуаге
@@ -21853,7 +21865,7 @@ conversion:
 <h2><span class="mw-headline" id="Latinski">Латински</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Уреди одељак „Латински“">уреди</a><span class="mw-editsection-bracket">]</span></span></h2>
 
 !! html/parsoid
-<h2 id="-{Naslov}-"><span id="-.7BNaslov.7D-" typeof="mw:FallbackId"></span> <span typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"Naslov"}}'></span> </h2>
+<h2 id="-{Naslov}-"><span id="-.7BNaslov.7D-" typeof="mw:FallbackId"></span><span typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"Naslov"}}'></span></h2>
 
 <p>Note that even an unprotected headline ID is not affected by language
 conversion:</p>
@@ -22740,7 +22752,7 @@ parsoid=wt2html,wt2wt,html2html
 <table>
 
 <tr>
-<td> B
+<td>B
 </td></tr></table>
 
 !! html/parsoid
@@ -22871,20 +22883,20 @@ language=sr
 !! test
 T2529: Uncovered bullet
 !! wikitext
-* Foo {{bullet}}
+*Foo {{bullet}}
 !! html
-<ul><li> Foo </li>
-<li> Bar</li></ul>
+<ul><li>Foo</li>
+<li>Bar</li></ul>
 
 !! end
 
 !! test
 T2529: Uncovered bullet in a deeply nested list
 !! wikitext
-******* Foo {{bullet}}
+*******Foo {{bullet}}
 !! html
-<ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li> Foo </li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li>
-<li> Bar</li></ul>
+<ul><li><ul><li><ul><li><ul><li><ul><li><ul><li><ul><li>Foo</li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li>
+<li>Bar</li></ul>
 
 !! end
 
 </p>
 <table>
 <tr>
-<td> 1 </td>
-<td> 2
+<td>1</td>
+<td>2
 </td></tr>
 <tr>
-<td> 3 </td>
-<td> 4
+<td>3</td>
+<td>4
 </td></tr></table>
 <p>y
 </p>
 !! test
 T2529: Uncovered bullet in parser function result
 !! wikitext
-* Foo {{lc:{{bullet}} }}
+*Foo {{lc:{{bullet}} }}
 !! html
-<ul><li> Foo </li>
-<li> bar</li></ul>
+<ul><li>Foo</li>
+<li>bar</li></ul>
 
 !! end
 
@@ -23124,6 +23136,7 @@ Line two</blockquote>
 Line two</p></blockquote>
 !! end
 
+# Parsoid's output is broken on this because of Tidy-compatibility cruft
 !! test
 T8200: paragraphs inside blockquotes (extra line break on close)
 !! wikitext
@@ -23519,7 +23532,7 @@ comment
 Bad images - basic functionality
 !! wikitext
 [[File:Bad.jpg]]
-!! DISABLED/html/php
+!! html/php+disabled
 !! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"bad-image","message":"This image is blacklisted in this context."}]}'><a href="./File:Bad.jpg"><img resource="./File:Bad.jpg" height="220" width="220"/></a></span></p>
 !! end
@@ -23530,7 +23543,7 @@ Bad images - T18039: text after bad image disappears
 Foo bar
 [[File:Bad.jpg]]
 Bar foo
-!! DISABLED/html/php
+!! html/php+disabled
 <p>Foo bar
 </p><p>Bar foo
 </p>
@@ -23708,13 +23721,13 @@ showindicators
 <indicator name="02">[[Main Page]]</indicator>
 <indicator name="03">[[File:Foobar.jpg|25px|link=]]</indicator>
 <indicator name="04">[[File:Foobar.jpg|25px]]</indicator>
-<indicator name="05">* foo
-* bar</indicator>
+<indicator name="05">*foo
+*bar</indicator>
 <indicator name="06"><nowiki>foo</nowiki></indicator>
 <indicator name="07"> Preformatted</indicator>
 <indicator name="08"><div>Broken tag</indicator>
 <indicator name="09">{| class=wikitable
-| cell
+|cell
 |}</indicator>
 <indicator name="10">Two
 
@@ -23724,8 +23737,8 @@ paragraphs</indicator>
 02=<a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 03=<img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg" width="25" height="3" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/38px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg 2x" />
 04=<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg" width="25" height="3" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/38px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg 2x" /></a>
-05=<ul><li> foo</li>
-<li> bar</li></ul>
+05=<ul><li>foo</li>
+<li>bar</li></ul>
 
 06=foo
 07=<pre>Preformatted
@@ -23734,7 +23747,7 @@ paragraphs</indicator>
 
 09=<table class="wikitable">
 <tr>
-<td> cell
+<td>cell
 </td></tr></table>
 
 10=<p>Two
@@ -24001,7 +24014,7 @@ T28375: TOC with italics
 title=[[Main Page]]
 !! wikitext
 __TOC__
-== ''Lost'' episodes ==
+==''Lost'' episodes==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24013,7 +24026,7 @@ __TOC__
 
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="Lost_episodes" data-parsoid='{}'> <i>Lost</i> episodes </h2>
+<h2 id="Lost_episodes" data-parsoid='{}'><i>Lost</i> episodes</h2>
 !! end
 
 !! test
@@ -24022,7 +24035,7 @@ T28375: TOC with bold
 title=[[Main Page]]
 !! wikitext
 __TOC__
-== '''should be bold''' then normal text ==
+=='''should be bold''' then normal text==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24034,7 +24047,7 @@ __TOC__
 
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="should_be_bold_then_normal_text" data-parsoid='{}'> <b>should be bold</b> then normal text </h2>
+<h2 id="should_be_bold_then_normal_text" data-parsoid='{}'><b>should be bold</b> then normal text</h2>
 !! end
 
 !! test
@@ -24043,7 +24056,7 @@ T35845: Headings become cursive in TOC when they contain an image
 title=[[Main Page]]
 !! wikitext
 __TOC__
-== Image [[Image:foobar.jpg]] ==
+==Image [[Image:foobar.jpg]]==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24055,7 +24068,7 @@ __TOC__
 
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="Image" data-parsoid='{}'> Image <figure-inline class="mw-default-size" typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"Image:foobar.jpg"}}'/></a></figure-inline> </h2>
+<h2 id="Image" data-parsoid='{}'>Image <figure-inline class="mw-default-size" typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"Image:foobar.jpg"}}'/></a></figure-inline></h2>
 !! end
 
 !! test
@@ -24064,7 +24077,7 @@ T35845 (2): Headings become bold in TOC when they contain a blockquote
 title=[[Main Page]]
 !! wikitext
 __TOC__
-== <blockquote>Quote</blockquote> ==
+==<blockquote>Quote</blockquote>==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24084,7 +24097,7 @@ __TOC__
 <h2><span class="mw-headline" id="Quote"><blockquote><p>Quote</p></blockquote></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&amp;action=edit&amp;section=1" title="Edit section: Quote">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="Quote" data-parsoid='{}'> <blockquote>Quote</blockquote> </h2>
+<h2 id="Quote" data-parsoid='{}'><blockquote>Quote</blockquote></h2>
 !! end
 
 !! test
@@ -24095,7 +24108,7 @@ wgFragmentMode=[ 'html5', 'legacy' ]
 title=[[Main Page]]
 !! wikitext
 __TOC__
-== Proof: 2 < 3 ==
+==Proof: 2 < 3==
 <small>Hanc marginis exiguitas non caperet.</small>
 QED
 !! html/php
@@ -24111,7 +24124,7 @@ QED
 </p>
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="Proof:_2_&lt;_3" data-parsoid='{}'><span id="Proof:_2_.3C_3" typeof="mw:FallbackId"></span> Proof: 2 &lt; 3 </h2>
+<h2 id="Proof:_2_&lt;_3" data-parsoid='{}'><span id="Proof:_2_.3C_3" typeof="mw:FallbackId"></span>Proof: 2 &lt; 3</h2>
 <p><small>Hanc marginis exiguitas non caperet.</small>
 QED</p>
 !! end
@@ -24120,9 +24133,9 @@ QED</p>
 Multiple tags in TOC
 !! wikitext
 __TOC__
-== <i>Foo</i> <b>Bar</b> ==
+==<i>Foo</i> <b>Bar</b>==
 
-== <i>Foo</i> <blockquote>Bar</blockquote> ==
+==<i>Foo</i> <blockquote>Bar</blockquote>==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24146,9 +24159,9 @@ __TOC__
 <h2><span class="mw-headline" id="Foo_Bar_2"><i>Foo</i> <blockquote><p>Bar</p></blockquote></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="Foo_Bar" data-parsoid='{}'> <i data-parsoid='{"stx":"html"}'>Foo</i> <b data-parsoid='{"stx":"html"}'>Bar</b> </h2>
+<h2 id="Foo_Bar" data-parsoid='{}'><i data-parsoid='{"stx":"html"}'>Foo</i> <b data-parsoid='{"stx":"html"}'>Bar</b></h2>
 
-<h2 id="Foo_Bar_2" data-parsoid='{}'> <i data-parsoid='{"stx":"html"}'>Foo</i> <blockquote>Bar</blockquote> </h2>
+<h2 id="Foo_Bar_2" data-parsoid='{}'><i data-parsoid='{"stx":"html"}'>Foo</i> <blockquote>Bar</blockquote></h2>
 !! end
 
 # Don't expect Parsoid to roundtrip this until the php parser comes closer to
@@ -24159,9 +24172,9 @@ Tags with parameters in TOC
 parsoid=wt2html
 !! wikitext
 __TOC__
-== <sup class="in-h2">Hello</sup> ==
+==<sup class="in-h2">Hello</sup>==
 
-== <sup class="a > b">Evilbye</sup> ==
+==<sup class="a > b">Evilbye</sup>==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24175,24 +24188,24 @@ __TOC__
 
 !! html/parsoid
 <meta property="mw:PageProp/toc" />
-<h2 id="Hello"> <sup class="in-h2" data-parsoid='{"stx":"html"}'>Hello</sup> </h2>
+<h2 id="Hello"><sup class="in-h2" data-parsoid='{"stx":"html"}'>Hello</sup></h2>
 
-<h2 id='b">Evilbye'><span id="b.22.3EEvilbye" typeof="mw:FallbackId"></span> <sup class="a " data-parsoid='{"stx":"html"}'> b">Evilbye</sup> </h2>
+<h2 id='b">Evilbye'><span id="b.22.3EEvilbye" typeof="mw:FallbackId"></span><sup class="a " data-parsoid='{"stx":"html"}'> b">Evilbye</sup></h2>
 !! end
 
 !! test
 span tags with directionality in TOC
 !! wikitext
 __TOC__
-== <span dir="ltr">C++</span> ==
+==<span dir="ltr">C++</span>==
 
-== <span dir="rtl">זבנג!</span> ==
+==<span dir="rtl">זבנג!</span>==
 
-== <span style="font-style: italic">The attributes on these span tags must be deleted from the TOC</span> ==
+==<span style="font-style: italic">The attributes on these span tags must be deleted from the TOC</span>==
 
-== <span style="font-style: italic" dir="ltr">All attributes on these span tags must be deleted from the TOC</span> ==
+==<span style="font-style: italic" dir="ltr">All attributes on these span tags must be deleted from the TOC</span>==
 
-== <span dir="ltr" style="font-style: italic">Attributes after dir on these span tags must be deleted from the TOC</span> ==
+==<span dir="ltr" style="font-style: italic">Attributes after dir on these span tags must be deleted from the TOC</span>==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24212,18 +24225,18 @@ __TOC__
 
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="C++" data-parsoid='{}'><span id="C.2B.2B" typeof="mw:FallbackId"></span> <span dir="ltr">C++</span> </h2>
-<h2 id="זבנג!"><span id=".D7.96.D7.91.D7.A0.D7.92.21" typeof="mw:FallbackId"></span> <span dir="rtl">זבנג!</span> </h2>
-<h2 id="The_attributes_on_these_span_tags_must_be_deleted_from_the_TOC"> <span style="font-style: italic">The attributes on these span tags must be deleted from the TOC</span> </h2>
-<h2 id="All_attributes_on_these_span_tags_must_be_deleted_from_the_TOC"> <span style="font-style: italic" dir="ltr">All attributes on these span tags must be deleted from the TOC</span> </h2>
-<h2 id="Attributes_after_dir_on_these_span_tags_must_be_deleted_from_the_TOC"> <span dir="ltr" style="font-style: italic">Attributes after dir on these span tags must be deleted from the TOC</span> </h2>
+<h2 id="C++" data-parsoid='{}'><span id="C.2B.2B" typeof="mw:FallbackId"></span><span dir="ltr">C++</span></h2>
+<h2 id="זבנג!"><span id=".D7.96.D7.91.D7.A0.D7.92.21" typeof="mw:FallbackId"></span><span dir="rtl">זבנג!</span></h2>
+<h2 id="The_attributes_on_these_span_tags_must_be_deleted_from_the_TOC"><span style="font-style: italic">The attributes on these span tags must be deleted from the TOC</span></h2>
+<h2 id="All_attributes_on_these_span_tags_must_be_deleted_from_the_TOC"><span style="font-style: italic" dir="ltr">All attributes on these span tags must be deleted from the TOC</span></h2>
+<h2 id="Attributes_after_dir_on_these_span_tags_must_be_deleted_from_the_TOC"><span dir="ltr" style="font-style: italic">Attributes after dir on these span tags must be deleted from the TOC</span></h2>
 !! end
 
 !! test
 T74884: bdi element in ToC
 !! wikitext
 __TOC__
-== <bdi>test</bdi> ==
+==<bdi>test</bdi>==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24235,14 +24248,14 @@ __TOC__
 
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="test" data-parsoid='{}'> <bdi>test</bdi> </h2>
+<h2 id="test" data-parsoid='{}'><bdi>test</bdi></h2>
 !! end
 
 !! test
 T35715: s/strike element in ToC
 !! wikitext
 __TOC__
-== <s>test</s> test <strike>test</strike> ==
+==<s>test</s> test <strike>test</strike>==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24254,14 +24267,14 @@ __TOC__
 
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="test_test_test" data-parsoid='{}'> <s>test</s> test <strike>test</strike> </h2>
+<h2 id="test_test_test" data-parsoid='{}'><s>test</s> test <strike>test</strike></h2>
 !! end
 
 !! test
 Empty <p> tag in TOC, removed by Sanitizer (T92892)
 !! wikitext
 __TOC__
-== x ==
+==x==
 !! html/php
 <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
 <ul>
@@ -24273,7 +24286,7 @@ __TOC__
 
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
-<h2 id="x" data-parsoid='{}'> x </h2>
+<h2 id="x" data-parsoid='{}'>x</h2>
 !! end
 
 !! article
@@ -24425,17 +24438,17 @@ new support for bdi element (T33817)
 Ignore pipe between table row attributes
 !! wikitext
 {|
-| quux
+|quux
 |- id=foo | style='color: red'
-| bar
+|bar
 |}
 !! html
 <table>
 <tr>
-<td> quux
+<td>quux
 </td></tr>
 <tr id="foo" style="color: red">
-<td> bar
+<td>bar
 </td></tr></table>
 
 !! end
@@ -24541,11 +24554,11 @@ Disable TOC
 notoc
 !! wikitext
 Lead
-== Section 1 ==
-== Section 2 ==
-== Section 3 ==
-== Section 4 ==
-== Section 5 ==
+==Section 1==
+==Section 2==
+==Section 3==
+==Section 4==
+==Section 5==
 !! html
 <p>Lead
 </p>
@@ -25670,9 +25683,9 @@ parsoid=html2wt
 !! html/php
 <table>
 <tr>
-<td> &lt;foo
+<td>&lt;foo
 </td>
-<td> bar&gt;
+<td>bar&gt;
 </td></tr></table>
 
 !! end
@@ -26562,12 +26575,12 @@ parsoid=wt2html,html2html
 Accept empty td cell attribute
 !! wikitext
 {|
-| align="center" | foo ||  |
+| align="center" |foo||  |
 |}
 !! html
 <table>
 <tr>
-<td align="center"> foo </td>
+<td align="center">foo</td>
 <td>
 </td></tr></table>
 
@@ -26577,13 +26590,13 @@ Accept empty td cell attribute
 Non-empty attributes in th-cells
 !! wikitext
 {|
-! Foo !! style="color: red" | Bar
+!Foo!! style="color: red" |Bar
 |}
 !! html
 <table>
 <tr>
-<th> Foo </th>
-<th style="color: red"> Bar
+<th>Foo</th>
+<th style="color: red">Bar
 </th></tr></table>
 
 !!end
@@ -26592,13 +26605,13 @@ Non-empty attributes in th-cells
 Accept empty attributes in th-cells
 !! wikitext
 {|
-!| foo !!| bar
+!|foo!!|bar
 |}
 !! html
 <table>
 <tr>
-<th> foo </th>
-<th> bar
+<th>foo</th>
+<th>bar
 </th></tr></table>
 
 !!end
@@ -26607,17 +26620,17 @@ Accept empty attributes in th-cells
 Empty table rows go away
 !! wikitext
 {|
-| Hello
-| there
+|Hello
+|there
 |- class="foo"
 |-
 |}
 !! html
 <table>
 <tr>
-<td> Hello
+<td>Hello
 </td>
-<td> there
+<td>there
 </td></tr>
 
 </table>
@@ -26759,13 +26772,13 @@ Indent and comment before table row
 !! wikitext
 {|
  <!--hi-->|-
- | there
+ |there
 |}
 !! html/php
 <table>
 
 <tr>
-<td> there
+<td>there
 </td></tr></table>
 
 !! html/parsoid
@@ -27698,7 +27711,7 @@ parsoid=html2wt
 !! html/parsoid
 <ul><li>a<br>b</li><li>c</li></ul>
 !! wikitext
-* a<br>b
+* a<br />b
 * c
 !! end
 
@@ -28398,9 +28411,9 @@ parsoid=html2wt,wt2wt
 |<nowiki>- </nowiki>
 |-
 |<small>-</small>
-|<br>
+|<br />
 -
-|<br>
+|<br />
 -
 |}
 !! html/php+tidy
@@ -28853,7 +28866,7 @@ parsoid={
 !! html/parsoid
 <h2>foo<br/>bar</h2>
 !! wikitext
-== foo<br> bar ==
+== foo<br /> bar ==
 !! end
 
 !! test
@@ -29563,15 +29576,15 @@ parsoid={
 !! test
 Empty LI (T49673)
 !! wikitext
-* a
+*a
 * 
 *
-* b
+*b
 !! html+tidy
-<ul><li> a</li>
-<li class="mw-empty-elt"> </li>
+<ul><li>a</li>
+<li class="mw-empty-elt"></li>
 <li class="mw-empty-elt"></li>
-<li> b</li></ul>
+<li>b</li></ul>
 !! end
 
 !! test
@@ -29696,14 +29709,14 @@ Decoding of HTML entities in headings and links for IDs and link fragments (T103
 !! config
 wgFragmentMode=[ 'html5', 'legacy' ]
 !! wikitext
-== A&B&amp;C&amp;amp;D&amp;amp;amp;E ==
+==A&B&amp;C&amp;amp;D&amp;amp;amp;E==
 [[#A&B&amp;C&amp;amp;D&amp;amp;amp;E]]
 !! html/php
 <h2><span id="A.26B.26C.26amp.3BD.26amp.3Bamp.3BE"></span><span class="mw-headline" id="A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E">A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <p><a href="#A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E">#A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E</a>
 </p>
 !! html/parsoid
-<h2 id="A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E"><span id="A.26B.26C.26amp.3BD.26amp.3Bamp.3BE" typeof="mw:FallbackId" data-parsoid="{}"></span> A&amp;B<span typeof="mw:Entity" data-parsoid='{"src":"&amp;amp;","srcContent":"&amp;"}'>&amp;</span>C<span typeof="mw:Entity" data-parsoid='{"src":"&amp;amp;","srcContent":"&amp;"}'>&amp;</span>amp;D<span typeof="mw:Entity" data-parsoid='{"src":"&amp;amp;","srcContent":"&amp;"}'>&amp;</span>amp;amp;E </h2>
+<h2 id="A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E"><span id="A.26B.26C.26amp.3BD.26amp.3Bamp.3BE" typeof="mw:FallbackId" data-parsoid="{}"></span>A&amp;B<span typeof="mw:Entity" data-parsoid='{"src":"&amp;amp;","srcContent":"&amp;"}'>&amp;</span>C<span typeof="mw:Entity" data-parsoid='{"src":"&amp;amp;","srcContent":"&amp;"}'>&amp;</span>amp;D<span typeof="mw:Entity" data-parsoid='{"src":"&amp;amp;","srcContent":"&amp;"}'>&amp;</span>amp;amp;E</h2>
 <p><a rel="mw:WikiLink" href="./Main_Page#A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E" data-parsoid='{"stx":"simple","a":{"href":"./Main_Page#A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E"},"sa":{"href":"#A&amp;B&amp;amp;C&amp;amp;amp;D&amp;amp;amp;amp;E"}}'>#A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E</a></p>
 !! end
 
@@ -29712,7 +29725,7 @@ Decoding of HTML entities in headings and links for IDs and link fragments (T103
 !! config
 wgFragmentMode=[ 'legacy' ]
 !! wikitext
-== A&B&amp;C&amp;amp;D&amp;amp;amp;E ==
+==A&B&amp;C&amp;amp;D&amp;amp;amp;E==
 [[#A&B&amp;C&amp;amp;D&amp;amp;amp;E]]
 !! html/php
 <h2><span class="mw-headline" id="A.26B.26C.26amp.3BD.26amp.3Bamp.3BE">A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: A&amp;B&amp;C&amp;amp;D&amp;amp;amp;E">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
@@ -29765,17 +29778,17 @@ HTML5 ids: fallback to legacy
 !! config
 wgFragmentMode=[ 'html5', 'legacy' ]
 !! wikitext
-== Foo bar ==
+==Foo bar==
 
-== foo Bar ==
+==foo Bar==
 
-== Тест ==
+==Тест==
 
-== Тест ==
+==Тест==
 
-== тест ==
+==тест==
 
-== Hey < # " > % : ' ==
+==Hey < # " > % : '==
 [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']]
 
 {{anchorencode:💩}} <span id="{{anchorencode:💩}}"></span>
@@ -29806,20 +29819,20 @@ wgFragmentMode=[ 'html5', 'legacy' ]
 </p><p><a href="#啤酒">#啤酒</a> <a href="#啤酒">#啤酒</a>
 </p>
 !! html/parsoid
-<h2 id="Foo_bar"> Foo bar </h2>
+<h2 id="Foo_bar">Foo bar</h2>
 
-<h2 id="foo_Bar_2"> foo Bar </h2>
+<h2 id="foo_Bar_2">foo Bar</h2>
 
-<h2 id="Тест"><span id=".D0.A2.D0.B5.D1.81.D1.82" typeof="mw:FallbackId"></span> Тест </h2>
+<h2 id="Тест"><span id=".D0.A2.D0.B5.D1.81.D1.82" typeof="mw:FallbackId"></span>Тест</h2>
 
-<h2 id="Тест_2"><span id=".D0.A2.D0.B5.D1.81.D1.82_2" typeof="mw:FallbackId"></span> Тест </h2>
+<h2 id="Тест_2"><span id=".D0.A2.D0.B5.D1.81.D1.82_2" typeof="mw:FallbackId"></span>Тест</h2>
 
-<h2 id="тест"><span id=".D1.82.D0.B5.D1.81.D1.82" typeof="mw:FallbackId"></span> тест </h2>
+<h2 id="тест"><span id=".D1.82.D0.B5.D1.81.D1.82" typeof="mw:FallbackId"></span>тест</h2>
 
-<h2 id="Hey_&lt;_#_&quot;_>_%_:_'"><span id="Hey_.3C_.23_.22_.3E_.25_:_.27" typeof="mw:FallbackId"></span> Hey &lt; # " > %<span typeof="mw:DisplaySpace mw:Placeholder" data-parsoid='{"src":" ","isDisplayHack":true}'> </span>: ' </h2>
+<h2 id="Hey_&lt;_#_&quot;_>_%_:_'"><span id="Hey_.3C_.23_.22_.3E_.25_:_.27" typeof="mw:FallbackId"></span>Hey &lt; # " > %<span typeof="mw:DisplaySpace mw:Placeholder" data-parsoid='{"src":" ","isDisplayHack":true}'> </span>: '</h2>
 <p><a rel="mw:WikiLink" href="./Main_Page#Foo_bar">#Foo bar</a> <a rel="mw:WikiLink" href="./Main_Page#foo_Bar">#foo Bar</a> <a rel="mw:WikiLink" href="./Main_Page#Тест">#Тест</a> <a rel="mw:WikiLink" href="./Main_Page#тест">#тест</a> <a rel="mw:WikiLink" href="./Main_Page#Hey_&lt;_#_&quot;_>_%_:_'" data-parsoid='{"stx":"simple","a":{"href":"./Main_Page#Hey_&lt;_#_\"_>_%_:_&#39;"},"sa":{"href":"#Hey &lt; # \" > % : &#39;"}}'>#Hey &lt; # " > % : '</a></p>
 
-<p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"anchorencode:💩","function":"anchorencode"},"params":{},"i":0}}]}'>💩</span> <span id="💩" about="#mwt3" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"id"},{"html":"&lt;span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[190,209,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"anchorencode:💩\",\"function\":\"anchorencode\"},\"params\":{},\"i\":0}}]}&#39;>💩&lt;/span>"}]]}'></span></p>
+<p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"anchorencode:💩","function":"anchorencode"},"params":{},"i":0}}]}'>💩</span> <span id="💩" about="#mwt3" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"id"},{"html":"&lt;span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[178,197,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"anchorencode:💩\",\"function\":\"anchorencode\"},\"params\":{},\"i\":0}}]}&#39;>💩&lt;/span>"}]]}'></span></p>
 
 <!-- These two links should produce identical HTML -->
 <p><a rel="mw:WikiLink" href="./Main_Page#啤酒">#啤酒</a> <a rel="mw:WikiLink" href="./Main_Page#啤酒" data-parsoid='{"stx":"simple","a":{"href":"./Main_Page#啤酒"},"sa":{"href":"#%E5%95%A4%E9%85%92"}}'>#啤酒</a></p>
@@ -29831,17 +29844,17 @@ HTML5 ids: legacy with a fallback to modern
 !! config
 wgFragmentMode=[ 'legacy', 'html5' ]
 !! wikitext
-== Foo bar ==
+==Foo bar==
 
-== foo Bar ==
+==foo Bar==
 
-== Тест ==
+==Тест==
 
-== Тест ==
+==Тест==
 
-== тест ==
+==тест==
 
-== Hey < # " > % : ' ==
+==Hey < # " > % : '==
 [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']]
 
 {{anchorencode:💩}} <span id="{{anchorencode:💩}}"></span>
@@ -29879,17 +29892,17 @@ HTML5 ids: no legacy
 !! config
 wgFragmentMode=[ 'html5' ]
 !! wikitext
-== Foo bar ==
+==Foo bar==
 
-== foo Bar ==
+==foo Bar==
 
-== Тест ==
+==Тест==
 
-== Тест ==
+==Тест==
 
-== тест ==
+==тест==
 
-== Hey < # " > % : ' ==
+==Hey < # " > % : '==
 [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']]
 
 {{anchorencode:💩}} <span id="{{anchorencode:💩}}"></span>
@@ -29926,13 +29939,16 @@ T90902: Normalize weird characters in section IDs
 !! config
 wgFragmentMode=[ 'html5', 'legacy' ]
 !! wikitext
-== Foo&nbsp;bar ==
+==Foo&nbsp;bar==
 [[#Foo&nbsp;bar]]
 
 !! html/php
 <h2><span class="mw-headline" id="Foo_bar">Foo&#160;bar</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <p><a href="#Foo_bar">#Foo&#160;bar</a>
 </p>
+!! html/parsoid
+<h2 id="Foo_bar"> Foo<span typeof="mw:Entity" data-parsoid='{"src":"&amp;nbsp;","srcContent":" "}'> </span>bar </h2>
+<p><a rel="mw:WikiLink" href="./Main_Page#Foo_bar" data-parsoid='{"stx":"simple","a":{"href":"./Main_Page#Foo_bar"},"sa":{"href":"#Foo&amp;nbsp;bar"}}'>#Foo bar</a></p>
 !! end
 
 !! test
@@ -29988,40 +30004,40 @@ parsoid={
   "wrapSections": true
 }
 !! wikitext
-= 1 =
+=1=
 a
 
-= 2 =
+=2=
 b
 
-== 2.1 ==
+==2.1==
 c
 
-== 2.2 ==
+==2.2==
 d
 
-=== 2.2.1 ===
+===2.2.1===
 e
 
-= 3 =
+=3=
 f
 !! html/parsoid
-<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h1 id="1"> 1 </h1>
+<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h1 id="1">1</h1>
 <p>a</p>
 
-</section><section data-mw-section-id="2"><h1 id="2"> 2 </h1>
+</section><section data-mw-section-id="2"><h1 id="2">2</h1>
 <p>b</p>
 
-<section data-mw-section-id="3"><h2 id="2.1"> 2.1 </h2>
+<section data-mw-section-id="3"><h2 id="2.1">2.1</h2>
 <p>c</p>
 
-</section><section data-mw-section-id="4"><h2 id="2.2"> 2.2 </h2>
+</section><section data-mw-section-id="4"><h2 id="2.2">2.2</h2>
 <p>d</p>
 
-<section data-mw-section-id="5"><h3 id="2.2.1"> 2.2.1 </h3>
+<section data-mw-section-id="5"><h3 id="2.2.1">2.2.1</h3>
 <p>e</p>
 
-</section></section></section><section data-mw-section-id="6"><h1 id="3"> 3 </h1>
+</section></section></section><section data-mw-section-id="6"><h1 id="3">3</h1>
 <p>f</p>
 
 </section>
@@ -30040,13 +30056,13 @@ Para 2 with a <div>nested in it</div>
 
 Para 3.
 
-= 1 =
+=1=
 a
 
-= 2 =
+=2=
 b
 
-== 2.1 ==
+==2.1==
 c
 !! html/parsoid
 <section data-mw-section-id="0"><p>Para 1.</p>
 
 <p>Para 3.</p>
 
-</section><section data-mw-section-id="1"><h1 id="1"> 1 </h1>
+</section><section data-mw-section-id="1"><h1 id="1">1</h1>
 <p>a</p>
 
-</section><section data-mw-section-id="2"><h1 id="2"> 2 </h1>
+</section><section data-mw-section-id="2"><h1 id="2">2</h1>
 <p>b</p>
 
-<section data-mw-section-id="3"><h2 id="2.1"> 2.1 </h2>
+<section data-mw-section-id="3"><h2 id="2.1">2.1</h2>
 <p>c</p>
 
 </section></section>
@@ -30074,29 +30090,29 @@ parsoid={
   "wrapSections": true
 }
 !! wikitext
-= 1 =
+=1=
 a
 
 {{echo|1=
-== 1.1 ==
+==1.1==
 b
 }}
 
-== 1.2 ==
+==1.2==
 c
 
-= 2 =
+=2=
 d
 !! html/parsoid
-<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h1 id="1"> 1 </h1>
+<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h1 id="1">1</h1>
 <p>a</p>
 
-<section data-mw-section-id="-1"><h2 about="#mwt1" typeof="mw:Transclusion" id="1.1" data-parsoid='{"dsr":[9,33,null,null],"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"== 1.1 ==\nb"}},"i":0}}]}'> 1.1 </h2><span about="#mwt1">
+<section data-mw-section-id="-1"><h2 about="#mwt1" typeof="mw:Transclusion" id="1.1" data-parsoid='{"dsr":[9,33,null,null],"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"==1.1==\nb"}},"i":0}}]}'>1.1</h2><span about="#mwt1">
 </span><p about="#mwt1">b</p>
-</section><section data-mw-section-id="3"><h2 id="1.2"> 1.2 </h2>
+</section><section data-mw-section-id="3"><h2 id="1.2">1.2</h2>
 <p>c</p>
 
-</section></section><section data-mw-section-id="4"><h1 id="2"> 2 </h1>
+</section></section><section data-mw-section-id="4"><h1 id="2">2</h1>
 <p>d</p></section>
 !! end
 
@@ -30110,26 +30126,26 @@ parsoid={
   "modes": ["wt2html", "wt2wt"]
 }
 !! wikitext
-= 1 =
+=1=
 a
 
 {{echo|1=
-== 1.1 ==
+==1.1==
 b
-=== 1.1.1 ===
+===1.1.1===
 d
 }}
-= 2 =
+=2=
 e
 !! html/parsoid
-<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h1 id="1"> 1 </h1>
+<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h1 id="1">1</h1>
 <p>a</p>
 
-<section data-mw-section-id="-1"><h2 about="#mwt1" typeof="mw:Transclusion" id="1.1" data-parsoid='{"dsr":[9,50,null,null],"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"== 1.1 ==\nb\n=== 1.1.1 ===\nd"}},"i":0}},"\n"]}'> 1.1 </h2><span about="#mwt1">
+<section data-mw-section-id="-1"><h2 about="#mwt1" typeof="mw:Transclusion" id="1.1" data-parsoid='{"dsr":[9,50,null,null],"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"==1.1==\nb\n===1.1.1===\nd"}},"i":0}},"\n"]}'>1.1</h2><span about="#mwt1">
 </span><p about="#mwt1">b</p><span about="#mwt1">
-</span><section data-mw-section-id="-1" about="#mwt1"><h3 about="#mwt1" id="1.1.1"> 1.1.1 </h3><span about="#mwt1">
+</span><section data-mw-section-id="-1" about="#mwt1"><h3 about="#mwt1" id="1.1.1">1.1.1</h3><span about="#mwt1">
 </span><p about="#mwt1">d</p><span about="#mwt1">
-</span></section></section></section><section data-mw-section-id="4" data-parsoid="{}"><h1 id="2"> 2 </h1>
+</span></section></section></section><section data-mw-section-id="4" data-parsoid="{}"><h1 id="2">2</h1>
 <p>e</p></section>
 !! end
 
@@ -30143,32 +30159,32 @@ parsoid={
   "modes": ["wt2html", "wt2wt"]
 }
 !! wikitext
-= 1 =
+=1=
 a
 
 {{echo|1=
 x
-== 1.1 ==
+==1.1==
 b
 ==1.2==
 c
 ===1.2.1===
 d
 }}
-= 2 =
+=2=
 e
 !! html/parsoid
 <section data-mw-section-id="0"></section><section data-mw-section-id="1" data-parsoid="{}"><h1 id="1"> 1 </h1>
 <p>a</p>
 
-<p about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"dsr":[9,60,0,0],"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"x\n== 1.1 ==\nb\n==1.2==\nc\n===1.2.1===\nd"}},"i":0}},"\n"]}'>x</p><span about="#mwt1">
-</span><section data-mw-section-id="-1" about="#mwt1"><h2 about="#mwt1" id="1.1"> 1.1 </h2><span about="#mwt1">
+<p about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"dsr":[9,60,0,0],"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"x\n==1.1==\nb\n==1.2==\nc\n===1.2.1===\nd"}},"i":0}},"\n"]}'>x</p><span about="#mwt1">
+</span><section data-mw-section-id="-1" about="#mwt1"><h2 about="#mwt1" id="1.1">1.1</h2><span about="#mwt1">
 </span><p about="#mwt1">b</p><span about="#mwt1">
 </span></section><section data-mw-section-id="-1" about="#mwt1"><h2 about="#mwt1" id="1.2">1.2</h2><span about="#mwt1">
 </span><p about="#mwt1">c</p><span about="#mwt1">
 </span><section data-mw-section-id="-1" about="#mwt1"><h3 about="#mwt1" id="1.2.1">1.2.1</h3><span about="#mwt1">
 </span><p about="#mwt1">d</p><span about="#mwt1">
-</span></section></section></section><section data-mw-section-id="5"><h1 id="2"> 2 </h1>
+</span></section></section></section><section data-mw-section-id="5"><h1 id="2">2</h1>
 <p>e</p></section>
 !! end
 
@@ -30187,7 +30203,7 @@ parsoid={
 a
 
 {{echo|
-= 1 =
+=1=
 b
 }}
 
 <section data-mw-section-id="-1"></section><section data-mw-section-id="-2"><div data-parsoid='{"stx":"html"}'>
 <p>a</p>
 
-<span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"\n= 1 =\nb\n"}},"i":0}},"\n\nc\n"]}'>
-</span><section data-mw-section-id="-1" about="#mwt1"><h1 about="#mwt1" id="1"> 1 </h1><span about="#mwt1">
+<span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"\n=1=\nb\n"}},"i":0}},"\n\nc\n"]}'>
+</span><section data-mw-section-id="-1" about="#mwt1"><h1 about="#mwt1" id="1">1</h1><span about="#mwt1">
 </span><p about="#mwt1">b
 </p><span about="#mwt1">
 
@@ -30217,32 +30233,32 @@ parsoid={
   "wrapSections": true
 }
 !! wikitext
-= 1 =
+=1=
 a
 
 {{echo|1=
-= 2 =
+=2=
 b
-== 2.1 ==
+==2.1==
 c
 }}
 
 d
 
-= 3 =
+=3=
 e
 !! html/parsoid
-<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h1 id="1"> 1 </h1>
+<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h1 id="1">1</h1>
 <p>a</p>
 
-</section><section data-mw-section-id="-1"><h1 about="#mwt1" typeof="mw:Transclusion" id="2" data-parsoid='{"dsr":[9,45,null,null],"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"= 2 =\nb\n== 2.1 ==\nc"}},"i":0}},"\n\nd\n\n"]}'> 2 </h1><span about="#mwt1">
+</section><section data-mw-section-id="-1"><h1 about="#mwt1" typeof="mw:Transclusion" id="2" data-parsoid='{"dsr":[9,45,null,null],"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"=2=\nb\n==2.1==\nc"}},"i":0}},"\n\nd\n\n"]}'>2</h1><span about="#mwt1">
 </span><p about="#mwt1">b</p><span about="#mwt1">
-</span><section data-mw-section-id="-1" about="#mwt1"><h2 about="#mwt1" id="2.1"> 2.1 </h2><span about="#mwt1">
+</span><section data-mw-section-id="-1" about="#mwt1"><h2 about="#mwt1" id="2.1">2.1</h2><span about="#mwt1">
 </span><p about="#mwt1">c</p><span about="#mwt1">
 
 </span><p about="#mwt1">d</p><span about="#mwt1">
 
-</span></section></section><section data-mw-section-id="4"><h1 id="3"> 3 </h1>
+</span></section></section><section data-mw-section-id="4"><h1 id="3">3</h1>
 <p>e</p></section>
 !! end
 
@@ -30260,31 +30276,31 @@ parsoid={
   "modes": ["wt2html", "wt2wt"]
 }
 !! wikitext
-= 1 =
+=1=
 a
 
 {{echo|1=
-== 1.2 ==
+==1.2==
 b
-= 2 =
+=2=
 c
 }}
 
 d
 
-= 3 =
+=3=
 e
 !! html/parsoid
-<section data-mw-section-id="0"></section><section data-mw-section-id="1" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["= 1 =\na\n\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"== 1.2 ==\nb\n= 2 =\nc"}},"i":0}},"\n\nd\n\n"]}'><h1 id="1"> 1 </h1>
+<section data-mw-section-id="0"></section><section data-mw-section-id="1" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["=1=\na\n\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"==1.2==\nb\n=2=\nc"}},"i":0}},"\n\nd\n\n"]}'><h1 id="1">1</h1>
 <p>a</p>
 
-<section data-mw-section-id="-1"><h2 about="#mwt1" typeof="mw:Transclusion" id="1.2" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"== 1.2 ==\nb\n= 2 =\nc"}},"i":0}}]}'> 1.2 </h2><span about="#mwt1">
+<section data-mw-section-id="-1"><h2 about="#mwt1" typeof="mw:Transclusion" id="1.2" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"==1.2==\nb\n=2=\nc"}},"i":0}}]}'>1.2</h2><span about="#mwt1">
 </span><p about="#mwt1">b</p><span about="#mwt1">
-</span></section></section><section data-mw-section-id="-1" about="#mwt1"><h1 about="#mwt1" id="2"> 2 </h1><span about="#mwt1">
+</span></section></section><section data-mw-section-id="-1" about="#mwt1"><h1 about="#mwt1" id="2">2</h1><span about="#mwt1">
 </span><p about="#mwt1">c</p>
 
 <p>d</p>
-</section><section data-mw-section-id="4" data-parsoid="{}"><h1 id="3"> 3 </h1>
+</section><section data-mw-section-id="4" data-parsoid="{}"><h1 id="3">3</h1>
 <p>e</p></section>
 !! end
 
@@ -30298,39 +30314,39 @@ parsoid={
 foo
 
 <div style="border:1px solid red;">
-= 1 =
+=1=
 a
 
-== 1.1 ==
+==1.1==
 b
 
-= 2 =
+=2=
 c
 </div>
 
-= 3 =
+=3=
 d
 
-== 3.1 ==
+==3.1==
 e
 !! html/parsoid
 <section data-mw-section-id="-1"><p>foo</p>
 
 </section><section data-mw-section-id="-2"><div style="border:1px solid red;">
-<section data-mw-section-id="1"><h1 id="1"> 1 </h1>
+<section data-mw-section-id="1"><h1 id="1">1</h1>
 <p>a</p>
 
-<section data-mw-section-id="2"><h2 id="1.1"> 1.1 </h2>
+<section data-mw-section-id="2"><h2 id="1.1">1.1</h2>
 <p>b</p>
 
-</section></section><section data-mw-section-id="-1"><h1 id="2"> 2 </h1>
+</section></section><section data-mw-section-id="-1"><h1 id="2">2</h1>
 <p>c</p>
 </section></div>
 
-</section><section data-mw-section-id="4"><h1 id="3"> 3 </h1>
+</section><section data-mw-section-id="4"><h1 id="3">3</h1>
 <p>d</p>
 
-<section data-mw-section-id="5"><h2 id="3.1"> 3.1 </h2>
+<section data-mw-section-id="5"><h2 id="3.1">3.1</h2>
 <p>e</p>
 </section></section>
 !! end
@@ -30344,44 +30360,44 @@ parsoid={
 !! wikitext
 foo
 
-= 1 =
+=1=
 a
 <div style="border:1px solid red;">
 b
 
-== 1.1 ==
+==1.1==
 c
 
-= 2 =
+=2=
 d
 </div>
 e
 
-= 3 =
+=3=
 f
 
-== 3.1 ==
+==3.1==
 g
 !! html/parsoid
 <section data-mw-section-id="0"><p>foo</p>
 
-</section><section data-mw-section-id="-1"><h1 id="1"> 1 </h1>
+</section><section data-mw-section-id="-1"><h1 id="1">1</h1>
 <p>a</p>
 </section><section data-mw-section-id="-2"><div style="border:1px solid red;">
 <p>b</p>
 
-<section data-mw-section-id="2"><h2 id="1.1"> 1.1 </h2>
+<section data-mw-section-id="2"><h2 id="1.1">1.1</h2>
 <p>c</p>
 
-</section><section data-mw-section-id="-1"><h1 id="2"> 2 </h1>
+</section><section data-mw-section-id="-1"><h1 id="2">2</h1>
 <p>d</p>
 </section></div>
 <p>e</p>
 
-</section><section data-mw-section-id="4"><h1 id="3"> 3 </h1>
+</section><section data-mw-section-id="4"><h1 id="3">3</h1>
 <p>f</p>
 
-<section data-mw-section-id="5"><h2 id="3.1"> 3.1 </h2>
+<section data-mw-section-id="5"><h2 id="3.1">3.1</h2>
 <p>g</p>
 </section></section>
 !! end
@@ -30397,21 +30413,21 @@ foo
 
 <h1>a</h1>
 
-= b =
+=b=
 
 <h1>c</h1>
 
-= d =
+=d=
 !! html/parsoid
 <section data-mw-section-id="0"><p>foo</p>
 
 <h1 id="a" data-parsoid='{"stx":"html"}'>a</h1>
 
-</section><section data-mw-section-id="1"><h1 id="b"> b </h1>
+</section><section data-mw-section-id="1"><h1 id="b">b</h1>
 
 <h1 id="c" data-parsoid='{"stx":"html"}'>c</h1>
 
-</section><section data-mw-section-id="2"><h1 id="d"> d </h1></section>
+</section><section data-mw-section-id="2"><h1 id="d">d</h1></section>
 !! end
 
 !! test
@@ -30423,18 +30439,18 @@ parsoid={
 !! wikitext
 
 <!-- this is a comment, presumably significant to editors -->
-= 1 =
+=1=
 a
 
-= 2 =
+=2=
 b
 !! html/parsoid
 <section data-mw-section-id="0" data-parsoid="{}">
 <!-- this is a comment, presumably significant to editors -->
-</section><section data-mw-section-id="1"><h1 id="1"> 1 </h1>
+</section><section data-mw-section-id="1"><h1 id="1">1</h1>
 <p>a</p>
 
-</section><section data-mw-section-id="2"><h1 id="2"> 2 </h1>
+</section><section data-mw-section-id="2"><h1 id="2">2</h1>
 <p>b</p></section>
 !! end
 
@@ -30447,15 +30463,103 @@ parsoid={
 !! wikitext
 foo
 {{echo|<div>
-== a ==
-== b ==
+==a==
+==b==
 </div>
 }}
 !! html/parsoid
 <section data-mw-section-id="-1"><p>foo</p>
-</section><section data-mw-section-id="-2"><div about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;div>\n== a ==\n== b ==\n&lt;/div>\n"}},"i":0}}]}'>
-<section data-mw-section-id="-1"><h2 id="a"> a </h2>
-</section><section data-mw-section-id="-1"><h2 id="b"> b </h2>
+</section><section data-mw-section-id="-2"><div about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&lt;div>\n==a==\n==b==\n&lt;/div>\n"}},"i":0}}]}'>
+<section data-mw-section-id="-1"><h2 id="a">a</h2>
+</section><section data-mw-section-id="-1"><h2 id="b">b</h2>
 </section></div><span about="#mwt1">
 </span></section>
 !! end
+
+##########################################################################
+Tests demonstrating white-space insensitivity in input wikitext
+for wikitext headings, wikitext list items, and wikitext table captions,
+headings, and cells. HTML versions of the same should preserve whitespace.
+##########################################################################
+!! test
+Trim whitespace in wikitext headings, list items, table captions, headings, and cells
+!! wikitext
+__NOTOC__
+==    <!--c1-->   <!--c2--> Heading    <!--c3--> <!--c4-->  ==
+*     <!--c1-->   <!--c2-->  List item <!--c3--> <!--c4-->
+; <!--term to define--> term : <!--term's definition--> definition
+{|
+|+ <!--c1--> <!--c2--> Table Caption <!--c3--> <!--c4-->
+|-
+!  <!--c1--> <!--c2--> Table Heading 1 <!--c3--> <!--c4--> !!   Table Heading 2 <!--c5-->
+|-
+| <!--c1--> <!--c2--> Table Cell 1 <!--c3--> <!--c4--> ||   Table Cell 2 <!--c5-->
+|-
+| class="foo" || <!--c1--> <!--c2--> Table Cell 3 <!--c3--> <!--c4-->
+|-
+| <!--c1--> testing [[one|two]] <!--c2--> | <!--c3--> some content
+|}
+: {|
+  |  <!--c1--> <!--c2--> Table Cell 1 <!--c3--> <!--c4--> ||   Table Cell 2 <!--c5-->
+  |} foo   <!--c1-->
+!! html/php+tidy
+<h2><span class="mw-headline" id="Heading">Heading</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Heading">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<ul><li>List item</li></ul>
+<dl><dt>term&#160;</dt>
+<dd>definition</dd></dl>
+<table>
+<caption>Table Caption
+</caption>
+<tbody><tr>
+<th>Table Heading 1</th>
+<th>Table Heading 2
+</th></tr>
+<tr>
+<td>Table Cell 1</td>
+<td>Table Cell 2
+</td></tr>
+<tr>
+<td>class="foo"</td>
+<td>Table Cell 3
+</td></tr>
+<tr>
+<td>testing <a href="/index.php?title=One&amp;action=edit&amp;redlink=1" class="new" title="One (page does not exist)">two</a>  |  some content
+</td></tr></tbody></table>
+<dl><dd><table>
+<tbody><tr>
+<td>Table Cell 1</td>
+<td>Table Cell 2
+</td></tr></tbody></table> foo</dd></dl>
+!! end
+
+# Looks like <caption> is not accepted in HTML
+!! test
+Do not trim whitespace in HTML headings, list items, table captions, headings, and cells
+!! wikitext
+__NOTOC__
+<h2>    <!--c1-->   <!--c2--> Heading    <!--c3--> <!--c4-->  <h2>
+<ul><li>     <!--c1-->   <!--c2-->  List item <!--c3--> <!--c4-->  </li></ul>
+<table>
+<tr><th> <!--c1--> <!--c2--> Table Heading <!--c3--> <!--c4--> <th></tr>
+<tr><td> <!--c1--> <!--c2--> Table Cell <!--c3--> <!--c4--> <th></tr>
+</table>
+!! html/php+tidy
+<h2>        Heading       </h2><h2>
+<ul><li>          List item    </li></ul>
+<table>
+<tbody><tr><th>   Table Heading   </th><th></th></tr>
+<tr><td>   Table Cell   </td><th></th></tr>
+</tbody></table>
+</h2>
+!! end
+
+!! test
+Do not trim whitespace in links and quotes
+!! wikitext
+foo ''  <!--c1--> italic <!--c2-->   '' and '''  <!--c3-->  bold  <!--c4-->  '''
+[[Foo|  some text  ]]
+!! html/php+tidy
+<p>foo <i>   italic    </i> and <b>    bold    </b>
+<a href="/wiki/Foo" title="Foo">  some text  </a>
+</p>
+!! end
index 54c05ec..6e62afd 100644 (file)
@@ -401,8 +401,8 @@ class StatusTest extends MediaWikiLangTestCase {
                        $status,
                        "* ⧼fooBar!⧽\n* ⧼fooBar2!⧽\n",
                        "(wrap-long: * (fooBar!)\n* (fooBar2!)\n)",
-                       "<ul><li> ⧼fooBar!⧽</li>\n<li> ⧼fooBar2!⧽</li></ul>\n",
-                       "<p>(wrap-long: * (fooBar!)\n</p>\n<ul><li> (fooBar2!)</li></ul>\n<p>)\n</p>",
+                       "<ul><li>⧼fooBar!⧽</li>\n<li>⧼fooBar2!⧽</li></ul>\n",
+                       "<p>(wrap-long: * (fooBar!)\n</p>\n<ul><li>(fooBar2!)</li></ul>\n<p>)\n</p>",
                ];
 
                $status = new Status();
@@ -422,8 +422,8 @@ class StatusTest extends MediaWikiLangTestCase {
                        $status,
                        "* ⧼fooBar!⧽\n* ⧼fooBar2!⧽\n",
                        "(wrap-long: * (fooBar!: foo, bar)\n* (fooBar2!)\n)",
-                       "<ul><li> ⧼fooBar!⧽</li>\n<li> ⧼fooBar2!⧽</li></ul>\n",
-                       "<p>(wrap-long: * (fooBar!: foo, bar)\n</p>\n<ul><li> (fooBar2!)</li></ul>\n<p>)\n</p>",
+                       "<ul><li>⧼fooBar!⧽</li>\n<li>⧼fooBar2!⧽</li></ul>\n",
+                       "<p>(wrap-long: * (fooBar!: foo, bar)\n</p>\n<ul><li>(fooBar2!)</li></ul>\n<p>)\n</p>",
                ];
 
                return $testCases;
diff --git a/tests/phpunit/includes/api/ApiDisabledTest.php b/tests/phpunit/includes/api/ApiDisabledTest.php
new file mode 100644 (file)
index 0000000..cfdd57b
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * @group API
+ * @group medium
+ *
+ * @covers ApiDisabled
+ */
+class ApiDisabledTest extends ApiTestCase {
+       public function testDisabled() {
+               $this->mergeMwGlobalArrayValue( 'wgAPIModules',
+                       [ 'login' => 'ApiDisabled' ] );
+
+               $this->setExpectedException( ApiUsageException::class,
+                       'The "login" module has been disabled.' );
+
+               $this->doApiRequest( [ 'action' => 'login' ] );
+       }
+}
index 8919c5e..8417f5c 100644 (file)
@@ -4,9 +4,9 @@ use MediaWiki\Linker\LinkTarget;
 use MediaWiki\MediaWikiServices;
 
 /**
+ * @medium
  * @group API
  * @group Database
- * @group medium
  *
  * @covers ApiQueryWatchlist
  */
index 1bdbe01..88f4d8f 100644 (file)
@@ -104,7 +104,7 @@ END;
                $this->assertEquals( "Opening text is opening.", $struct->getOpeningText() );
                $this->assertEquals( "Opening text is opening.   Then we got more text",
                        $struct->getMainText() );
-               $this->assertEquals( [ "Header table  row in table  another row in table" ],
+               $this->assertEquals( [ "Header table row in table another row in table" ],
                        $struct->getAuxiliaryText() );
        }
 }
index 1e685bd..f80d18c 100644 (file)
@@ -2,6 +2,7 @@
 
 /**
  * @group Http
+ * @group small
  */
 class HttpTest extends MediaWikiTestCase {
        /**
index 076924c..97ea326 100644 (file)
@@ -5,8 +5,10 @@ use MediaWiki\MediaWikiServices;
  * Integration test that checks import success and
  * LinkCache integration.
  *
- * @group medium
+ * @large
  * @group Database
+ * @covers ImportStreamSource
+ * @covers ImportReporter
  *
  * @author mwjames
  */
index 009580b..b883c11 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 use Wikimedia\Rdbms\LikeMatch;
+use Wikimedia\Rdbms\Database;
 
 /**
  * Test the parts of the Database abstract class that deal
@@ -10,7 +11,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
 
        use MediaWikiCoversValidator;
 
-       /** @var DatabaseTestHelper */
+       /** @var DatabaseTestHelper|Database */
        private $database;
 
        protected function setUp() {
@@ -239,6 +240,101 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                ];
        }
 
+       /**
+        * @covers Wikimedia\Rdbms\Subquery
+        * @dataProvider provideSelectRowCount
+        * @param $sql
+        * @param $sqlText
+        */
+       public function testSelectRowCount( $sql, $sqlText ) {
+               $this->database->selectRowCount(
+                       $sql['tables'],
+                       $sql['field'],
+                       isset( $sql['conds'] ) ? $sql['conds'] : [],
+                       __METHOD__,
+                       isset( $sql['options'] ) ? $sql['options'] : [],
+                       isset( $sql['join_conds'] ) ? $sql['join_conds'] : []
+               );
+               $this->assertLastSql( $sqlText );
+       }
+
+       public static function provideSelectRowCount() {
+               return [
+                       [
+                               [
+                                       'tables' => 'table',
+                                       'field' => [ '*' ],
+                                       'conds' => [ 'field' => 'text' ],
+                               ],
+                               "SELECT COUNT(*) AS rowcount FROM " .
+                               "(SELECT 1 FROM table WHERE field = 'text'  ) tmp_count"
+                       ],
+                       [
+                               [
+                                       'tables' => 'table',
+                                       'field' => [ 'column' ],
+                                       'conds' => [ 'field' => 'text' ],
+                               ],
+                               "SELECT COUNT(*) AS rowcount FROM " .
+                               "(SELECT 1 FROM table WHERE field = 'text' AND (column IS NOT NULL)  ) tmp_count"
+                       ],
+                       [
+                               [
+                                       'tables' => 'table',
+                                       'field' => [ 'alias' => 'column' ],
+                                       'conds' => [ 'field' => 'text' ],
+                               ],
+                               "SELECT COUNT(*) AS rowcount FROM " .
+                               "(SELECT 1 FROM table WHERE field = 'text' AND (column IS NOT NULL)  ) tmp_count"
+                       ],
+                       [
+                               [
+                                       'tables' => 'table',
+                                       'field' => [ 'alias' => 'column' ],
+                                       'conds' => '',
+                               ],
+                               "SELECT COUNT(*) AS rowcount FROM " .
+                               "(SELECT 1 FROM table WHERE (column IS NOT NULL)  ) tmp_count"
+                       ],
+                       [
+                               [
+                                       'tables' => 'table',
+                                       'field' => [ 'alias' => 'column' ],
+                                       'conds' => false,
+                               ],
+                               "SELECT COUNT(*) AS rowcount FROM " .
+                               "(SELECT 1 FROM table WHERE (column IS NOT NULL)  ) tmp_count"
+                       ],
+                       [
+                               [
+                                       'tables' => 'table',
+                                       'field' => [ 'alias' => 'column' ],
+                                       'conds' => null,
+                               ],
+                               "SELECT COUNT(*) AS rowcount FROM " .
+                               "(SELECT 1 FROM table WHERE (column IS NOT NULL)  ) tmp_count"
+                       ],
+                       [
+                               [
+                                       'tables' => 'table',
+                                       'field' => [ 'alias' => 'column' ],
+                                       'conds' => '1',
+                               ],
+                               "SELECT COUNT(*) AS rowcount FROM " .
+                               "(SELECT 1 FROM table WHERE (1) AND (column IS NOT NULL)  ) tmp_count"
+                       ],
+                       [
+                               [
+                                       'tables' => 'table',
+                                       'field' => [ 'alias' => 'column' ],
+                                       'conds' => '0',
+                               ],
+                               "SELECT COUNT(*) AS rowcount FROM " .
+                               "(SELECT 1 FROM table WHERE (0) AND (column IS NOT NULL)  ) tmp_count"
+                       ],
+               ];
+       }
+
        /**
         * @dataProvider provideUpdate
         * @covers Wikimedia\Rdbms\Database::update
index 0e1605a..c25329f 100644 (file)
@@ -8,6 +8,7 @@ use Wikimedia\ScopedCallback;
  * Note: the following groups are not used by PHPUnit.
  * The list in ParserTestFileSuite::__construct() is used instead.
  *
+ * @large
  * @group Database
  * @group Parser
  * @group ParserTests
index fdf0152..edc2eff 100644 (file)
@@ -1,7 +1,13 @@
 <?php
 
 /**
+ * @medium
  * @group Database
+ * @covers FormattedRCFeed
+ * @covers RecentChange
+ * @covers JSONRCFeedFormatter
+ * @covers MachineReadableRCFeedFormatter
+ * @covers RCFeed
  */
 class RCFeedIntegrationTest extends MediaWikiTestCase {
        protected function setUp() {
@@ -17,15 +23,6 @@ class RCFeedIntegrationTest extends MediaWikiTestCase {
                ] );
        }
 
-       /**
-        * @covers RecentChange::notifyRCFeeds
-        * @covers RecentChange::getEngine
-        * @covers RCFeed::factory
-        * @covers FormattedRCFeed::__construct
-        * @covers FormattedRCFeed::notify
-        * @covers JSONRCFeedFormatter::formatArray
-        * @covers MachineReadableRCFeedFormatter::getLine
-        */
        public function testNotify() {
                $feed = $this->getMockBuilder( RCFeedEngine::class )
                        ->setConstructorArgs( [ [ 'formatter' => JSONRCFeedFormatter::class ] ] )
index f54e31c..105f409 100644 (file)
@@ -22,54 +22,26 @@ class CreateAccountPage extends Page {
        }
 
        apiCreateAccount( username, password ) {
-               const url = require( 'url' ), // https://nodejs.org/docs/latest/api/url.html
-                       baseUrl = url.parse( browser.options.baseUrl ), // http://webdriver.io/guide/testrunner/browserobject.html
-                       Bot = require( 'nodemw' ), // https://github.com/macbre/nodemw
-                       client = new Bot( {
-                               protocol: baseUrl.protocol,
-                               server: baseUrl.hostname,
-                               port: baseUrl.port,
-                               path: baseUrl.path,
-                               debug: false
-                       } );
 
-               return new Promise( ( resolve, reject ) => {
-                       client.api.call(
-                               {
-                                       action: 'query',
-                                       meta: 'tokens',
-                                       type: 'createaccount'
-                               },
-                               /**
-                                * @param {Error|null} err
-                                * @param {Object} info Processed query result
-                                * @param {Object} next More results?
-                                * @param {Object} data Raw data
-                                */
-                               function ( err, info, next, data ) {
-                                       if ( err ) {
-                                               reject( err );
-                                               return;
-                                       }
-                                       client.api.call( {
-                                               action: 'createaccount',
-                                               createreturnurl: browser.options.baseUrl,
-                                               createtoken: data.query.tokens.createaccounttoken,
-                                               username: username,
-                                               password: password,
-                                               retype: password
-                                       }, function ( err ) {
-                                               if ( err ) {
-                                                       reject( err );
-                                                       return;
-                                               }
-                                               resolve();
-                                       }, 'POST' );
-                               },
-                               'POST'
-                       );
+               const MWBot = require( 'mwbot' ), // https://github.com/Fannon/mwbot
+                       Promise = require( 'bluebird' );
+               let bot = new MWBot();
 
-               } );
+               return Promise.coroutine( function* () {
+                       yield bot.loginGetCreateaccountToken( {
+                               apiUrl: `${browser.options.baseUrl}/api.php`,
+                               username: browser.options.username,
+                               password: browser.options.password
+                       } );
+                       yield bot.request( {
+                               action: 'createaccount',
+                               createreturnurl: browser.options.baseUrl,
+                               createtoken: bot.createaccountToken,
+                               username: username,
+                               password: password,
+                               retype: password
+                       } );
+               } ).call( this );
 
        }
 
index bd28ca8..d43cb9f 100644 (file)
@@ -19,33 +19,20 @@ class DeletePage extends Page {
        }
 
        apiDelete( name, reason ) {
-               const url = require( 'url' ), // https://nodejs.org/docs/latest/api/url.html
-                       baseUrl = url.parse( browser.options.baseUrl ), // http://webdriver.io/guide/testrunner/browserobject.html
-                       Bot = require( 'nodemw' ), // https://github.com/macbre/nodemw
-                       client = new Bot( {
-                               protocol: baseUrl.protocol,
-                               server: baseUrl.hostname,
-                               port: baseUrl.port,
-                               path: baseUrl.path,
+
+               const MWBot = require( 'mwbot' ), // https://github.com/Fannon/mwbot
+                       Promise = require( 'bluebird' );
+               let bot = new MWBot();
+
+               return Promise.coroutine( function* () {
+                       yield bot.loginGetEditToken( {
+                               apiUrl: `${browser.options.baseUrl}/api.php`,
                                username: browser.options.username,
-                               password: browser.options.password,
-                               debug: false
+                               password: browser.options.password
                        } );
+                       yield bot.delete( name, reason );
+               } ).call( this );
 
-               return new Promise( ( resolve, reject ) => {
-                       client.logIn( function ( err ) {
-                               if ( err ) {
-                                       console.log( err );
-                                       return reject( err );
-                               }
-                               client.delete( name, reason, function ( err ) {
-                                       if ( err ) {
-                                               return reject( err );
-                                       }
-                                       resolve();
-                               } );
-                       } );
-               } );
        }
 
 }
index 34f4263..33a27f0 100644 (file)
@@ -19,33 +19,20 @@ class EditPage extends Page {
        }
 
        apiEdit( name, content ) {
-               const url = require( 'url' ), // https://nodejs.org/docs/latest/api/url.html
-                       baseUrl = url.parse( browser.options.baseUrl ), // http://webdriver.io/guide/testrunner/browserobject.html
-                       Bot = require( 'nodemw' ), // https://github.com/macbre/nodemw
-                       client = new Bot( {
-                               protocol: baseUrl.protocol,
-                               server: baseUrl.hostname,
-                               port: baseUrl.port,
-                               path: baseUrl.path,
+
+               const MWBot = require( 'mwbot' ), // https://github.com/Fannon/mwbot
+                       Promise = require( 'bluebird' );
+               let bot = new MWBot();
+
+               return Promise.coroutine( function* () {
+                       yield bot.loginGetEditToken( {
+                               apiUrl: `${browser.options.baseUrl}/api.php`,
                                username: browser.options.username,
-                               password: browser.options.password,
-                               debug: false
+                               password: browser.options.password
                        } );
+                       yield bot.edit( name, content, `Created page with "${content}"` );
+               } ).call( this );
 
-               return new Promise( ( resolve, reject ) => {
-                       client.logIn( function ( err ) {
-                               if ( err ) {
-                                       console.log( err );
-                                       return reject( err );
-                               }
-                               client.edit( name, content, `Created page with "${content}"`, function ( err ) {
-                                       if ( err ) {
-                                               return reject( err );
-                                       }
-                                       resolve();
-                               } );
-                       } );
-               } );
        }
 
 }
index ed1f1bc..77bb1f4 100644 (file)
@@ -2,7 +2,7 @@
 'use strict';
 class Page {
        open( path ) {
-               browser.url( '/index.php?title=' + path );
+               browser.url( browser.options.baseUrl + '/index.php?title=' + path );
        }
 }
 module.exports = Page;
index ef47438..071f7f9 100644 (file)
@@ -8,7 +8,7 @@ class RestorePage extends Page {
        get displayedContent() { return browser.element( '#mw-content-text' ); }
 
        open( name ) {
-               browser.url( '/index.php?title=Special:Undelete/' + name );
+               super.open( 'Special:Undelete/' + name );
        }
 
        restore( name, reason ) {
index 26881eb..de2b738 100644 (file)
@@ -14,7 +14,9 @@ exports.config = merge( wdioConf.config, {
                process.env.MEDIAWIKI_PASSWORD,
        screenshotPath: '../log/',
        baseUrl: process.env.MW_SERVER + process.env.MW_SCRIPT_PATH,
-
+       exclude: [
+               './extensions/CirrusSearch/tests/selenium/specs/**/*.js'
+       ],
        reporters: [ 'spec', 'junit' ],
        reporterOptions: {
                junit: {