Merge "Add optional jQuery event delegates in Confirmable"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 21 Mar 2019 10:54:16 +0000 (10:54 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 21 Mar 2019 10:54:16 +0000 (10:54 +0000)
130 files changed:
.travis.yml
RELEASE-NOTES-1.33
autoload.php
docs/export-0.10.xsd
docs/hooks.txt
includes/ContentSecurityPolicy.php
includes/DefaultSettings.php
includes/EditPage.php
includes/Linker.php
includes/Storage/DerivedPageDataUpdater.php
includes/Storage/NameTableStore.php
includes/Storage/SqlBlobStore.php
includes/Title.php
includes/api/ApiQueryUserContribs.php
includes/api/ApiSetNotificationTimestamp.php
includes/api/ApiUpload.php
includes/api/i18n/cs.json
includes/api/i18n/de.json
includes/api/i18n/et.json
includes/cache/MessageCache.php
includes/changes/RecentChange.php
includes/changetags/Taggable.php [new file with mode: 0644]
includes/context/DerivativeContext.php
includes/db/CloneDatabase.php
includes/db/DatabaseOracle.php
includes/deferred/LinksUpdate.php
includes/deferred/RefreshSecondaryDataUpdate.php [deleted file]
includes/export/WikiExporter.php
includes/export/XmlDumpWriter.php
includes/installer/i18n/fa.json
includes/jobqueue/jobs/ClearWatchlistNotificationsJob.php
includes/libs/objectcache/BagOStuff.php
includes/libs/objectcache/CachedBagOStuff.php
includes/libs/objectcache/EmptyBagOStuff.php
includes/libs/objectcache/HashBagOStuff.php
includes/libs/objectcache/MemcachedBagOStuff.php
includes/libs/objectcache/MemcachedPhpBagOStuff.php
includes/libs/objectcache/RESTBagOStuff.php
includes/libs/rdbms/database/DatabaseMysqlBase.php
includes/libs/rdbms/database/DatabaseSqlite.php
includes/libs/rdbms/database/IDatabase.php
includes/logging/LogEntry.php
includes/media/MediaTransformOutput.php
includes/pager/TablePager.php
includes/parser/BlockLevelPass.php
includes/parser/RemexStripTagHandler.php
includes/specials/SpecialConfirmemail.php
includes/user/User.php
includes/watcheditem/WatchedItemStore.php
languages/i18n/bg.json
languages/i18n/bn.json
languages/i18n/bqi.json
languages/i18n/ckb.json
languages/i18n/cs.json
languages/i18n/de.json
languages/i18n/diq.json
languages/i18n/en.json
languages/i18n/es.json
languages/i18n/exif/diq.json
languages/i18n/exif/fa.json
languages/i18n/exif/lrc.json
languages/i18n/exif/tr.json
languages/i18n/fa.json
languages/i18n/fy.json
languages/i18n/hi.json
languages/i18n/inh.json
languages/i18n/io.json
languages/i18n/ja.json
languages/i18n/jv.json
languages/i18n/lb.json
languages/i18n/lrc.json
languages/i18n/lt.json
languages/i18n/lv.json
languages/i18n/min.json
languages/i18n/mk.json
languages/i18n/ml.json
languages/i18n/nb.json
languages/i18n/pt.json
languages/i18n/qqq.json
languages/i18n/sh.json
languages/i18n/sv.json
languages/i18n/tr.json
maintenance/Maintenance.php
maintenance/dumpTextPass.php
maintenance/fetchText.php
maintenance/populateCategory.php
maintenance/populateContentTables.php
maintenance/rebuildtextindex.php
maintenance/resources/foreign-resources.yaml
resources/Resources.php
resources/lib/jquery.ba-throttle-debounce.js [deleted file]
resources/lib/jquery.form.js [deleted file]
resources/lib/jquery.form/jquery.form.js [new file with mode: 0644]
resources/lib/jquery.fullscreen.js [deleted file]
resources/lib/jquery.fullscreen/jquery.fullscreen.js [new file with mode: 0644]
resources/lib/jquery.hoverIntent.js [deleted file]
resources/lib/jquery.hoverIntent/jquery.hoverIntent.js [new file with mode: 0644]
resources/lib/jquery.jStorage.js [deleted file]
resources/lib/jquery.jStorage/jstorage.js [new file with mode: 0644]
resources/lib/jquery.throttle-debounce/jquery.ba-throttle-debounce.js [new file with mode: 0644]
resources/lib/ooui/oojs-ui-core.js
resources/src/jquery.tablesorter/jquery.tablesorter.js
resources/src/mediawiki.pager.tablePager/TablePager.less
resources/src/mediawiki.rollback.confirmation.js [new file with mode: 0644]
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js
tests/common/TestsAutoLoader.php
tests/parser/parserTests.txt
tests/phpunit/PHPUnit4And6Compat.php
tests/phpunit/includes/ActorMigrationTest.php
tests/phpunit/includes/LinkerTest.php
tests/phpunit/includes/OutputPageTest.php
tests/phpunit/includes/Revision/McrSchemaOverride.php
tests/phpunit/includes/auth/CheckBlocksSecondaryAuthenticationProviderTest.php
tests/phpunit/includes/debug/logger/monolog/CeeFormatterTest.php
tests/phpunit/includes/parser/SanitizerTest.php
tests/phpunit/includes/user/UserTest.php
tests/phpunit/includes/watcheditem/WatchedItemStoreIntegrationTest.php
tests/phpunit/includes/watcheditem/WatchedItemStoreUnitTest.php
tests/phpunit/maintenance/DumpAsserter.php [new file with mode: 0644]
tests/phpunit/maintenance/DumpTestCase.php
tests/phpunit/maintenance/backupTextPassTest.php
tests/phpunit/maintenance/backup_LogTest.php
tests/phpunit/maintenance/backup_PageTest.php
tests/phpunit/maintenance/fetchTextTest.php
tests/phpunit/maintenance/xml.xsd [new file with mode: 0644]
tests/selenium/.eslintrc.json
tests/selenium/pageobjects/history.page.js
tests/selenium/specs/page.js
tests/selenium/specs/rollback.js [new file with mode: 0644]
tests/selenium/wdio-mediawiki/Api.js

index 9dc2ef7..e4a173d 100644 (file)
@@ -13,10 +13,6 @@ language: php
 # - Required for non-buggy xml library for XmlTypeCheck/UploadBaseTest (T75176).
 dist: trusty
 
-git:
-  depth: 3
-  quiet: true
-
 # Cache NPM and Composer directories
 # <https://docs.travis-ci.com/user/caching/>
 cache:
index 405d5a7..646a9c2 100644 (file)
@@ -90,6 +90,9 @@ For notes on 1.32.x and older releases, see HISTORY.
   language where available.
 * Special:ActiveUsers will no longer filter out users who became inactive since
   the last time the active users query cache was updated.
+* (T215675) RecentChange and ManualLogEntry implement new Taggable interface.
+* (T215675) Added a hook, ManualLogEntryBeforePublish, to allow extensions
+  to modify (example: add tags) log entries.
 
 === New developer features in 1.33 ===
 * The AuthManagerLoginAuthenticateAudit hook has a new parameter for
@@ -128,6 +131,8 @@ For notes on 1.32.x and older releases, see HISTORY.
 === Bug fixes in 1.33 ===
 * (T164211) Special:UserRights could sometimes fail with a
   "conflict detected" error when there weren't any conflicts.
+* (T216029) Chrome redirects to Special:BadTitle after editing a section with
+  a non-Latin name on a page with non-Latin characters in title.
 
 === Action API changes in 1.33 ===
 * (T198913) Added 'ApiOptions' hook.
@@ -386,6 +391,9 @@ because of Phabricator reports.
   deprecated and will be removed in the future.
 * The FileBasedSiteLookup class has been deprecated. For a cacheable SiteLookup
   implementation, use CachingSiteStore instead.
+* ManualLogEntry::setTags() is deprecated, use ManualLogEntry::addTags()
+  instead. The setTags() method was overriding the tags, addTags() doesn't
+  override, only adds new tags.
 
 === Other changes in 1.33 ===
 * (T201747) Html::openElement() warns if given an element name with a space
index 1c7c34e..4172ed3 100644 (file)
@@ -870,6 +870,7 @@ $wgAutoloadLocalClasses = [
        'MediaWikiSite' => __DIR__ . '/includes/site/MediaWikiSite.php',
        'MediaWikiTitleCodec' => __DIR__ . '/includes/title/MediaWikiTitleCodec.php',
        'MediaWikiVersionFetcher' => __DIR__ . '/includes/MediaWikiVersionFetcher.php',
+       'MediaWiki\\ChangeTags\\Taggable' => __DIR__ . '/includes/changetags/Taggable.php',
        'MediaWiki\\Config\\ConfigRepository' => __DIR__ . '/includes/config/ConfigRepository.php',
        'MediaWiki\\DB\\PatchFileLocation' => __DIR__ . '/includes/db/PatchFileLocation.php',
        'MediaWiki\\Diff\\ComplexityException' => __DIR__ . '/includes/diff/ComplexityException.php',
@@ -1214,7 +1215,6 @@ $wgAutoloadLocalClasses = [
        'RefreshImageMetadata' => __DIR__ . '/maintenance/refreshImageMetadata.php',
        'RefreshLinks' => __DIR__ . '/maintenance/refreshLinks.php',
        'RefreshLinksJob' => __DIR__ . '/includes/jobqueue/jobs/RefreshLinksJob.php',
-       'RefreshSecondaryDataUpdate' => __DIR__ . '/includes/deferred/RefreshSecondaryDataUpdate.php',
        'RegexlikeReplacer' => __DIR__ . '/includes/libs/replacers/RegexlikeReplacer.php',
        'RemexStripTagHandler' => __DIR__ . '/includes/parser/RemexStripTagHandler.php',
        'RemoveInvalidEmails' => __DIR__ . '/maintenance/removeInvalidEmails.php',
index 9d5d49e..6291bfc 100644 (file)
                                <!-- This isn't a good idea; we should be using "ID" instead of "NMTOKEN" -->
                                <!-- However, "NMTOKEN" is strictest definition that is both compatible with existing -->
                                <!-- usage ([0-9]+) and with the "ID" type. -->
-                               <attribute name="id" type="NMTOKEN" />
+                               <attribute name="id" use="optional" type="NMTOKEN" />
                                <attribute name="bytes" use="optional" type="nonNegativeInteger" />
                        </extension>
                </simpleContent>
index 9e6ed10..4ef680a 100644 (file)
@@ -2210,6 +2210,10 @@ ResourceLoaderGetConfigVars instead.
   Skin::makeVariablesScript
 $out: The OutputPage which called the hook, can be used to get the real title.
 
+'ManualLogEntryBeforePublish': Allows to access or modify log entry just before it is
+published.
+$logEntry: ManualLogEntry object
+
 'MarkPatrolled': Before an edit is marked patrolled.
 $rcid: ID of the revision to be marked patrolled
 &$user: the user (object) marking the revision as patrolled
index 6216046..be598ea 100644 (file)
@@ -98,11 +98,14 @@ class ContentSecurityPolicy {
         *
         * @param int $reportOnly Either self::REPORT_ONLY_MODE or self::FULL_MODE
         * @return string Name of http header
+        * @throws UnexpectedValueException
         */
        private function getHeaderName( $reportOnly ) {
                if ( $reportOnly === self::REPORT_ONLY_MODE ) {
                        return 'Content-Security-Policy-Report-Only';
-               } elseif ( $reportOnly === self::FULL_MODE ) {
+               }
+
+               if ( $reportOnly === self::FULL_MODE ) {
                        return 'Content-Security-Policy';
                }
                throw new UnexpectedValueException( $reportOnly );
@@ -111,7 +114,8 @@ class ContentSecurityPolicy {
        /**
         * Determine what CSP policies to set for this page
         *
-        * @param array|bool $config Policy configuration (Either $wgCSPHeader or $wgCSPReportOnlyHeader)
+        * @param array|bool $policyConfig Policy configuration
+        *   (Either $wgCSPHeader or $wgCSPReportOnlyHeader)
         * @param int $mode self::REPORT_ONLY_MODE, self::FULL_MODE
         * @return string Policy directives, or empty string for no policy.
         */
@@ -152,8 +156,8 @@ class ContentSecurityPolicy {
                        }
                }
                // Note: default on if unspecified.
-               if ( !isset( $policyConfig['unsafeFallback'] )
-                       || $policyConfig['unsafeFallback'] )
+               if ( !isset( $policyConfig['unsafeFallback'] )
+                       || $policyConfig['unsafeFallback']
                ) {
                        // unsafe-inline should be ignored on browsers
                        // that support 'nonce-foo' sources.
index 68d7846..5f93abe 100644 (file)
@@ -4877,6 +4877,7 @@ $wgDefaultUserOptions = [
        'rows' => 25, // @deprecated since 1.29 No longer used in core
        'showhiddencats' => 0,
        'shownumberswatching' => 1,
+       'showrollbackconfirmation' => 0,
        'skin' => false,
        'stubthreshold' => 0,
        'thumbsize' => 5,
@@ -9004,15 +9005,6 @@ $wgActorTableSchemaMigrationStage = SCHEMA_COMPAT_OLD;
  */
 $wgEnablePartialBlocks = false;
 
-/**
- * Enable confirmation prompt for rollback actions to prevent accidental rollbacks.
- * May be disabled to reduce number of clicks needed to perform rollbacks.
- *
- * @since 1.33
- * @var bool
- */
-$wgEnableRollbackConfirmationPrompt = true;
-
 /**
  * Enable stats monitoring when Block Notices are displayed in different places around core
  * and extensions.
@@ -9041,6 +9033,16 @@ $wgOriginTrials = [];
  */
 $wgPriorityHints = false;
 
+/**
+ * Enable Element Timing.
+ *
+ * @warning EXPERIMENTAL!
+ *
+ * @since 1.34
+ * @var bool
+ */
+$wgElementTiming = false;
+
 /**
  * For really cool vim folding this needs to be at the end:
  * vim: foldmarker=@{,@} foldmethod=marker
index 41238df..23cdc3b 100644 (file)
@@ -4557,7 +4557,10 @@ ERROR;
                        return $wgParser->guessLegacySectionNameFromWikiText( $text );
                }
                // Meanwhile, real browsers get real anchors
-               return $wgParser->guessSectionNameFromWikiText( $text );
+               $name = $wgParser->guessSectionNameFromWikiText( $text );
+               // With one little caveat: per T216029, fragments in HTTP redirects need to be urlencoded,
+               // otherwise Chrome double-escapes the rest of the URL.
+               return '#' . urlencode( mb_substr( $name, 1 ) );
        }
 
        /**
index 3e50ac6..6f11c1c 100644 (file)
@@ -1768,6 +1768,10 @@ class Linker {
                        $inner = $context->msg( 'brackets' )->rawParams( $inner )->escaped();
                }
 
+               if ( $context->getUser()->getBoolOption( 'showrollbackconfirmation' ) ) {
+                       $context->getOutput()->addModules( 'mediawiki.page.rollback.confirmation' );
+               }
+
                return '<span class="mw-rollback-link">' . $inner . '</span>';
        }
 
@@ -1869,6 +1873,7 @@ class Linker {
                $attrs = [
                        'data-mw' => 'interface',
                        'title' => $context->msg( 'tooltip-rollback' )->text(),
+                       'data-rollback-count' => (int)$editCount
                ];
                $options = [ 'known', 'noclasses' ];
 
index 8dedc70..9ce12b4 100644 (file)
@@ -24,7 +24,6 @@ namespace MediaWiki\Storage;
 
 use ApiStashEdit;
 use CategoryMembershipChangeJob;
-use RefreshSecondaryDataUpdate;
 use Content;
 use ContentHandler;
 use DataUpdate;
@@ -1591,31 +1590,14 @@ class DerivedPageDataUpdater implements IDBAccessObject {
                                $update->setRevision( $legacyRevision );
                                $update->setTriggeringUser( $triggeringUser );
                        }
-               }
-
-               if ( $options['defer'] === false ) {
-                       foreach ( $updates as $update ) {
-                               if ( $update instanceof DataUpdate && $options['transactionTicket'] !== null ) {
+                       if ( $options['defer'] === false ) {
+                               if ( $options['transactionTicket'] !== null ) {
                                        $update->setTransactionTicket( $options['transactionTicket'] );
                                }
                                $update->doUpdate();
+                       } else {
+                               DeferredUpdates::addUpdate( $update, $options['defer'] );
                        }
-               } else {
-                       $cacheTime = $this->getCanonicalParserOutput()->getCacheTime();
-                       // Bundle all of the data updates into a single deferred update wrapper so that
-                       // any failure will cause at most one refreshLinks job to be enqueued by
-                       // DeferredUpdates::doUpdates(). This is hard to do when there are many separate
-                       // updates that are not defined as being related.
-                       $update = new RefreshSecondaryDataUpdate(
-                               $this->wikiPage,
-                               $updates,
-                               $options,
-                               $cacheTime,
-                               $this->loadbalancerFactory->getLocalDomainID()
-                       );
-                       $update->setRevision( $legacyRevision );
-                       $update->setTriggeringUser( $triggeringUser );
-                       DeferredUpdates::addUpdate( $update, $options['defer'] );
                }
        }
 
index 27194ab..3016e99 100644 (file)
@@ -345,10 +345,10 @@ class NameTableStore {
        /**
         * Reap the WANCache entry for this table.
         *
-        * @param callable $purgeCallback callback to 'purge' the WAN cache
+        * @param callable $purgeCallback Callback to 'purge' the WAN cache
         */
        private function purgeWANCache( $purgeCallback ) {
-               // If the LB has no DB changes don't both with onTransactionPreCommitOrIdle
+               // If the LB has no DB changes don't bother with onTransactionPreCommitOrIdle
                if ( !$this->loadBalancer->hasOrMadeRecentMasterChanges() ) {
                        $purgeCallback();
                        return;
index a5c5985..82410cc 100644 (file)
@@ -606,12 +606,14 @@ class SqlBlobStore implements IDBAccessObject, BlobStore {
        /**
         * Splits a blob address into three parts: the schema, the ID, and parameters/flags.
         *
+        * @since 1.33
+        *
         * @param string $address
         *
         * @throws InvalidArgumentException
         * @return array [ $schema, $id, $parameters ], with $parameters being an assoc array.
         */
-       private static function splitBlobAddress( $address ) {
+       public static function splitBlobAddress( $address ) {
                if ( !preg_match( '/^(\w+):(\w+)(\?(.*))?$/', $address, $m ) ) {
                        throw new InvalidArgumentException( "Bad blob address: $address" );
                }
index 88a7efb..d8aeb62 100644 (file)
@@ -3342,12 +3342,17 @@ class Title implements LinkTarget, IDBAccessObject {
                                $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
                                $rows = $cache->getWithSetCallback(
                                        // Page protections always leave a new null revision
-                                       $cache->makeKey( 'page-restrictions', $id, $this->getLatestRevID() ),
+                                       $cache->makeKey( 'page-restrictions', 'v1', $id, $this->getLatestRevID() ),
                                        $cache::TTL_DAY,
                                        function ( $curValue, &$ttl, array &$setOpts ) use ( $loadRestrictionsFromDb ) {
                                                $dbr = wfGetDB( DB_REPLICA );
 
                                                $setOpts += Database::getCacheSetOptions( $dbr );
+                                               $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
+                                               if ( $lb->hasOrMadeRecentMasterChanges() ) {
+                                                       // @TODO: cleanup Title cache and caller assumption mess in general
+                                                       $ttl = WANObjectCache::TTL_UNCACHEABLE;
+                                               }
 
                                                return $loadRestrictionsFromDb( $dbr );
                                        }
index 7e548ab..5b178b7 100644 (file)
@@ -525,7 +525,6 @@ class ApiQueryUserContribs extends ApiQueryBase {
                if ( $this->fld_ids ) {
                        $vals['pageid'] = (int)$row->rev_page;
                        $vals['revid'] = (int)$row->rev_id;
-                       // $vals['textid'] = (int)$row->rev_text_id; // todo: Should this field be exposed?
 
                        if ( !is_null( $row->rev_parent_id ) ) {
                                $vals['parentid'] = (int)$row->rev_parent_id;
index c9ebfa8..ba4c6e8 100644 (file)
@@ -108,14 +108,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                $result = [];
                if ( $params['entirewatchlist'] ) {
                        // Entire watchlist mode: Just update the thing and return a success indicator
-                       if ( is_null( $timestamp ) ) {
-                               $watchedItemStore->resetAllNotificationTimestampsForUser( $user );
-                       } else {
-                               $watchedItemStore->setNotificationTimestampsForUser(
-                                       $user,
-                                       $timestamp
-                               );
-                       }
+                       $watchedItemStore->resetAllNotificationTimestampsForUser( $user, $timestamp );
 
                        $result['notificationtimestamp'] = is_null( $timestamp )
                                ? ''
index 2c5b583..12ecd74 100644 (file)
@@ -542,7 +542,7 @@ class ApiUpload extends ApiBase {
                }
 
                // Check blocks
-               if ( $user->isBlocked() ) {
+               if ( $user->isBlockedFromUpload() ) {
                        $this->dieBlocked( $user->getBlock() );
                }
 
index dd69004..91fecc1 100644 (file)
@@ -12,7 +12,8 @@
                        "LordMsz",
                        "Dvorapa",
                        "Matěj Suchánek",
-                       "Ilimanaq29"
+                       "Ilimanaq29",
+                       "Patriccck"
                ]
        },
        "apihelp-main-extended-description": "<div class=\"hlist plainlinks api-main-links\">\n* [[mw:Special:MyLanguage/API:Main_page|Dokumentace]]\n* [[mw:Special:MyLanguage/API:FAQ|Otázky a odpovědi]]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api E-mailová konference]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce Oznámení k API]\n* [https://phabricator.wikimedia.org/maniphest/query/GebfyV4uCaLd/#R Chyby a požadavky]\n</div>\n<strong>Stav:</strong> Všechny funkce uvedené na této stránce by měly fungovat, ale API se stále aktivně vyvíjí a může se kdykoli změnit. Upozornění na změny získáte přihlášením se k [https://lists.wikimedia.org/pipermail/mediawiki-api-announce/ e-mailové konferenci mediawiki-api-announce].\n\n<strong>Chybné požadavky:</strong> Pokud jsou do API zaslány chybné požadavky, bude vrácena HTTP hlavička s klíčem „MediaWiki-API-Error“ a hodnota této hlavičky a chybový kód budou nastaveny na stejnou hodnotu. Více informací najdete [[mw:Special:MyLanguage/API:Errors_and_warnings|v dokumentaci]].\n\n<p class=\"mw-apisandbox-link\"><strong>Testování:</strong> Pro jednoduché testování požadavků na API zkuste [[Special:ApiSandbox]].</p>",
        "apierror-blocked": "Byla vám zablokována možnost editace.",
        "apierror-mustbeloggedin": "Abyste mohli $1, musíte být přihlášeni.",
        "apierror-nosuchsection-what": "$2 neobsahuje sekci $1.",
+       "apierror-readonly": "Wiki je právě v módu pro čtení a nelze ji editovat.",
        "apierror-sectionsnotsupported-what": "$1 nepodporuje sekce.",
        "apierror-timeout": "Server neodpověděl v očekávaném čase.",
        "api-credits-header": "Zásluhy",
index 4cad07f..b7892f0 100644 (file)
        "apihelp-query+recentchanges-paramvalue-prop-title": "Ergänzt den Seitentitel der Bearbeitung.",
        "apihelp-query+recentchanges-paramvalue-prop-autopatrolled": "Markiert kontrollierbare Bearbeitungen als automatisch kontrolliert oder nicht.",
        "apihelp-query+recentchanges-paramvalue-prop-tags": "Listet Markierungen für den Eintrag auf.",
+       "apihelp-query+recentchanges-param-limit": "Wie viele Änderungen insgesamt zurückgegeben werden sollen.",
+       "apihelp-query+recentchanges-param-type": "Welche Typen von Änderungen angezeigt werden sollen.",
        "apihelp-query+recentchanges-example-simple": "Listet die letzten Änderungen auf.",
        "apihelp-query+redirects-param-prop": "Zurückzugebende Eigenschaften:",
        "apihelp-query+redirects-paramvalue-prop-pageid": "Seitenkennung einer jeden Weiterleitung.",
        "apihelp-query+redirects-paramvalue-prop-title": "Titel einer jeden Weiterleitung.",
+       "apihelp-query+redirects-paramvalue-prop-fragment": "Teil einer jeden Weiterleitung, falls vorhanden.",
        "apihelp-query+redirects-param-namespace": "Schließt nur Seiten in diesen Namensräumen ein.",
        "apihelp-query+redirects-param-limit": "Wie viele Weiterleitungen zurückgegeben werden sollen.",
        "apihelp-query+revisions-summary": "Ruft Informationen zur Version ab.",
        "apihelp-query+revisions+base-paramvalue-prop-sha1": "SHA-1-Prüfsumme (Basis 16) der Version.",
        "apihelp-query+revisions+base-paramvalue-prop-slotsha1": "SHA-1 (Basis 16) eines jeden Versionsschlitzes.",
        "apihelp-query+revisions+base-paramvalue-prop-contentmodel": "Inhaltsmodell-Kennung eines jeden Versionsschlitzes.",
+       "apihelp-query+revisions+base-paramvalue-prop-comment": "Kommentar des Benutzers für die Version.",
        "apihelp-query+revisions+base-paramvalue-prop-content": "Inhalt eines jeden Versionsschlitzes.",
        "apihelp-query+revisions+base-paramvalue-prop-tags": "Markierungen für die Version.",
        "apihelp-query+revisions+base-paramvalue-prop-roles": "Die Liste enthält Schlitzregeln, die in der Version vorhanden sind.",
        "apihelp-query+search-param-qiprofile": "Zu verwendendes anfrageunabhängiges Profil (wirkt sich auf den Ranking-Algorithmus aus).",
        "apihelp-query+search-paramvalue-prop-wordcount": "Ergänzt den Wortzähler der Seite.",
        "apihelp-query+search-paramvalue-prop-extensiondata": "Ergänzt zusätzliche von Erweiterungen erzeugte Daten.",
+       "apihelp-query+search-paramvalue-prop-score": "Ignoriert.",
        "apihelp-query+search-paramvalue-prop-hasrelated": "Ignoriert.",
        "apihelp-query+search-param-limit": "Wie viele Seiten insgesamt zurückgegeben werden sollen.",
        "apihelp-query+search-param-sort": "Legt die Sortierreihenfolge der zurückgegebenen Ergebnisse fest.",
        "apihelp-query+tokens-param-type": "Typen der Token, die abgerufen werden sollen.",
        "apihelp-query+transcludedin-param-prop": "Zurückzugebende Eigenschaften:",
        "apihelp-query+transcludedin-paramvalue-prop-pageid": "Seitenkennung jeder Seite.",
+       "apihelp-query+transcludedin-paramvalue-prop-title": "Titel jeder Seite.",
        "apihelp-query+usercontribs-summary": "Alle Bearbeitungen von einem Benutzer abrufen.",
        "apihelp-query+usercontribs-param-limit": "Die maximale Anzahl der zurückzugebenden Beiträge.",
        "apihelp-query+usercontribs-param-start": "Der zurückzugebende Start-Zeitstempel.",
        "apihelp-setpagelanguage-param-tags": "Auf den Logbucheintrag anzuwendende Änderungsmarkierungen, die sich aus dieser Aktion ergeben.",
        "apihelp-setpagelanguage-example-language": "Ändert die Sprache von <kbd>Hauptseite</kbd> auf Baskisch.",
        "apihelp-setpagelanguage-example-default": "Ändert die Sprache der Seite mit der Kennung 123 auf die Standardinhaltssprache des Wikis.",
+       "apihelp-stashedit-param-title": "Titel der Seite, die bearbeitet werden soll.",
        "apihelp-stashedit-param-sectiontitle": "Der Titel für einen neuen Abschnitt.",
        "apihelp-stashedit-param-text": "Seiteninhalt.",
        "apihelp-stashedit-param-stashedtexthash": "Stattdessen zu verwendende Prüfsumme des Seiteninhalts von einem vorherigen Speicher.",
index 64107fc..30c73ce 100644 (file)
@@ -4,6 +4,135 @@
                        "Pikne"
                ]
        },
+       "apihelp-main-extended-description": "<div class=\"hlist plainlinks api-main-links\">\n* [[mw:Special:MyLanguage/API:Main_page|Dokumentatsioon]]\n* [[mw:Special:MyLanguage/API:FAQ|KKK]]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api Postiloend]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce API teadaanded]\n* [https://phabricator.wikimedia.org/maniphest/query/GebfyV4uCaLd/#R Vead ja taotlused]\n</div>\n<strong>Olek:</strong> MediaWiki API on kasutusküps ja stabiilne liides, millel on olemas tugi ja mida täiustatakse aktiivselt. Püüame seda küll vältida, aga mõnikord võib olla vajalik teha muudatusi, mille järel liides ei toimi enam varasemal kujul. Telli postiloend [https://lists.wikimedia.org/pipermail/mediawiki-api-announce/ mediawiki-api-announce], et saada teavitusi uuenduste kohta.\n\n<strong>Vigased päringud:</strong> Kui API-le saadetakse vigane päring, saadetakse HTTP päis võtmega \"MediaWiki-API-Error\" ning päisele ja tagastatavale veakoodile määratakse sama väärtus. Täpsemalt loe dokumentatsioonist: [[mw:Special:MyLanguage/API:Errors_and_warnings|API: veateated ja hoiatused]].\n\n<p class=\"mw-apisandbox-link\"><strong>Katsetamine:</strong> Et API päringuid lihtsamini katsetada, saad kasutada lehekülge [[Special:ApiSandbox]].</p>",
+       "apihelp-main-param-action": "Sooritatav toiming.",
+       "apihelp-main-param-format": "Väljundi vorming.",
+       "apihelp-compare-param-prop": "Millised teabe elemendid hankida.",
+       "apihelp-edit-param-bot": "Märgi see muudatus robotimuudatuseks.",
+       "apihelp-expandtemplates-param-prop": "Millised teabe elemendid hankida.\n\nPane tähele, et kui väärtusi pole valitud, siis sisaldab tulemus vikiteksti, aga väljund on ebasoovitatavas vormingus.",
+       "apihelp-feedcontributions-param-feedformat": "Voo väljund.",
+       "apihelp-feedcontributions-param-user": "Milliste kasutajate kaastöö hankida.",
+       "apihelp-feedcontributions-param-namespace": "Millise nimeruumi järgi kaastöö filtreerida.",
+       "apihelp-feedrecentchanges-param-feedformat": "Voo väljund.",
+       "apihelp-feedwatchlist-param-feedformat": "Voo väljund.",
+       "apihelp-help-param-helpformat": "Abiväljundi vorming.",
+       "apihelp-help-example-main": "Põhimooduli abi.",
+       "apihelp-opensearch-param-format": "Väljundi vorming.",
+       "apihelp-parse-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query-param-prop": "Millised atribuudid päritavate lehekülgede kohta hankida.",
+       "apihelp-query-param-list": "Millised loendid hankida.",
+       "apihelp-query-param-meta": "Millised metaandmed hankida.",
+       "apihelp-query+allcategories-summary": "Loetle kõik kategooriad.",
+       "apihelp-query+allcategories-param-from": "Kategooria, millest alates loetleda.",
+       "apihelp-query+allcategories-param-to": "Kategooria, milleni loetleda.",
+       "apihelp-query+allcategories-param-dir": "Järjestuse suund.",
+       "apihelp-query+allcategories-param-limit": "Kui palju kategooriaid tagastada.",
+       "apihelp-query+allcategories-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+alldeletedrevisions-param-start": "Ajatempel, millest alates loetleda.",
+       "apihelp-query+alldeletedrevisions-param-end": "Ajatempel, milleni loetleda.",
+       "apihelp-query+alldeletedrevisions-param-tag": "Loetle ainult redaktsioonid, mille küljes on see märgis.",
+       "apihelp-query+alldeletedrevisions-param-excludeuser": "Ära loetle selle kasutaja redaktsioone.",
+       "apihelp-query+alldeletedrevisions-param-namespace": "Loetle ainult leheküljed selles nimeruumis.",
+       "apihelp-query+allfileusages-param-from": "Faili pealkiri, millest alates loetleda.",
+       "apihelp-query+allfileusages-param-to": "Faili pealkiri, milleni loetleda.",
+       "apihelp-query+allfileusages-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+allfileusages-param-limit": "Kui palju üksusi kokku tagastada.",
+       "apihelp-query+allfileusages-param-dir": "Järjestuse suund.",
+       "apihelp-query+allimages-summary": "Loetle kõik pildid järjestatult.",
+       "apihelp-query+allimages-param-dir": "Järjestuse suund.",
+       "apihelp-query+allimages-param-from": "Pildi pealkiri, millest alates loetleda. Saab kasutada ainult parameetriga $1sort=name.",
+       "apihelp-query+allimages-param-to": "Pildi pealkiri, milleni loetleda. Saab kasutada ainult parameetriga $1sort=name.",
+       "apihelp-query+allimages-param-start": "Ajatempel, millest alates loetleda. Saab kasutada ainult parameetriga $1sort=timestamp.",
+       "apihelp-query+allimages-param-end": "Ajatempel, milleni loetleda. Saab kasutada ainult parameetriga $1sort=timestamp.",
+       "apihelp-query+allimages-param-limit": "Kui palju pilte kokku tagastada.",
+       "apihelp-query+alllinks-summary": "Loetle kõik lingid, mis viitavad teatud nimeruumi.",
+       "apihelp-query+alllinks-param-from": "Lingi pealkiri, millest alates loetleda.",
+       "apihelp-query+alllinks-param-to": "Lingi pealkiri, milleni loetleda.",
+       "apihelp-query+alllinks-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+alllinks-param-namespace": "Loetlemise nimeruum.",
+       "apihelp-query+alllinks-param-limit": "Kui palju üksusi kokku tagastada.",
+       "apihelp-query+alllinks-param-dir": "Järjestuse suund.",
+       "apihelp-query+allmessages-param-prop": "Millised atribuudid hankida.",
+       "apihelp-query+allpages-summary": "Loetle kõik leheküljed järjestatult teatud nimeruumis.",
+       "apihelp-query+allpages-param-from": "Lehekülje pealkiri, millest alates loetleda.",
+       "apihelp-query+allpages-param-to": "Lehekülje pealkiri, milleni loetleda.",
+       "apihelp-query+allpages-param-namespace": "Loetlemise nimeruum.",
+       "apihelp-query+allpages-param-filterredir": "Millised leheküljed loetleda.",
+       "apihelp-query+allpages-param-limit": "Kui palju lehekülgi kokku tagastada.",
+       "apihelp-query+allpages-param-dir": "Järjestuse suund.",
+       "apihelp-query+allredirects-param-from": "Ümbersuunamise pealkiri, millest alates loetleda.",
+       "apihelp-query+allredirects-param-to": "Ümbersuunamise pealkiri, milleni loetleda.",
+       "apihelp-query+allredirects-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+allredirects-param-namespace": "Loetlemise nimeruum.",
+       "apihelp-query+allredirects-param-limit": "Kui palju üksusi kokku tagastada.",
+       "apihelp-query+allredirects-param-dir": "Järjestuse suund.",
+       "apihelp-query+allrevisions-param-start": "Ajatempel, millest alates loetleda.",
+       "apihelp-query+allrevisions-param-end": "Ajatempel, milleni loetleda.",
+       "apihelp-query+allrevisions-param-user": "Loetle ainult selle kasutaja redaktsioonid.",
+       "apihelp-query+allrevisions-param-excludeuser": "Ära loetle selle kasutaja redaktsioone.",
+       "apihelp-query+allrevisions-param-namespace": "Loetle ainult leheküljed selles nimeruumis.",
+       "apihelp-query+mystashedfiles-param-prop": "Millised atribuudid failide kohta hankida.",
+       "apihelp-query+mystashedfiles-param-limit": "Kui palju faile hankida.",
+       "apihelp-query+alltransclusions-param-from": "Mallina kasutatava lehekülje pealkiri, millest alates loetleda.",
+       "apihelp-query+alltransclusions-param-to": "Mallina kasutatava lehekülje pealkiri, milleni loetleda.",
+       "apihelp-query+alltransclusions-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+alltransclusions-param-namespace": "Loetlemise nimeruum.",
+       "apihelp-query+alltransclusions-param-limit": "Kui palju üksusi kokku tagastada.",
+       "apihelp-query+alltransclusions-param-dir": "Järjestuse suund.",
+       "apihelp-query+allusers-summary": "Loetle kõik registreeritud kasutajad.",
+       "apihelp-query+allusers-param-from": "Kasutajanimi, millest alates loetleda.",
+       "apihelp-query+allusers-param-to": "Kasutajanimi, milleni loetleda.",
+       "apihelp-query+allusers-param-dir": "Järjestuse suund.",
+       "apihelp-query+allusers-param-excludegroup": "Välja arvatud kasutajad, kes on neis rühmades.",
+       "apihelp-query+allusers-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+allusers-param-limit": "Kui palju kasutajanimesid kokku tagastada.",
+       "apihelp-query+allusers-param-witheditsonly": "Loetle ainult kasutajad, kes on teinud muudatusi.",
+       "apihelp-query+backlinks-param-namespace": "Loetlemise nimeruum.",
+       "apihelp-query+backlinks-param-dir": "Järjestuse suund.",
+       "apihelp-query+backlinks-param-limit": "Kui palju lehekülgi kokku tagastada. Kui <var>$1redirect</var> on lubatud, siis rakendub piirang mõlemal tasemel eraldi (see tähendab, et tagastada võidakse kuni 2 × <var>$1limit</var> tulemust).",
+       "apihelp-query+blocks-param-start": "Ajatempel, millest alates loetleda.",
+       "apihelp-query+blocks-param-end": "Ajatempel, milleni loetleda.",
+       "apihelp-query+blocks-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+blocks-param-show": "Näita ainult üksusi, mis vastavad neile kriteeriumitele.\nNäiteks, et näidata ainult IP-aadresside suhtes rakendatud tähtajatuid blokeeringuid, määra <kbd>$1show=ip|!temp</kbd>.",
+       "apihelp-query+categories-param-prop": "Millised lisaatribuudid iga kategooria kohta hankida:",
+       "apihelp-query+categories-param-show": "Milliseid kategooriaid näidata.",
+       "apihelp-query+categories-param-limit": "Kui palju kategooriaid tagastada.",
+       "apihelp-query+categories-param-categories": "Loetle ainult need kategooriad. Kasulik, kui vaja kontrollida, kas teatud lehekülg on teatud kategoorias.",
+       "apihelp-query+categories-param-dir": "Järjestuse suund.",
+       "apihelp-query+categorymembers-param-title": "Loetlemise kategooria (nõutav). Peab sisaldama eesliidet <kbd>{{ns:category}}:</kbd>. Ei saa kasutada parameetriga <var>$1pageid</var>.",
+       "apihelp-query+categorymembers-param-pageid": "Loetlemise kategooria lehekülje identifikaator. Ei saa kasutada parameetriga <var>$1title</var>.",
+       "apihelp-query+categorymembers-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+categorymembers-param-type": "Mis tüüpi liikmed kategooriatest hankida. Eiratakse, kui määratud on <kbd>$1sort=timestamp</kbd>.",
+       "apihelp-query+categorymembers-param-dir": "Järjestuse suund.",
+       "apihelp-query+contributors-param-limit": "Kui palju kaastöölisi tagastada.",
+       "apihelp-query+deletedrevisions-param-start": "Ajatempel, millest alates loetleda. Eiratakse, kui töötlusel on redaktsioonide identifikaatorite loend.",
+       "apihelp-query+deletedrevisions-param-end": "Ajatempel, milleni loetleda. Eiratakse, kui töötlusel on redaktsioonide identifikaatorite loend.",
+       "apihelp-query+deletedrevisions-param-tag": "Loetle ainult redaktsioonid, mille küljes on see märgis.",
+       "apihelp-query+deletedrevisions-param-excludeuser": "Ära loetle selle kasutaja redaktsioone.",
+       "apihelp-query+deletedrevs-param-start": "Ajatempel, millest alates loetleda.",
+       "apihelp-query+deletedrevs-param-end": "Ajatempel, milleni loetleda.",
+       "apihelp-query+deletedrevs-param-tag": "Loetle ainult redaktsioonid, mille küljes on see märgis.",
+       "apihelp-query+deletedrevs-param-excludeuser": "Ära loetle selle kasutaja redaktsioone.",
+       "apihelp-query+deletedrevs-param-namespace": "Loetle ainult leheküljed selles nimeruumis.",
+       "apihelp-query+duplicatefiles-param-limit": "Kui palju duplikaatfaile tagastada.",
+       "apihelp-query+duplicatefiles-param-dir": "Järjestuse suund.",
+       "apihelp-query+embeddedin-param-namespace": "Loetlemise nimeruum.",
+       "apihelp-query+embeddedin-param-dir": "Järjestuse suund.",
+       "apihelp-query+embeddedin-param-limit": "Kui palju lehekülgi kokku tagastada.",
+       "apihelp-query+extlinks-param-limit": "Kui palju linke tagastada.",
+       "apihelp-query+exturlusage-summary": "Loetle leheküljed, mis sisaldavad teatud internetiaadressi.",
+       "apihelp-query+exturlusage-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+exturlusage-param-namespace": "Lehekülgede loetlemise nimeruumid.",
+       "apihelp-query+exturlusage-param-limit": "Kui palju lehekülgi tagastada.",
+       "apihelp-query+filearchive-summary": "Loetle kõik kustutatud failid järjestatult.",
+       "apihelp-query+filearchive-param-from": "Pildi pealkiri, millest alates loetleda.",
+       "apihelp-query+filearchive-param-to": "Pildi pealkiri, milleni loetleda.",
+       "apihelp-query+filearchive-param-limit": "Kui palju pilte kokku tagastada.",
+       "apihelp-query+filearchive-param-dir": "Järjestuse suund.",
+       "apihelp-query+filearchive-param-prop": "Milline pilditeave hankida:",
+       "apihelp-query+fileusage-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+fileusage-param-limit": "Kui palju tagastada.",
+       "apihelp-query+fileusage-param-show": "Näita ainult üksusi, mis vastavad neile kriteeriumitele:\n;redirect:Näita ainult ümbersuunamisi.\n;!redirect:Näita ainult üksusi, mis pole ümbersuunamised.",
        "apihelp-query+imageinfo-summary": "Tagastab failiteabe ja üleslaadimisajaloo.",
        "apihelp-query+imageinfo-param-prop": "Millist teavet faili kohta hankida:",
        "apihelp-query+imageinfo-paramvalue-prop-timestamp": "Lisab üles laaditud versiooni ajatempli.",
        "apihelp-query+imageinfo-param-localonly": "Kaasa päringusse ainult kohaliku hoidla failid.",
        "apihelp-query+imageinfo-example-simple": "Faili [[:File:Albert Einstein Head.jpg|Albert Einstein Head.jpg]] praeguse versiooni teabe väljavõtt.",
        "apihelp-query+imageinfo-example-dated": "Faili [[:File:Test.jpg|Test.jpg]] teabe väljavõtt alates 2008. aasta versioonidest.",
-       "api-help-param-continue": "Kui saadaval on rohkem tulemusi, kasuta seda jätkamiseks."
+       "apihelp-query+images-param-limit": "Kui palju faile tagastada.",
+       "apihelp-query+images-param-images": "Loetle ainult need failid. Kasulik, kui vaja kontrollida, kas teatud leheküljel on teatud fail.",
+       "apihelp-query+images-param-dir": "Järjestuse suund.",
+       "apihelp-query+imageusage-param-namespace": "Loetlemise nimeruum.",
+       "apihelp-query+imageusage-param-dir": "Järjestuse suund.",
+       "apihelp-query+imageusage-param-limit": "Kui palju lehekülgi kokku tagastada. Kui <var>$1redirect</var> on lubatud, siis rakendub piirang mõlemal tasemel eraldi (see tähendab, et tagastada võidakse kuni 2 × <var>$1limit</var> tulemust).",
+       "apihelp-query+info-param-prop": "Millised lisaatribuudid hankida:",
+       "apihelp-query+iwbacklinks-param-limit": "Kui palju lehekülgi kokku tagastada.",
+       "apihelp-query+iwbacklinks-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+iwbacklinks-param-dir": "Järjestuse suund.",
+       "apihelp-query+iwlinks-param-prop": "Millised lisaatribuudid iga intervikilingi kohta hankida:",
+       "apihelp-query+iwlinks-param-limit": "Kui palju intervikilinke tagastada.",
+       "apihelp-query+iwlinks-param-dir": "Järjestuse suund.",
+       "apihelp-query+langbacklinks-param-limit": "Kui palju lehekülgi kokku tagastada.",
+       "apihelp-query+langbacklinks-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+langbacklinks-param-dir": "Järjestuse suund.",
+       "apihelp-query+langlinks-param-limit": "Kui palju keelelinke tagastada.",
+       "apihelp-query+langlinks-param-prop": "Millised lisaatribuudid iga intervikilingi kohta hankida:",
+       "apihelp-query+langlinks-param-dir": "Järjestuse suund.",
+       "apihelp-query+links-param-limit": "Kui palju linke tagastada.",
+       "apihelp-query+links-param-titles": "Loetle ainult lingid, mis viitavad neile pealkirjadele. Kasulik, kui vaja kontrollida, kas teatud lehekülg lingib teatud leheküljele.",
+       "apihelp-query+links-param-dir": "Järjestuse suund.",
+       "apihelp-query+linkshere-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+linkshere-param-limit": "Kui palju tagastada.",
+       "apihelp-query+linkshere-param-show": "Näita ainult üksusi, mis vastavad neile kriteeriumitele:\n;redirect:Näita ainult ümbersuunamisi.\n;!redirect:Näita ainult üksusi, mis pole ümbersuunamised.",
+       "apihelp-query+logevents-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+logevents-param-type": "Loetle ainult seda tüüpi logisündmused.",
+       "apihelp-query+logevents-param-action": "Loetle ainult logisündmused selle toimingu kohta. Kirjutab üle parameetri <var>$1type</var>. Väärtused, milles on võimalike väärtuste loetelus metamärk asterisk (<kbd>toiming/*</kbd>), võib kaldkriipsu (/) järel olla erinev sõne.",
+       "apihelp-query+logevents-param-start": "Ajatempel, millest alates loetleda.",
+       "apihelp-query+logevents-param-end": "Ajatempel, milleni loetleda.",
+       "apihelp-query+logevents-param-user": "Loetle ainult selle kasutaja sissekanded.",
+       "apihelp-query+logevents-param-namespace": "Loetle ainult sissekanded, mis on selles nimeruumis.",
+       "apihelp-query+logevents-param-tag": "Loetle ainult logisündmused, mille küljes on see märgis.",
+       "apihelp-query+logevents-param-limit": "Kui palju logisündmusi kokku tagastada.",
+       "apihelp-query+pagepropnames-example-simple": "Hangi esimese 10 atribuudi nimi.",
+       "apihelp-query+pageprops-param-prop": "Loetle ainult need leheatribuudid (<kbd>[[Special:ApiHelp/query+pagepropnames|action=query&list=pagepropnames]]</kbd> tagastab kasutatavate atribuutide nimed). Kasulik, kui vaja kontrollida, kas leheküljed kasutavad teatud leheatribuuti.",
+       "apihelp-query+pageswithprop-summary": "Loetle kõik leheküljed, mis kasutavad teatud leheatribuuti.",
+       "apihelp-query+pageswithprop-param-propname": "Leheatribuut, mille kohta lehekülgi loetleda (<kbd>[[Special:ApiHelp/query+pagepropnames|action=query&list=pagepropnames]]</kbd> tagastab kasutatavate atribuutide nimed).",
+       "apihelp-query+pageswithprop-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+pageswithprop-paramvalue-prop-value": "Lisab leheatribuudi väärtuse.",
+       "apihelp-query+pageswithprop-param-dir": "Järjestuse suund.",
+       "apihelp-query+protectedtitles-param-namespace": "Loetle ainult pealkirjad nendes nimeruumides.",
+       "apihelp-query+protectedtitles-param-limit": "Kui palju lehekülgi kokku tagastada.",
+       "apihelp-query+protectedtitles-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+random-param-limit": "Kui palju juhuslikke lehekülgi tagastada.",
+       "apihelp-query+recentchanges-summary": "Loetle viimased muudatused.",
+       "apihelp-query+recentchanges-param-start": "Ajatempel, millest alates loetleda.",
+       "apihelp-query+recentchanges-param-end": "Ajatempel, milleni loetleda.",
+       "apihelp-query+recentchanges-param-namespace": "Loetle muudatusi ainult neist nimeruumidest.",
+       "apihelp-query+recentchanges-param-user": "Loetle ainult selle kasutaja muudatused.",
+       "apihelp-query+recentchanges-param-excludeuser": "Ära loetle selle kasutaja muudatusi.",
+       "apihelp-query+recentchanges-param-tag": "Loetle ainult muudatused, mille küljes on see märgis.",
+       "apihelp-query+recentchanges-param-prop": "Hangi teabe lisaelemendid:",
+       "apihelp-query+recentchanges-param-show": "Näita ainult üksusi, mis vastavad neile kriteeriumitele. Näiteks, et näha ainult pisimuudatusi, mille on teinud sisseloginud kasutajad, määra $1show=minor|!anon.",
+       "apihelp-query+recentchanges-param-limit": "Kui palju muudatusi kokku tagastada.",
+       "apihelp-query+recentchanges-param-type": "Mis tüüpi muudatusi näidata.",
+       "apihelp-query+recentchanges-param-toponly": "Loetle ainult muudatused, millele vastab viimane redaktsioon.",
+       "apihelp-query+recentchanges-param-title": "Loetle ainult sissekanded, mis on seotud leheküljega.",
+       "apihelp-query+redirects-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+redirects-param-limit": "Kui palju ümbersuunamisi tagastada.",
+       "apihelp-query+redirects-param-show": "Näita ainult üksusi, mis vastavad neile kriteeriumitele:\n;redirect:Näita ainult fragmendiga ümbersuunamisi.\n;!redirect:Näita ainult ümbersuunamisi, millel pole fragmenti.",
+       "apihelp-query+revisions-param-startid": "Redaktsioon, mille ajatemplist alates loetleda. Redaktsioon peab olemas olema, aga ei pea kuuluma selle lehekülje juurde.",
+       "apihelp-query+revisions-param-endid": "Redaktsioon, mille ajatemplini loetleda. Redaktsioon peab olemas olema, aga ei pea kuuluma selle lehekülje juurde.",
+       "apihelp-query+revisions-param-start": "Redaktsiooni ajatempel, millest alates loetleda.",
+       "apihelp-query+revisions-param-end": "Ajatempel, milleni loetleda.",
+       "apihelp-query+revisions-param-tag": "Loetle ainult redaktsioonid, mille küljes on see märgis.",
+       "apihelp-query+revisions+base-param-prop": "Millised atribuudid iga redaktsiooni kohta hankida:",
+       "apihelp-query+revisions+base-param-limit": "Kui palju redaktsioone tagastada.",
+       "apihelp-query+search-summary": "Soorita täisteksti otsing.",
+       "apihelp-query+search-param-search": "Otsi lehekülgede pealkirju või sisu, mis vastab sellele väärtusele. Saad otsisõnes kasutada neid erifunktsioone, mida otsing selles vikis võimaldab.",
+       "apihelp-query+search-param-namespace": "Otsi ainult neist nimeruumidest.",
+       "apihelp-query+search-param-what": "Mis tüüpi otsing sooritada.",
+       "apihelp-query+search-param-info": "Millised metaandmed tagastada.",
+       "apihelp-query+search-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+search-param-limit": "Kui palju lehekülgi kokku tagastada.",
+       "apihelp-query+siteinfo-param-prop": "Milline teave hankida:",
+       "apihelp-query+tags-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+templates-param-limit": "Kui palju malle tagastada.",
+       "apihelp-query+templates-param-templates": "Loetle ainult need mallid. Kasulik, kui vaja kontrollida, kas teatud lehekülg kasutab teatud malli.",
+       "apihelp-query+templates-param-dir": "Järjestuse suund.",
+       "apihelp-query+transcludedin-param-prop": "Millised atribuudid hankida:",
+       "apihelp-query+transcludedin-param-limit": "Kui palju tagastada.",
+       "apihelp-query+transcludedin-param-show": "Näita ainult üksusi, mis vastavad neile kriteeriumitele:\n;redirect:Näita ainult ümbersuunamisi.\n;!redirect:Näita ainult üksusi, mis pole ümbersuunamised.",
+       "apihelp-query+usercontribs-param-namespace": "Loetle ainult kaastöö nendes nimeruumides.",
+       "apihelp-query+usercontribs-param-prop": "Hangi teabe lisaelemendid:",
+       "apihelp-query+usercontribs-param-show": "Näita ainult üksusi, mis vastavad neile kriteeriumitele. Näiteks ainult muudatused, mis pole pisimuudatused: <kbd>$2show=!minor</kbd>.\n\nKui määratud on <kbd>$2show=patrolled</kbd> või <kbd>$2show=!patrolled</kbd>, siis ei näidata muudatusi, mis on vanemad kui <var>[[mw:Special:MyLanguage/Manual:$wgRCMaxAge|$wgRCMaxAge]]</var> ($1 {{PLURAL:$1|sekund|sekundit}}).",
+       "apihelp-query+usercontribs-param-tag": "Loetle ainult redaktsioonid, mille küljes on see märgis.",
+       "apihelp-query+usercontribs-param-toponly": "Loetle ainult muudatused, millele vastab viimane redaktsioon.",
+       "apihelp-query+userinfo-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+users-param-prop": "Millised teabe elemendid hankida:",
+       "apihelp-query+watchlist-param-start": "Ajatempel, millest alates loetleda.",
+       "apihelp-query+watchlist-param-end": "Ajatempel, milleni loetleda.",
+       "apihelp-query+watchlist-param-namespace": "Loetle ainult muudatused neis nimeruumides.",
+       "apihelp-query+watchlist-param-user": "Loetle ainult selle kasutaja muudatused.",
+       "apihelp-query+watchlist-param-excludeuser": "Ära loetle selle kasutaja muudatusi.",
+       "apihelp-query+watchlist-param-limit": "Kui palju tulemusi päringu kohta kokku tagastada.",
+       "apihelp-query+watchlist-param-prop": "Millised lisaatribuudid hankida:",
+       "apihelp-query+watchlist-param-show": "Näita ainult üksusi, mis vastavad neile kriteeriumitele. Näiteks, et näha ainult pisimuudatusi, mille on teinud sisseloginud kasutajad, määra $1show=minor|!anon.",
+       "apihelp-query+watchlist-param-type": "Mis tüüpi muudatusi näidata:",
+       "apihelp-query+watchlistraw-param-namespace": "Loetle ainult leheküljed nendes nimeruumides.",
+       "apihelp-query+watchlistraw-param-limit": "Kui palju tulemusi päringu kohta kokku tagastada.",
+       "apihelp-query+watchlistraw-param-prop": "Millised lisaatribuudid hankida:",
+       "apihelp-query+watchlistraw-param-show": "Loetle ainult üksused, mis vastavad neile kriteeriumitele.",
+       "apihelp-query+watchlistraw-param-dir": "Järjestuse suund.",
+       "apihelp-query+watchlistraw-param-fromtitle": "Pealkiri (nimeruumi eesliitega), millest alates loetleda.",
+       "apihelp-query+watchlistraw-param-totitle": "Pealkiri (nimeruumi eesliitega), milleni loetleda.",
+       "api-help-main-header": "Põhimoodul.",
+       "api-help-param-limit": "Lubatud pole üle $1.",
+       "api-help-param-limit2": "Lubatud pole üle $1 (robotitele $2).",
+       "api-help-param-direction": "Loetlemise suund:\n;newer:Vanemad enne. Märkus: element $1start peab olema enne elementi $1end.\n;older:Uuemad enne (vaikimisi). Märkus: element $1start peab olema pärast elementi $1end.",
+       "api-help-param-continue": "Kui saadaval on rohkem tulemusi, kasuta seda jätkamiseks.",
+       "apierror-mustbeloggedin": "Pead olema sisse logitud, et $1.",
+       "apierror-timeout": "Server ei vastanud oodatud aja sees."
 }
index b669fcd..e78dfa1 100644 (file)
@@ -48,7 +48,7 @@ class MessageCache {
        /**
         * Process cache of loaded messages that are defined in MediaWiki namespace
         *
-        * @var MapCacheLRU Map of (language code => key => " <MESSAGE>" or "!TOO BIG")
+        * @var MapCacheLRU Map of (language code => key => " <MESSAGE>" or "!TOO BIG" or "!ERROR")
         */
        protected $cache;
 
@@ -535,27 +535,30 @@ class MessageCache {
                }
 
                // Set the text for small software-defined messages in the main cache map
+               $revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
+               $revQuery = $revisionStore->getQueryInfo( [ 'page', 'user' ] );
                $res = $dbr->select(
-                       [ 'page', 'revision', 'text' ],
-                       [ 'page_title', 'page_latest', 'old_id', 'old_text', 'old_flags' ],
+                       $revQuery['tables'],
+                       $revQuery['fields'],
                        array_merge( $conds, [ 'page_len <= ' . intval( $wgMaxMsgCacheEntrySize ) ] ),
                        __METHOD__ . "($code)-small",
                        [],
-                       [
-                               'revision' => [ 'JOIN', 'page_latest=rev_id' ],
-                               'text' => [ 'JOIN', 'rev_text_id=old_id' ],
-                       ]
+                       $revQuery['joins']
                );
                foreach ( $res as $row ) {
                        $name = $this->contLang->lcfirst( $row->page_title );
                        // Include entries/stubs for all keys in $mostused in adaptive mode
                        if ( $wgAdaptiveMessageCache || $this->isMainCacheable( $name, $overridable ) ) {
-                               $text = Revision::getRevisionText( $row );
-                               if ( $text === false ) {
-                                       // Failed to fetch data; possible ES errors?
-                                       // Store a marker to fetch on-demand as a workaround...
-                                       // TODO Use a differnt marker
-                                       $entry = '!TOO BIG';
+                               try {
+                                       $rev = $revisionStore->newRevisionFromRow( $row );
+                                       $content = $rev->getContent( MediaWiki\Revision\SlotRecord::MAIN );
+                                       $text = $this->getMessageTextFromContent( $content );
+                               } catch ( Exception $ex ) {
+                                       $text = false;
+                               }
+
+                               if ( !is_string( $text ) ) {
+                                       $entry = '!ERROR';
                                        wfDebugLog(
                                                'MessageCache',
                                                __METHOD__
@@ -1049,7 +1052,7 @@ class MessageCache {
                if ( $entry !== null ) {
                        // Message page exists as an override of a software messages
                        if ( substr( $entry, 0, 1 ) === ' ' ) {
-                               // The message exists and is not '!TOO BIG'
+                               // The message exists and is not '!TOO BIG' or '!ERROR'
                                return (string)substr( $entry, 1 );
                        } elseif ( $entry === '!NONEXISTENT' ) {
                                // The text might be '-' or missing due to some data loss
index 7f7d77d..2d37eac 100644 (file)
@@ -19,6 +19,7 @@
  *
  * @file
  */
+use MediaWiki\ChangeTags\Taggable;
 
 /**
  * Utility class for creating new RC entries
@@ -65,7 +66,7 @@
  *  we're having to include both rc_comment and rc_comment_text/rc_comment_data
  *  so random crap works right.
  */
-class RecentChange {
+class RecentChange implements Taggable {
        // Constants for the rc_source field.  Extensions may also have
        // their own source constants.
        const SRC_EDIT = 'mw.edit';
@@ -1198,7 +1199,7 @@ class RecentChange {
         *
         * @since 1.28
         *
-        * @param string|array $tags
+        * @param string|string[] $tags
         */
        public function addTags( $tags ) {
                if ( is_string( $tags ) ) {
diff --git a/includes/changetags/Taggable.php b/includes/changetags/Taggable.php
new file mode 100644 (file)
index 0000000..f624555
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Interface that defines how to tag objects
+ *
+ * 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 Change tagging
+ * @author Piotr Miazga
+ * @license GPL-2.0-or-later
+ */
+namespace MediaWiki\ChangeTags;
+
+/**
+ * Interface that defines how to tag objects
+ *
+ * @since 1.33
+ */
+interface Taggable {
+
+       /**
+        * Append tags to the tagged object
+        *
+        * @since 1.33
+        * @param string|string[] $tags Tags to apply
+        */
+       public function addTags( $tags );
+
+}
index 9817c3f..d32617e 100644 (file)
@@ -91,11 +91,7 @@ class DerivativeContext extends ContextSource implements MutableContext {
         * @return Config
         */
        public function getConfig() {
-               if ( !is_null( $this->config ) ) {
-                       return $this->config;
-               } else {
-                       return $this->getContext()->getConfig();
-               }
+               return $this->config ?: $this->getContext()->getConfig();
        }
 
        /**
@@ -111,11 +107,7 @@ class DerivativeContext extends ContextSource implements MutableContext {
         * @return Timing
         */
        public function getTiming() {
-               if ( !is_null( $this->timing ) ) {
-                       return $this->timing;
-               } else {
-                       return $this->getContext()->getTiming();
-               }
+               return $this->timing ?: $this->getContext()->getTiming();
        }
 
        /**
@@ -129,11 +121,7 @@ class DerivativeContext extends ContextSource implements MutableContext {
         * @return WebRequest
         */
        public function getRequest() {
-               if ( !is_null( $this->request ) ) {
-                       return $this->request;
-               } else {
-                       return $this->getContext()->getRequest();
-               }
+               return $this->request ?: $this->getContext()->getRequest();
        }
 
        /**
@@ -147,11 +135,7 @@ class DerivativeContext extends ContextSource implements MutableContext {
         * @return Title|null
         */
        public function getTitle() {
-               if ( !is_null( $this->title ) ) {
-                       return $this->title;
-               } else {
-                       return $this->getContext()->getTitle();
-               }
+               return $this->title ?: $this->getContext()->getTitle();
        }
 
        /**
@@ -165,11 +149,13 @@ class DerivativeContext extends ContextSource implements MutableContext {
        public function canUseWikiPage() {
                if ( $this->wikipage !== null ) {
                        return true;
-               } elseif ( $this->title !== null ) {
+               }
+
+               if ( $this->title !== null ) {
                        return $this->title->canExist();
-               } else {
-                       return $this->getContext()->canUseWikiPage();
                }
+
+               return $this->getContext()->canUseWikiPage();
        }
 
        /**
@@ -190,11 +176,7 @@ class DerivativeContext extends ContextSource implements MutableContext {
         * @return WikiPage
         */
        public function getWikiPage() {
-               if ( !is_null( $this->wikipage ) ) {
-                       return $this->wikipage;
-               } else {
-                       return $this->getContext()->getWikiPage();
-               }
+               return $this->wikipage ?: $this->getContext()->getWikiPage();
        }
 
        /**
@@ -208,11 +190,7 @@ class DerivativeContext extends ContextSource implements MutableContext {
         * @return OutputPage
         */
        public function getOutput() {
-               if ( !is_null( $this->output ) ) {
-                       return $this->output;
-               } else {
-                       return $this->getContext()->getOutput();
-               }
+               return $this->output ?: $this->getContext()->getOutput();
        }
 
        /**
@@ -226,11 +204,7 @@ class DerivativeContext extends ContextSource implements MutableContext {
         * @return User
         */
        public function getUser() {
-               if ( !is_null( $this->user ) ) {
-                       return $this->user;
-               } else {
-                       return $this->getContext()->getUser();
-               }
+               return $this->user ?: $this->getContext()->getUser();
        }
 
        /**
@@ -255,11 +229,7 @@ class DerivativeContext extends ContextSource implements MutableContext {
         * @since 1.19
         */
        public function getLanguage() {
-               if ( !is_null( $this->lang ) ) {
-                       return $this->lang;
-               } else {
-                       return $this->getContext()->getLanguage();
-               }
+               return $this->lang ?: $this->getContext()->getLanguage();
        }
 
        /**
@@ -274,11 +244,7 @@ class DerivativeContext extends ContextSource implements MutableContext {
         * @return Skin
         */
        public function getSkin() {
-               if ( !is_null( $this->skin ) ) {
-                       return $this->skin;
-               } else {
-                       return $this->getContext()->getSkin();
-               }
+               return $this->skin ?: $this->getContext()->getSkin();
        }
 
        /**
index d427724..cdf0f79 100644 (file)
@@ -25,16 +25,16 @@ use Wikimedia\Rdbms\IMaintainableDatabase;
 
 class CloneDatabase {
        /** @var string Table prefix for cloning */
-       private $newTablePrefix = '';
+       private $newTablePrefix;
 
        /** @var string Current table prefix */
-       private $oldTablePrefix = '';
+       private $oldTablePrefix;
 
        /** @var array List of tables to be cloned */
-       private $tablesToClone = [];
+       private $tablesToClone;
 
        /** @var bool Should we DROP tables containing the new names? */
-       private $dropCurrentTables = true;
+       private $dropCurrentTables;
 
        /** @var bool Whether to use temporary tables or not */
        private $useTemporaryTables = true;
@@ -128,7 +128,7 @@ class CloneDatabase {
        }
 
        /**
-        * Change the table prefix on all open DB connections/
+        * Change the table prefix on all open DB connections
         *
         * @param string $prefix
         * @return void
index a051d83..16bde4b 100644 (file)
@@ -116,7 +116,7 @@ class DatabaseOracle extends Database {
                        $this->setFlag( DBO_PERSISTENT );
                }
 
-               $session_mode = $this->flags & DBO_SYSDBA ? OCI_SYSDBA : OCI_DEFAULT;
+               $session_mode = ( $this->flags & DBO_SYSDBA ) ? OCI_SYSDBA : OCI_DEFAULT;
 
                Wikimedia\suppressWarnings();
                if ( $this->flags & DBO_PERSISTENT ) {
index 101a1e2..7a31e26 100644 (file)
@@ -32,7 +32,7 @@ use Wikimedia\ScopedCallback;
  *
  * See docs/deferred.txt
  */
-class LinksUpdate extends DataUpdate {
+class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate {
        // @todo make members protected, but make sure extensions don't break
 
        /** @var int Page ID of the article linked from */
@@ -1187,4 +1187,39 @@ class LinksUpdate extends DataUpdate {
 
                return $this->db;
        }
+
+       public function getAsJobSpecification() {
+               if ( $this->user ) {
+                       $userInfo = [
+                               'userId' => $this->user->getId(),
+                               'userName' => $this->user->getName(),
+                       ];
+               } else {
+                       $userInfo = false;
+               }
+
+               if ( $this->mRevision ) {
+                       $triggeringRevisionId = $this->mRevision->getId();
+               } else {
+                       $triggeringRevisionId = false;
+               }
+
+               return [
+                       'wiki' => WikiMap::getWikiIdFromDbDomain( $this->getDB()->getDomainID() ),
+                       'job'  => new JobSpecification(
+                               'refreshLinksPrioritized',
+                               [
+                                       // Reuse the parser cache if it was saved
+                                       'rootJobTimestamp' => $this->mParserOutput->getCacheTime(),
+                                       'useRecursiveLinksUpdate' => $this->mRecursive,
+                                       'triggeringUser' => $userInfo,
+                                       'triggeringRevisionId' => $triggeringRevisionId,
+                                       'causeAction' => $this->getCauseAction(),
+                                       'causeAgent' => $this->getCauseAgent()
+                               ],
+                               [ 'removeDuplicates' => true ],
+                               $this->getTitle()
+                       )
+               ];
+       }
 }
diff --git a/includes/deferred/RefreshSecondaryDataUpdate.php b/includes/deferred/RefreshSecondaryDataUpdate.php
deleted file mode 100644 (file)
index 8086a70..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-/**
- * Updater for secondary data after a page edit.
- *
- * 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
- */
-
-/**
- * Update object handling the cleanup of secondary data after a page was edited.
- *
- * This makes makes it possible for DeferredUpdates to have retry logic using a single
- * refreshLinks job if any of the bundled updates fail.
- */
-class RefreshSecondaryDataUpdate extends DataUpdate implements EnqueueableDataUpdate {
-       /** @var WikiPage */
-       private $page;
-       /** @var DeferrableUpdate[] */
-       private $updates;
-       /** @var bool */
-       private $recursive;
-       /** @var string */
-       private $cacheTimestamp;
-       /** @var string Database domain ID */
-       private $domain;
-
-       /** @var Revision|null */
-       private $revision;
-       /** @var User|null */
-       private $user;
-
-       /**
-        * @param WikiPage $page Page we are updating
-        * @param DeferrableUpdate[] $updates Updates from DerivedPageDataUpdater::getSecondaryUpdates()
-        * @param array $options Options map (causeAction, causeAgent, recursive)
-        * @param string $cacheTime Result of ParserOutput::getCacheTime() for the source output
-        * @param string $domain The database domain ID of the wiki the update is for
-        */
-       function __construct(
-               WikiPage $page,
-               array $updates,
-               array $options,
-               $cacheTime,
-               $domain
-       ) {
-               parent::__construct();
-
-               $this->page = $page;
-               $this->updates = $updates;
-               $this->causeAction = $options['causeAction'] ?? 'unknown';
-               $this->causeAgent = $options['causeAgent'] ?? 'unknown';
-               $this->recursive = !empty( $options['recursive'] );
-               $this->cacheTimestamp = $cacheTime;
-               $this->domain = $domain;
-       }
-
-       public function doUpdate() {
-               foreach ( $this->updates as $update ) {
-                       $update->doUpdate();
-               }
-       }
-
-       /**
-        * Set the revision corresponding to this LinksUpdate
-        * @param Revision $revision
-        */
-       public function setRevision( Revision $revision ) {
-               $this->revision = $revision;
-       }
-
-       /**
-        * Set the User who triggered this LinksUpdate
-        * @param User $user
-        */
-       public function setTriggeringUser( User $user ) {
-               $this->user = $user;
-       }
-
-       public function getAsJobSpecification() {
-               return [
-                       'wiki' => WikiMap::getWikiIdFromDomain( $this->domain ),
-                       'job'  => new JobSpecification(
-                               'refreshLinksPrioritized',
-                               [
-                                       // Reuse the parser cache if it was saved
-                                       'rootJobTimestamp' => $this->cacheTimestamp,
-                                       'useRecursiveLinksUpdate' => $this->recursive,
-                                       'triggeringUser' => $this->user
-                                               ? [
-                                                       'userId' => $this->user->getId(),
-                                                       'userName' => $this->user->getName()
-                                               ]
-                                               : false,
-                                       'triggeringRevisionId' => $this->revision ? $this->revision->getId() : false,
-                                       'causeAction' => $this->getCauseAction(),
-                                       'causeAgent' => $this->getCauseAgent()
-                               ],
-                               [ 'removeDuplicates' => true ],
-                               $this->page->getTitle()
-                       )
-               ];
-       }
-}
index 52e38a0..fbcf832 100644 (file)
@@ -322,10 +322,7 @@ class WikiExporter {
                }
 
                $revOpts = [ 'page' ];
-               if ( $this->text != self::STUB ) {
-                       // TODO: remove the text and make XmlDumpWriter use a RevisionStore instead! (T198706)
-                       $revOpts[] = 'text';
-               }
+
                $revQuery = Revision::getQueryInfo( $revOpts );
 
                // We want page primary rather than revision
@@ -335,8 +332,12 @@ class WikiExporter {
                        ];
                unset( $join['page'] );
 
-               // TODO: remove rev_text_id and make XmlDumpWriter use a RevisionStore instead! (T198706)
-               $fields = array_merge( $revQuery['fields'], [ 'page_restrictions, rev_text_id' ] );
+               $fields = $revQuery['fields'];
+               $fields[] = 'page_restrictions';
+
+               if ( $this->text != self::STUB ) {
+                       $fields['_load_content'] = '1';
+               }
 
                $conds = [];
                if ( $cond !== '' ) {
index fae8b62..fbc4b0d 100644 (file)
  *
  * @file
  */
-
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Revision\RevisionStore;
+use MediaWiki\Storage\SqlBlobStore;
 
 /**
  * @ingroup Dump
  */
 class XmlDumpWriter {
+
+       /**
+        * Title of the currently processed page
+        *
+        * @var Title|null
+        */
+       private $currentTitle = null;
+
        /**
         * Opens the XML output stream's root "<mediawiki>" element.
         * This does not include an xml directive, so is safe to include
@@ -159,12 +168,13 @@ class XmlDumpWriter {
         */
        public function openPage( $row ) {
                $out = "  <page>\n";
-               $title = Title::makeTitle( $row->page_namespace, $row->page_title );
-               $out .= '    ' . Xml::elementClean( 'title', [], self::canonicalTitle( $title ) ) . "\n";
+               $this->currentTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
+               $canonicalTitle = self::canonicalTitle( $this->currentTitle );
+               $out .= '    ' . Xml::elementClean( 'title', [], $canonicalTitle ) . "\n";
                $out .= '    ' . Xml::element( 'ns', [], strval( $row->page_namespace ) ) . "\n";
                $out .= '    ' . Xml::element( 'id', [], strval( $row->page_id ) ) . "\n";
                if ( $row->page_is_redirect ) {
-                       $page = WikiPage::factory( $title );
+                       $page = WikiPage::factory( $this->currentTitle );
                        $redirect = $page->getRedirectTarget();
                        if ( $redirect instanceof Title && $redirect->isValidRedirectTarget() ) {
                                $out .= '    ';
@@ -178,7 +188,7 @@ class XmlDumpWriter {
                                strval( $row->page_restrictions ) ) . "\n";
                }
 
-               Hooks::run( 'XmlDumpWriterOpenPage', [ $this, &$out, $row, $title ] );
+               Hooks::run( 'XmlDumpWriterOpenPage', [ $this, &$out, $row, $this->currentTitle ] );
 
                return $out;
        }
@@ -193,6 +203,20 @@ class XmlDumpWriter {
                return "  </page>\n";
        }
 
+       /**
+        * @return RevisionStore
+        */
+       private function getRevisionStore() {
+               return MediaWikiServices::getInstance()->getRevisionStore();
+       }
+
+       /**
+        * @return SqlBlobStore
+        */
+       private function getBlobStore() {
+               return MediaWikiServices::getInstance()->getBlobStore();
+       }
+
        /**
         * Dumps a "<revision>" section on the output stream, with
         * data filled in from the given database row.
@@ -228,16 +252,17 @@ class XmlDumpWriter {
                        }
                }
 
+               // TODO: rev_content_model no longer exists with MCR, see T174031
                if ( isset( $row->rev_content_model ) && !is_null( $row->rev_content_model ) ) {
                        $content_model = strval( $row->rev_content_model );
                } else {
                        // probably using $wgContentHandlerUseDB = false;
-                       $title = Title::makeTitle( $row->page_namespace, $row->page_title );
-                       $content_model = ContentHandler::getDefaultModelFor( $title );
+                       $content_model = ContentHandler::getDefaultModelFor( $this->currentTitle );
                }
 
                $content_handler = ContentHandler::getForModelID( $content_model );
 
+               // TODO: rev_content_format no longer exists with MCR, see T174031
                if ( isset( $row->rev_content_format ) && !is_null( $row->rev_content_format ) ) {
                        $content_format = strval( $row->rev_content_format );
                } else {
@@ -258,11 +283,44 @@ class XmlDumpWriter {
                        $out .= "      " . Xml::elementClean( 'text',
                                [ 'xml:space' => 'preserve', 'bytes' => intval( $row->rev_len ) ],
                                strval( $text ) ) . "\n";
-               } else {
-                       // Stub output
+               } elseif ( isset( $row->_load_content ) ) {
+                       // TODO: make this fully MCR aware, see T174031
+                       $rev = $this->getRevisionStore()->newRevisionFromRow( $row, 0, $this->currentTitle );
+                       $slot = $rev->getSlot( 'main' );
+                       $content = $slot->getContent();
+
+                       if ( $content instanceof TextContent ) {
+                               // HACK: For text based models, bypass the serialization step.
+                               // This allows extensions (like Flow)that use incompatible combinations
+                               // of serialization format and content model.
+                               $text = $content->getNativeData();
+                       } else {
+                               $text = $content->serialize( $content_format );
+                       }
+
+                       $text = $content_handler->exportTransform( $text, $content_format );
+                       $out .= "      " . Xml::elementClean( 'text',
+                               [ 'xml:space' => 'preserve', 'bytes' => intval( $slot->getSize() ) ],
+                               strval( $text ) ) . "\n";
+               } elseif ( isset( $row->rev_text_id ) ) {
+                       // Stub output for pre-MCR schema
+                       // TODO: MCR: rev_text_id only exists in the pre-MCR schema. Remove this when
+                       // we drop support for the old schema.
                        $out .= "      " . Xml::element( 'text',
                                [ 'id' => $row->rev_text_id, 'bytes' => intval( $row->rev_len ) ],
                                "" ) . "\n";
+               } else {
+                       // Backwards-compatible stub output for MCR aware schema
+                       // TODO: MCR: emit content addresses instead of text ids, see T174031, T199121
+                       $rev = $this->getRevisionStore()->newRevisionFromRow( $row, 0, $this->currentTitle );
+                       $slot = $rev->getSlot( 'main' );
+
+                       // Note that this is currently the ONLY reason we have a BlobStore here at all.
+                       // When removing this line, check whether the BlobStore has become unused.
+                       $textId = $this->getBlobStore()->getTextIdFromAddress( $slot->getAddress() );
+                       $out .= "      " . Xml::element( 'text',
+                                       [ 'id' => $textId, 'bytes' => intval( $slot->getSize() ) ],
+                                       "" ) . "\n";
                }
 
                if ( isset( $row->rev_sha1 )
index 3102bfb..c7fe405 100644 (file)
                        "درفش کاویانی",
                        "Hamisun",
                        "Alifakoor",
-                       "Seb35"
+                       "Seb35",
+                       "Ahmad252"
                ]
        },
-       "config-desc": "نصب کنندهٔ مدیاویکی",
+       "config-desc": "نصبکنندهٔ مدیاویکی",
        "config-title": "نصب مدیاویکی $1",
        "config-information": "اطلاعات",
        "config-localsettings-upgrade": "یک پرونده <code>LocalSettings.php</code> شناسایی شده‌است.\nبرای ارتقاء این نصب لطفاً مقدار <code>$wgUpgradeKey</code> در جعبه زیر وارد کنید.\nشما می‌توانید آن را در <code>LocalSettings.php</code> پیدا کنید.",
@@ -76,9 +77,9 @@
        "config-wincache": "[https://www.iis.net/downloads/microsoft/wincache-extension WinCache] نصب شده‌است.",
        "config-no-cache-apcu": "<strong>هشدار:</strong> پیوند [https://secure.php.net/apcu APCu] یا [https://www.iis.net/downloads/microsoft/wincache-extension WinCache] یافت نشد. ذخیره شی فعال نیست.",
        "config-mod-security": "'''هشدار:''' وب سرور شما [https://modsecurity.org/ mod_security] فعال است.اگر اشتباه پیکربندی شده‌‌ باشد،می تواند باعث ایجاد مشکلاتی برای مدیاویکی یا دیگر نرم‌افزاری شود که به کاربران اجازه می‌دهد پیام دلخواه ارسال کنند.\nبه [https://modsecurity.org/documentation/ mod_security documentation] مراجعه کنید یا اگر با خطاهای اتفاقی مواجه شدید با پشتیبانی میزبان خود در تماس باشید.",
-       "config-diff3-bad": "جÛ\8câ\80\8cاÙ\86â\80\8cÛ\8cÙ\88 Ø¯Û\8cÙ\81Û³ Ù¾Û\8cدا Ù\86Ø´د.",
+       "config-diff3-bad": "ابزار Ù\85Ù\82اÛ\8cسÙ\87 Ù\85تÙ\86 ØªÙ\81اÙ\88ت۳ Ú¯Ù\86Ù\88 Ù¾Û\8cدا Ù\86شد. Ù\85Û\8câ\80\8cتÙ\88اÙ\86Û\8cد Ù\81عÙ\84اÙ\8b Ø§Û\8cÙ\86 Ù¾Û\8cاÙ\85 Ø±Ø§ Ù\86ادÛ\8cدÙ\87 Ø¨Ú¯Û\8cرÛ\8cدØ\8c Ø§Ù\85ا Ù\85Ù\85Ú©Ù\86 Ø§Ø³Øª Ø¨Ù\87 Ø¯Ù\81عات Ø¨Û\8cشترÛ\8c Ø¯Ú\86ار ØªØ¹Ø§Ø±Ø¶ Ù\88Û\8cراÛ\8cØ´Û\8c Ø´Ù\88Û\8cد.",
        "config-git": "کنترل نسخهٔ نرم‌افزار گیت پیدا شد: <code>$1</code>.",
-       "config-git-bad": "کنترل نسخهٔ نرم‌افزار گیت پیدا نشد.",
+       "config-git-bad": "کنترل نسخهٔ نرم‌افزار گیت پیدا نشد. فعلاً می‌توانید این پیام را نادیده بگیرید. در نظر داشته باشید که ویژه:نسخه، توابع درهم‌سازی‌شده را نمایش نخواهد داد.",
        "config-imagemagick": "ایمیج‌مجیک پیدا شد: <code>$1</code>.\nاگر ارسال‌ها را فعال کنید،تصویر کوچک فعال خواهد‌شد.",
        "config-gd": "گرافیک‌های جی‌دی ساخته‌‌ شده در کتابخانه پیدا شد.\nاگر ارسال‌ها را فعال کنید تصویر کوچک فعال خواهد‌شد.",
        "config-no-scaling": "کتابخانهٔ جی‌دی یا ایمیج‌مجیک نتوانست پیدا شود.\nتصویر کوچک غیر‌فعال خواهد‌شد.",
        "config-using-32bit": "<strong>هشدار:</strong> سیستم شما به‌نظر می‌آید با اعداد صحیح ۳۲ بیت اجرا شده باشد. [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:32-bit توصیه نمی‌شود].",
        "config-db-type": "نوع پایگاه اطلاعات:",
        "config-db-host": "میزبان پایگاه اطلاعات:",
-       "config-db-host-help": "اگر سرور پایگاه اطلاعاتی شما در سرور دیگری است، نام گروه و آدرس آی‌پی را اینجا وارد کنید.\nاگر از گروه شبکهٔ اشتراک گذاری استفاده می‌کنید، تهیه‌کنندهٔ گروه‌تان باید نام گروه صحیح در اسنادومدارک را به شما بدهد.\nاگر در حال نصب یک سرور ویندوز هستید و از مای‌اس‌کیو‌ال استفاده می‌کنید، ممکن است استفاده از \"گروه داخلی\" برای نام سرور کار نکند.اگر کار نکرد، \"۱۲۷.۰.۰.۱\" را برای آدرس آی‌پی داخلی امتحان کنید.\nاگر از پستگِرِاس‌کیوال استفاده می‌کنید،برای اتصال از طریق یک سوکت یونیکس این زمینه را خالی رها کنید.",
+       "config-db-host-help": "اگر سرور پایگاه اطلاعاتی شما در سرور دیگری است، نام گروه و آدرس آی‌پی را اینجا وارد کنید.\nاگر از میزبان شبکهٔ به اشتراک گذاشته‌شده استفاده می‌کنید، تهیه‌کنندهٔ خدمات میزبانی شما باید نام میزبان صحیح در اسناد و مدارک را به شما بدهد.\nاگر از مای‌اس‌کیو‌ال استفاده می‌کنید، ممکن است استفاده از «میزبان‌محلی» برای نام سرور کار نکند.اگر کار نکرد، «۱۲۷.۰.۰.۱» را برای آدرس آی‌پی محلی امتحان کنید.\nاگر از پستگرس‌کیوال استفاده می‌کنید، برای اتصال از طریق یک سوکت یونیکس این قسمت را خالی رها کنید.",
        "config-db-host-oracle": "پایگاه اطلاعاتی تی‌ان‌اس:",
        "config-db-host-oracle-help": "یک [http://download.oracle.com/docs/cd/B28359_01/network.111/b28317/tnsnames.htm Local Connect Name] معتبر وارد کنید؛ پوشهٔ tnsnames.ora باید برای این نصب نمایان باشد.<br /> اگر از کتابخانه‌های پردازشگر ۱۰جی یا جدیدتر استفاده می‌کنید،همچنین می‌توانید از روش نامبردهٔ [http://download.oracle.com/docs/cd/E11882_01/network.112/e10836/naming.htm Easy Connect] استفاده کنید.",
        "config-db-wiki-settings": "این ویکی را شناسایی کنید.",
-       "config-db-name": "Ù\86اÙ\85 Ù¾Ø§Û\8cگاÙ\87 Ø§Ø·Ù\84اعاتÛ\8c:",
+       "config-db-name": "Ù\86اÙ\85 Ù¾Ø§Û\8cگاÙ\87 Ø¯Ø§Ø¯Ù\87 (بدÙ\88Ù\86 Ø®Ø· Ù¾Û\8cÙ\88Ù\86د):",
        "config-db-name-help": "نامی را انتخاب کنید که ویکی شما را شناسایی کند.\nنباید شامل فاصله باشد.\nاگر از گروه شبکهٔ اشتراک‌گذاری استفاده می‌کنید، تهیه‌کنندهٔ گروهتان یا باید به شما نام یک پایگاه اطلاعاتی مشخص برای استفاده بدهد یا برای ایجاد پایگاه‌های اطلاعاتی از طریق یک کنترل پنل به شما اجازه بدهد.",
        "config-db-name-oracle": "طرح کلی پایگاه اطلاعاتی:",
        "config-db-account-oracle-warn": "برای نصب برنامهٔ اوراکل به عنوان پایگاه اطلاعاتی در بخش گذشته،سه سناریو پشتیبانی شده است:\nاگر مایل به ایجاد حساب پایگاه اطلاعاتی به عنوان بخشی از روند نصب هستید، لطفاً یک حساب با نقش اس‌وای‌اس‌دی‌بی‌ای به عنوان حساب پایگاه اطلاعاتی برای نصب تهیه کنید و اعتبارنامه‌های مطلوبی را برای حساب دردسترس شبکه تعیین کنید، به عبارتی دیگر یا می‌توانید حساب دردسترس شبکه را به طور دستی ایجاد کنید و تنها آن حساب را تهیه کنید (اگر مستلزم مجوزهایی برای ایجاد موضوعات طرح کلی باشد) یا دو حساب دیگر تهیه کنید،یکی با ایجاد مزایا و یک حساب محدود برای دسترسی شبکه.\nمتنی برای ایجاد یک حساب با مزایای لازم بنویسید که می‌تواند در فهرست\"نگهداری/برنامهٔ اوراکل\" این نصب یافت شود. به یاد داشته باشید که استفاده از یک حساب محدود،همهٔ قابلیت‌های نگهداری با حساب پیش‌فرض را غیرفعال خواهد کرد.",
        "config-db-account-lock": "در طی عملیات عادی از نام کاربری و رمز عبور یکسان استفاده کنید",
        "config-db-wiki-account": "حساب کاربری برای عملیات عادی",
        "config-db-wiki-help": "نام کاربری و رمز عبوری را وارد کنید که برای اتصال به پایگاه اطلاعاتی در طی عملیات عادی ویکی استفاده خواهید‌کرد.\nاگر حساب وجود ندارد، و نصب حساب مزایای کافی را داراست، این حساب کاربر با حداقل مزایای مورد نیاز برای عمل کردن ویکی به‌وجود خواهد‌آمد.",
-       "config-db-prefix": "جدÙ\88Ù\84 Ù¾Û\8cØ´Ù\88Ù\86د Ù¾Ø§Û\8cگاÙ\87 Ø§Ø·Ù\84اعاتÛ\8c",
+       "config-db-prefix": "جدÙ\88Ù\84 Ù¾Û\8cØ´Ù\88Ù\86د Ù¾Ø§Û\8cگاÙ\87 Ø¯Ø§Ø¯Ù\87 (بدÙ\88Ù\86 Ø®Ø· Ù¾Û\8cÙ\88Ù\86د):",
        "config-db-prefix-help": "اگر نیاز دارید یک اطلاعات پایگاهی را بین چندین ویکی یا بین مدیاویکی و برنامهٔ کاربردی وب دیگری به اشتراک بگذارید،مجاز به انتخاب برای اضافه کردن یک پیشوند به همهٔ  نام‌های جدول برای جلوگیری از اختلاف‌ها هستید.\nاز فاصله‌ها استفاده نکنید.\nاغلب این زمینه خالی مانده‌است.",
        "config-mysql-old": "مای‌اس‌کیو‌ال نسخهٔ $1 و یا بالاتر نیاز است، شما نسخهٔ $2 را دارید.",
        "config-db-port": "درگاه پایگاه‌داده:",
-       "config-db-schema": "طرح کلی برای مدیاویکی:",
+       "config-db-schema": "طرح کلی برای مدیاویکی (بدون خط پیوند):",
        "config-db-schema-help": "طرح کلی اغلب بی‌نقص خواهد بود.\nاگر می‌دانید نیاز دارید که تغییرش دهید،آن را تغییر دهید.",
        "config-pg-test-error": "نمی‌توان به پایگاه اطلاعاتی '''$1''' وصل شد: $2",
        "config-sqlite-dir": "فهرست اطلاعات اس‌کیو‌لایت:",
        "config-invalid-db-server-oracle": "تی‌ان‌اس پایگاه اطلاعاتی $1 نامعتبر.\nیا از \"نام تی‌ان‌اس\" یا یک سلسله \"ارتباط آسان\" ([http://docs.oracle.com/cd/E11882_01/network.112/e10836/naming.htm Oracle Naming Methods]) استفاده کنید.",
        "config-invalid-db-name": "نام پایگاه اطلاعاتی نامعتبر \"$1\".\nفقط حروف اِی‌اس‌سی‌آی‌آی بزرگ (اِی-زدکوچک،اِی-زد بزرگ)،اعداد (۰-۹)،آندرلاین (_) و خط تیره کوتاه (-) استفاده کنید.",
        "config-invalid-db-prefix": "پیشوند پایگاه اطلاعاتی نامعتبر \"$1\".\nفقط حروف اِی‌اس‌سی‌آی‌آی بزرگ (اِی-زدکوچک،اِی-زد بزرگ)،اعداد (۰-۹)،آندرلاین (_) و خط تیره کوتاه (-) استفاده کنید.",
-       "config-connection-error": "$1.\n\nمیزبان، نام کاربری و گذرواژه را بررسی کنید و دوباره امتحان کنید.",
+       "config-connection-error": "$1.\n\nمیزبان، نام کاربری و گذرواژه را بررسی کرده و دوباره امتحان کنید. اگر از «میزبان محلی» به عنوان میزبان پایگاه داده استفاده می‌کنید، استفاده از «۱۲۷.۰.۰.۱» را امتحان کنید (یا برعکس).",
        "config-invalid-schema": "طرح‌کلی برای مدیاویکی نامعتبر \"$1\".\nفقط حروف اِی‌اس‌سی‌آی‌آی بزرگ (اِی-زدکوچک،اِی-زد بزرگ)،اعداد (۰-۹)،آندرلاین (_) و خط تیره کوتاه (-) استفاده کنید.",
        "config-db-sys-create-oracle": "نصب‌کننده تنها از استفادهٔ یک حساب اس‌وای‌اس‌دی‌بی‌اِی برای ایجاد یک حساب جدید حمایت می‌کند.",
        "config-db-sys-user-exists-oracle": "حساب کاربری \"$1\" در‌حال‌حاضر وجود دارد.تنها اس‌وای‌اس‌دی‌بی‌اِی می‌تواند برای ایجاد یک حساب جدید استفاده شود!",
        "config-sqlite-cant-create-db": "پوشه‌ٔ پایگاه اطلا‌عاتی <code>$1</code>نتوانست ایجاد شود.",
        "config-sqlite-fts3-downgrade": "پی‌اچ‌پی، پشتیبانی اف‌تی‌اس۳ کار نمی‌کند، کاهش جدول‌ها",
        "config-can-upgrade": "جدول‌های مدیاویکی در این پایگاه اطلاعاتی وجود دارند.\nبرای ارتقاء دادن آنها به مدیاویکی $1، '''ادامه''' را کلیک کنید.",
+       "config-upgrade-error": "در به‌روزرسانی جدول‌های مدیاویکی در پایگاه داده شما خطایی پیش آمد.\n\nبرای اطلاعات بیشتر به سیاهۀ بالا نگاه کنید. برای تلاش دوباره، روی <strong>ادامه</strong> کلیک کنید.",
        "config-upgrade-done": "تکمیل ارتقاء.\nاکنون شما می‌توانید [$1 start using your wiki].\nاگر می‌خواهید پوشهٔ <code>LocalSettings.php</code> را احیا کنید،دکمهٔ زیر را کلیک کنید.\nاین ''' توصیه نمی‌شود ''' مگر اینکه با ویکی خود مشکل داشته باشید.",
        "config-upgrade-done-no-regenerate": "ارتقاء کامل شد.\nاکنون شما می‌توانید [$1 start using your wiki].",
        "config-regenerate": "بازسازی LocalSettings.php ←",
        "config-install-mainpage-failed": "قادر به درج صفحهٔ اصلی نمی‌باشد:$1",
        "config-install-done": "'''تبریک!'''\nبا موفقیت مدیاویکی را نصب کردید.\nبرنامه نصب‌کننده پرونده <code>LocalSettings.php</code> را درست کرد.\nکه شامل تمام تنظیمات می‌باشد.\n\nشما نیاز به دریافت آن دارید و آن را در پایهٔ نصب ویکی قرار دهید (همان پوشهٔ index.php). دریافت باید به صورت خودکار شروع شده‌باشد.\n\nاگر دریافت شروع نشد یا اگر آن را لغو کردید با کلیک روی پیوند زیر می‌توانید آن را دریافت کنید:\n\n$3\n\n'''توجه داشته باشید:''' اگر این را الآن انجام ندهید، این پرونده تولیدشده در صورتی که نصب را بدون دریافت آن تمام کردید بعداً در اختیار شما قرار نخواهد گرفت.\n\nوقتی انجام شد شما می‌توانید '''[$2 وارد ویکی شوید]'''.",
        "config-install-done-path": "<strong>تبریک!</strong>\nمدیاویکی با موفقیت نصب گردید.\nبرنامه نصب‌کننده یک پرونده <code>LocalSettings.php</code> ایجاد کرده است که شامل تمام تنظیمات می‌باشد.\n\nلازم است شما آن را دریافت کرده و در <code>$4</code> قرار دهید. اِن دریافت می باِست به صورت خودکار شروع شده‌باشد.\n\nاگر دریافت شروع نشده بود و یا آن را لغو کرده اید با کلیک روی پیوند زیر می‌توانید آن را دریافت کنید:\n\n$3\n\n<strong>توجه:</strong> اگر این کار را هم اکنون انجام ندهید و بدون دریافت آن از برنامه نصب خارج شويد، این پرونده تنظیمات تولیدشده در آینده در اختیار شما قرار نخواهد داشت.\n\nوقتی که آن کار را انجام داديد، می‌توانید <strong>[$2 وارد ويکی خودتان شويد]</strong>.",
-       "config-install-success": "Ù\85دÛ\8cاÙ\88Û\8cÚ©Û\8c Ø¨Ù\87 ØµÙ\88رت Ù\85Ù\88Ù\81Ù\82Û\8cتâ\80\8cØ¢Ù\85Û\8cز Ù\86صب Ø´Ø¯. Ø´Ù\85ا Ù\85Û\8câ\80\8cتÙ\88اÙ\86Û\8cد\nاز <$1$2> Ø¨Ø±Ø§Û\8c Ø¯Û\8cدÙ\86 Ù\88Û\8cÚ©Û\8câ\80\8cتاÙ\86 Ø¨Ø§Ø²Ø¯Û\8cد Ú©Ù\86Û\8cد.\nاگر Ù¾Ø±Ø³Ø´Û\8c Ø¯Ø§Ø´ØªÛ\8cدØ\8c Ù\81Ù\87رست Ø³Ù\88اÙ\84â\80\8cÙ\87اÛ\8c Ù\85تداÙ\88Ù\84 Ù\85ا Ø±Ø§ Ù\85طاÙ\84عÙ\87 Ú©Ù\86Û\8cد:\n<https://www.mediawiki.org/wiki/Manual:FAQ> Û\8cا Ø§Ø² Û\8cÚ©Û\8c Ø§Ø² Ø§Ù\86جÙ\85Ù\86â\80\8cÙ\87اÛ\8c Ù¾Ø´Û\8cباÙ\86Û\8c Ù\85ا که در آن صفحه فهرست شده‌اند استفاده کنید.",
+       "config-install-success": "Ù\86صب Ù\85دÛ\8cاÙ\88Û\8cÚ©Û\8c Ù\85Ù\88Ù\81Ù\82 Ø¨Ù\88د. Ø´Ù\85ا Ù\85Û\8câ\80\8cتÙ\88اÙ\86Û\8cد Ø¨Ø±Ø§Û\8c Ø¯Û\8cدÙ\86 Ù\88Û\8cÚ©Û\8câ\80\8cتاÙ\86 Ø§Ø² <$1$2> Ø¨Ø§Ø²Ø¯Û\8cد Ú©Ù\86Û\8cد.\nاگر Ù¾Ø±Ø³Ø´Û\8c Ø¯Ø§Ø´ØªÛ\8cدØ\8c Ù\81Ù\87رست Ù¾Ø±Ø³Ø´â\80\8cÙ\87اÛ\8c Ù\85تداÙ\88Ù\84 Ù\85ا Ø±Ø§ Ù\85طاÙ\84عÙ\87 Ú©Ù\86Û\8cد:\n<https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ> Û\8cا Ø§Ø² Û\8cÚ©Û\8c Ø§Ø² Ø§Ù\86جÙ\85Ù\86â\80\8cÙ\87اÛ\8c Ù¾Ø´Û\8cباÙ\86Û\8c که در آن صفحه فهرست شده‌اند استفاده کنید.",
        "config-download-localsettings": "دریافت <code>LocalSettings.php</code>",
        "config-help": "راهنما",
        "config-help-tooltip": "برای گسترش کلیک کنید",
        "config-nofile": "پروندهٔ «$1» یافت نشد. آیا حذف شده‌است؟",
-       "config-extension-link": "آیا می‌دانستید که ویکی شما [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Extensions extensions] را پشتیبانی می‌کند؟\nشما می‌توانید [https://www.mediawiki.org/wiki/Special:MyLanguage/Category:Extensions_by_category extensions by category]",
+       "config-extension-link": "آیا می‌دانستید که ویکی شما از [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Extensions extensions] پشتیبانی می‌کند؟\nمی‌توانید [https://www.mediawiki.org/wiki/Special:MyLanguage/Category:Extensions_by_category extensions by category] را مرور کنید.",
        "config-skins-screenshots": "$1 (تصاویر: $2)",
        "config-extensions-requires": "$1 (نیازمند $2)",
        "config-screenshot": "تصویر",
+       "config-extension-not-found": "پرونده ثبت افزونه «$1» پیدا نشد.",
+       "config-extension-dependency": "خطای وابسته در حین نصب افزونه «$1» رخ داد: $2",
        "mainpagetext": "'''مدیاویکی با موفقیت نصب شد.'''",
        "mainpagedocfooter": "از [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents راهنمای کاربری]\nبرای اطلاعات بیشتر در مورد به‌کارگیری نرم‌افزار ویکی استفاده کنید.\n\n== آغاز به کار ==\n\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings فهرست تنظیمات پیکربندی]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ پرسش‌های متداول مدیاویکی]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce فهرست ایمیلی نسخه‌های مدیاویکی]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources محلی‌سازی مدیاویکی به زبان شما]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam یادگیری روش‌های مقابله با هرزنگاری در ویکی]"
 }
index 94c1351..b71580a 100644 (file)
 use MediaWiki\MediaWikiServices;
 
 /**
- * Job for clearing all of the "last viewed" timestamps for a user's watchlist
+ * Job for clearing all of the "last viewed" timestamps for a user's watchlist, or setting them all
+ * to the same value.
  *
  * Job parameters include:
  *   - userId: affected user ID [required]
  *   - casTime: UNIX timestamp of the event that triggered this job [required]
+ *   - timestamp: value to set all of the "last viewed" timestamps to [optional, defaults to null]
  *
  * @ingroup JobQueue
  * @since 1.31
@@ -38,7 +40,7 @@ class ClearWatchlistNotificationsJob extends Job {
                static $required = [ 'userId', 'casTime' ];
                $missing = implode( ', ', array_diff( $required, array_keys( $this->params ) ) );
                if ( $missing != '' ) {
-                       throw new InvalidArgumentException( "Missing paramter(s) $missing" );
+                       throw new InvalidArgumentException( "Missing parameter(s) $missing" );
                }
 
                $this->removeDuplicates = true;
@@ -51,29 +53,48 @@ class ClearWatchlistNotificationsJob extends Job {
 
                $dbw = $lbFactory->getMainLB()->getConnection( DB_MASTER );
                $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
+               $timestamp = $this->params['timestamp'] ?? null;
+               if ( $timestamp === null ) {
+                       $timestampCond = 'wl_notificationtimestamp IS NOT NULL';
+               } else {
+                       $timestamp = $dbw->timestamp( $timestamp );
+                       $timestampCond = 'wl_notificationtimestamp != ' . $dbw->addQuotes( $timestamp ) .
+                               ' OR wl_notificationtimestamp IS NULL';
+               }
+               // New notifications since the reset should not be cleared
+               $casTimeCond = 'wl_notificationtimestamp < ' .
+                       $dbw->addQuotes( $dbw->timestamp( $this->params['casTime'] ) ) .
+                       ' OR wl_notificationtimestamp IS NULL';
 
-               $asOfTimes = array_unique( $dbw->selectFieldValues(
-                       'watchlist',
-                       'wl_notificationtimestamp',
-                       [ 'wl_user' => $this->params['userId'], 'wl_notificationtimestamp IS NOT NULL' ],
-                       __METHOD__,
-                       [ 'ORDER BY' => 'wl_notificationtimestamp DESC' ]
-               ) );
-
-               foreach ( array_chunk( $asOfTimes, $rowsPerQuery ) as $asOfTimeBatch ) {
-                       $dbw->update(
+               $firstBatch = true;
+               do {
+                       $idsToUpdate = $dbw->selectFieldValues(
                                'watchlist',
-                               [ 'wl_notificationtimestamp' => null ],
+                               'wl_id',
                                [
                                        'wl_user' => $this->params['userId'],
-                                       'wl_notificationtimestamp' => $asOfTimeBatch,
-                                       // New notifications since the reset should not be cleared
-                                       'wl_notificationtimestamp < ' .
-                                               $dbw->addQuotes( $dbw->timestamp( $this->params['casTime'] ) )
+                                       $timestampCond,
+                                       $casTimeCond,
                                ],
-                               __METHOD__
+                               __METHOD__,
+                               [ 'LIMIT' => $rowsPerQuery ]
                        );
-                       $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
-               }
+                       if ( $idsToUpdate ) {
+                               $dbw->update(
+                                       'watchlist',
+                                       [ 'wl_notificationtimestamp' => $timestamp ],
+                                       [
+                                               'wl_id' => $idsToUpdate,
+                                               // For paranoia, enforce the CAS time condition here too
+                                               $casTimeCond
+                                       ],
+                                       __METHOD__
+                               );
+                               if ( !$firstBatch ) {
+                                       $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
+                               }
+                               $firstBatch = false;
+                       }
+               } while ( $idsToUpdate );
        }
 }
index c439f9b..e2b0212 100644 (file)
@@ -139,7 +139,7 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
        /**
         * Get an item with the given key, regenerating and setting it if not found
         *
-        * If the callback returns false, then nothing is stored.
+        * Nothing is stored nor deleted if the callback returns false
         *
         * @param string $key
         * @param int $ttl Time-to-live (seconds)
@@ -176,7 +176,7 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
         * @param string $key
         * @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
         * @param int|null $oldFlags [unused]
-        * @return mixed Returns false on failure and if the item does not exist
+        * @return mixed Returns false on failure or if the item does not exist
         */
        public function get( $key, $flags = 0, $oldFlags = null ) {
                // B/C for ( $key, &$casToken = null, $flags = 0 )
@@ -223,7 +223,7 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
        /**
         * @param string $key
         * @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
-        * @return mixed Returns false on failure and if the item does not exist
+        * @return mixed Returns false on failure or if the item does not exist
         */
        abstract protected function doGet( $key, $flags = 0 );
 
@@ -233,7 +233,7 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
         * @param string $key
         * @param mixed &$casToken
         * @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
-        * @return mixed Returns false on failure and if the item does not exist
+        * @return mixed Returns false on failure or if the item does not exist
         * @throws Exception
         */
        protected function getWithToken( $key, &$casToken, $flags = 0 ) {
@@ -267,7 +267,7 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
         * (which will be false if not present), and takes the arguments:
         * (this BagOStuff, cache key, current value, TTL).
         * The TTL parameter is reference set to $exptime. It can be overriden in the callback.
-        * If the callback returns false, then the current value will be unchanged (including TTL).
+        * Nothing is stored nor deleted if the callback returns false.
         *
         * @param string $key
         * @param callable $callback Callback method to be executed
@@ -422,18 +422,32 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
        }
 
        /**
-        * Reset the TTL on a key if it exists
+        * Change the expiration on a key if it exists
+        *
+        * If an expiry in the past is given then the key will immediately be expired
         *
         * @param string $key
-        * @param int $expiry
+        * @param int $expiry TTL or UNIX timestamp
         * @param int $flags Bitfield of BagOStuff::WRITE_* constants (since 1.33)
-        * @return bool Success Returns false if there is no key
+        * @return bool Success Returns false on failure or if the item does not exist
         * @since 1.28
         */
        public function changeTTL( $key, $expiry = 0, $flags = 0 ) {
-               $value = $this->get( $key );
+               $found = false;
+
+               $ok = $this->merge(
+                       $key,
+                       function ( $cache, $ttl, $currentValue ) use ( &$found ) {
+                               $found = ( $currentValue !== false );
 
-               return ( $value === false ) ? false : $this->set( $key, $value, $expiry, $flags );
+                               return $currentValue; // nothing is written if this is false
+                       },
+                       $expiry,
+                       1, // 1 attempt
+                       $flags
+               );
+
+               return ( $ok && $found );
        }
 
        /**
@@ -636,29 +650,15 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
        /**
         * Increase stored value of $key by $value while preserving its TTL
         * @param string $key Key to increase
-        * @param int $value Value to add to $key (Default 1)
+        * @param int $value Value to add to $key (default: 1) [optional]
         * @return int|bool New value or false on failure
         */
-       public function incr( $key, $value = 1 ) {
-               if ( !$this->lock( $key, 1 ) ) {
-                       return false;
-               }
-               $n = $this->get( $key, self::READ_LATEST );
-               if ( $this->isInteger( $n ) ) { // key exists?
-                       $n += intval( $value );
-                       $this->set( $key, max( 0, $n ) ); // exptime?
-               } else {
-                       $n = false;
-               }
-               $this->unlock( $key );
-
-               return $n;
-       }
+       abstract public function incr( $key, $value = 1 );
 
        /**
         * Decrease stored value of $key by $value while preserving its TTL
         * @param string $key
-        * @param int $value
+        * @param int $value Value to subtract from $key (default: 1) [optional]
         * @return int|bool New value or false on failure
         */
        public function decr( $key, $value = 1 ) {
index 95b12b4..95dda71 100644 (file)
@@ -109,6 +109,13 @@ class CachedBagOStuff extends HashBagOStuff {
                return false; // key already set
        }
 
+       public function incr( $key, $value = 1 ) {
+               $n = $this->backend->incr( $key, $value );
+               parent::delete( $key );
+
+               return $n;
+       }
+
        public function lock( $key, $timeout = 6, $expiry = 6, $rclass = '' ) {
                return $this->backend->lock( $key, $timeout, $expiry, $rclass );
        }
index 9300dc2..e0f4364 100644 (file)
@@ -43,6 +43,10 @@ class EmptyBagOStuff extends BagOStuff {
                return true;
        }
 
+       public function incr( $key, $value = 1 ) {
+               return false;
+       }
+
        public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
                return true; // faster
        }
index f88f567..4793ce0 100644 (file)
@@ -120,6 +120,18 @@ class HashBagOStuff extends BagOStuff {
                return true;
        }
 
+       public function incr( $key, $value = 1 ) {
+               $n = $this->get( $key );
+               if ( $this->isInteger( $n ) ) {
+                       $n = max( $n + intval( $value ), 0 );
+                       $this->bag[$key][self::KEY_VAL] = $n;
+
+                       return $n;
+               }
+
+               return false;
+       }
+
        public function clear() {
                $this->bag = [];
        }
index 06e90a0..5453862 100644 (file)
@@ -79,6 +79,18 @@ class MemcachedBagOStuff extends BagOStuff {
                        $this->fixExpiry( $exptime ) );
        }
 
+       public function incr( $key, $value = 1 ) {
+               $n = $this->client->incr( $this->validateKeyEncoding( $key ), $value );
+
+               return ( $n !== false && $n !== null ) ? $n : false;
+       }
+
+       public function decr( $key, $value = 1 ) {
+               $n = $this->client->decr( $this->validateKeyEncoding( $key ), $value );
+
+               return ( $n !== false && $n !== null ) ? $n : false;
+       }
+
        public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) {
                return $this->mergeViaCas( $key, $callback, $exptime, $attempts );
        }
index 3ff390b..8f190c3 100644 (file)
@@ -58,16 +58,4 @@ class MemcachedPhpBagOStuff extends MemcachedBagOStuff {
 
                return $this->client->get_multi( $keys );
        }
-
-       public function incr( $key, $value = 1 ) {
-               $this->validateKeyEncoding( $key );
-
-               return $this->client->incr( $key, $value ) ?? false;
-       }
-
-       public function decr( $key, $value = 1 ) {
-               $this->validateKeyEncoding( $key );
-
-               return $this->client->decr( $key, $value ) ?? false;
-       }
 }
index 135556a..c127ec6 100644 (file)
@@ -126,6 +126,7 @@ class RESTBagOStuff extends BagOStuff {
 
        public function set( $key, $value, $exptime = 0, $flags = 0 ) {
                // @TODO: respect WRITE_SYNC (e.g. EACH_QUORUM)
+               // @TODO: respect $exptime
                $req = [
                        'method' => 'PUT',
                        'url' => $this->url . rawurlencode( $key ),
@@ -139,6 +140,7 @@ class RESTBagOStuff extends BagOStuff {
        }
 
        public function add( $key, $value, $exptime = 0, $flags = 0 ) {
+               // @TODO: make this atomic
                if ( $this->get( $key ) === false ) {
                        return $this->set( $key, $value, $exptime, $flags );
                }
@@ -158,4 +160,16 @@ class RESTBagOStuff extends BagOStuff {
                }
                return $this->handleError( "Failed to delete $key", $rcode, $rerr );
        }
+
+       public function incr( $key, $value = 1 ) {
+               // @TODO: make this atomic
+               $n = $this->get( $key, self::READ_LATEST );
+               if ( $this->isInteger( $n ) ) { // key exists?
+                       $n = max( $n + intval( $value ), 0 );
+                       // @TODO: respect $exptime
+                       return $this->set( $key, $n ) ? $n : false;
+               }
+
+               return false;
+       }
 }
index 7fbd34d..1a406cf 100644 (file)
@@ -1407,7 +1407,7 @@ abstract class DatabaseMysqlBase extends Database {
                }
 
                // See https://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html
-               return in_array( $errno, [ 1022, 1216, 1217, 1137 ], true );
+               return in_array( $errno, [ 1022, 1216, 1217, 1137, 1146, 1051, 1054 ], true );
        }
 
        /**
index 7049df5..f2bc01d 100644 (file)
@@ -216,6 +216,11 @@ class DatabaseSqlite extends Database {
                        # Enforce LIKE to be case sensitive, just like MySQL
                        $this->query( 'PRAGMA case_sensitive_like = 1' );
 
+                       $sync = $this->sessionVars['synchronous'] ?? null;
+                       if ( in_array( $sync, [ 'EXTRA', 'FULL', 'NORMAL' ], true ) ) {
+                               $this->query( "PRAGMA synchronous = $sync" );
+                       }
+
                        return $this->conn;
                }
 
index 3401541..6f58cc6 100644 (file)
@@ -583,7 +583,7 @@ interface IDatabase {
         * @param string|array $options The query options. See IDatabase::select() for details.
         * @param string|array $join_conds The query join conditions. See IDatabase::select() for details.
         *
-        * @return array The values from the field
+        * @return array The values from the field in the order they were returned from the DB
         * @throws DBError
         * @since 1.25
         */
index a154f64..33dd69b 100644 (file)
  * @since 1.19
  */
 
+use MediaWiki\ChangeTags\Taggable;
 use MediaWiki\Linker\LinkTarget;
 use MediaWiki\User\UserIdentity;
 use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Assert\Assert;
 
 /**
  * Interface for log entries. Every log entry has these methods.
@@ -436,7 +438,7 @@ class RCDatabaseLogEntry extends DatabaseLogEntry {
  *
  * @since 1.19
  */
-class ManualLogEntry extends LogEntryBase {
+class ManualLogEntry extends LogEntryBase implements Taggable {
        /** @var string Type of log entry */
        protected $type;
 
@@ -586,14 +588,30 @@ class ManualLogEntry extends LogEntryBase {
         *
         * @since 1.27
         * @param string|string[]|null $tags
+        * @deprecated since 1.33 Please use addTags() instead
         */
        public function setTags( $tags ) {
-               if ( $tags === null ) {
-                       $tags = [];
-               } elseif ( is_string( $tags ) ) {
+               if ( $this->tags ) {
+                       wfDebug( 'Overwriting existing ManualLogEntry tags' );
+               }
+               $this->tags = [];
+               if ( $tags !== null ) {
+                       $this->addTags( $tags );
+               }
+       }
+
+       /**
+        * Add change tags for the log entry
+        *
+        * @since 1.33
+        * @param string|string[] $tags Tags to apply
+        */
+       public function addTags( $tags ) {
+               if ( is_string( $tags ) ) {
                        $tags = [ $tags ];
                }
-               $this->tags = $tags;
+               Assert::parameterElementType( 'string', $tags, 'tags' );
+               $this->tags = array_unique( array_merge( $this->tags, $tags ) );
        }
 
        /**
@@ -779,6 +797,7 @@ class ManualLogEntry extends LogEntryBase {
                        function () use ( $newId, $to ) {
                                $log = new LogPage( $this->getType() );
                                if ( !$log->isRestricted() ) {
+                                       Hooks::runWithoutAbort( 'ManualLogEntryBeforePublish', [ $this ] );
                                        $rc = $this->getRecentChange( $newId );
 
                                        if ( $to === 'rc' || $to === 'rcandudp' ) {
index 87b4be7..48ea4a5 100644 (file)
@@ -358,7 +358,7 @@ class ThumbnailImage extends MediaTransformOutput {
         * @return string
         */
        function toHtml( $options = [] ) {
-               global $wgPriorityHints;
+               global $wgPriorityHints, $wgElementTiming;
 
                if ( count( func_get_args() ) == 2 ) {
                        throw new MWException( __METHOD__ . ' called in the old style' );
@@ -374,12 +374,19 @@ class ThumbnailImage extends MediaTransformOutput {
                        'decoding' => 'async',
                ];
 
+               $elementTimingName = 'thumbnail';
+
                if ( $wgPriorityHints
                        && !self::$firstNonIconImageRendered
                        && $this->width * $this->height > 100 * 100 ) {
                        self::$firstNonIconImageRendered = true;
 
                        $attribs['importance'] = 'high';
+                       $elementTimingName = 'thumbnail-high';
+               }
+
+               if ( $wgElementTiming ) {
+                       $attribs['elementtiming'] = $elementTimingName;
                }
 
                if ( !empty( $options['custom-url-link'] ) ) {
index 71b1ad7..d94104b 100644 (file)
@@ -152,7 +152,7 @@ abstract class TablePager extends IndexPager {
 
                $tableClass = $this->getTableClass();
                $ret = Html::openElement( 'table', [
-                       'class' => "mw-datatable $tableClass" ]
+                       'class' => " $tableClass" ]
                );
                $ret .= Html::rawElement( 'thead', [], Html::rawElement( 'tr', [], "\n" . $s . "\n" ) );
                $ret .= Html::openElement( 'tbody' ) . "\n";
@@ -266,10 +266,11 @@ abstract class TablePager extends IndexPager {
        }
 
        /**
+        * TablePager relies on `mw-datatable` for styling, see T214208
         * @return string
         */
        protected function getTableClass() {
-               return 'TablePager';
+               return 'mw-datatable';
        }
 
        /**
index 288a527..f925038 100644 (file)
@@ -25,7 +25,7 @@
 class BlockLevelPass {
        private $DTopen = false;
        private $inPre = false;
-       private $lastSection = '';
+       private $lastParagraph = '';
        private $lineStart;
        private $text;
 
@@ -61,18 +61,29 @@ class BlockLevelPass {
                $this->lineStart = $lineStart;
        }
 
+       /**
+        * @return bool
+        */
+       private function hasOpenParagraph() {
+               return $this->lastParagraph !== '';
+       }
+
        /**
         * If a pre or p is open, return the corresponding close tag and update
         * the state. If no tag is open, return an empty string.
+        * @param bool $atTheEnd Omit trailing newline if we've reached the end.
         * @return string
         */
-       private function closeParagraph() {
+       private function closeParagraph( $atTheEnd = false ) {
                $result = '';
-               if ( $this->lastSection !== '' ) {
-                       $result = '</' . $this->lastSection . ">\n";
+               if ( $this->hasOpenParagraph() ) {
+                       $result = '</' . $this->lastParagraph . '>';
+                       if ( !$atTheEnd ) {
+                               $result .= "\n";
+                       }
                }
                $this->inPre = false;
-               $this->lastSection = '';
+               $this->lastParagraph = '';
                return $result;
        }
 
@@ -188,7 +199,11 @@ class BlockLevelPass {
                $pendingPTag = false;
                $inBlockquote = false;
 
-               foreach ( $textLines as $inputLine ) {
+               for ( $textLines->rewind(); $textLines->valid(); ) {
+                       $inputLine = $textLines->current();
+                       $textLines->next();
+                       $notLastLine = $textLines->valid();
+
                        # Fix up $lineStart
                        if ( !$this->lineStart ) {
                                $output .= $inputLine;
@@ -341,14 +356,14 @@ class BlockLevelPass {
                                        $inBlockElem = !$closeMatch;
                                } elseif ( !$inBlockElem && !$this->inPre ) {
                                        if ( substr( $t, 0, 1 ) == ' '
-                                               && ( $this->lastSection === 'pre' || trim( $t ) != '' )
+                                               && ( $this->lastParagraph === 'pre' || trim( $t ) != '' )
                                                && !$inBlockquote
                                        ) {
                                                # pre
-                                               if ( $this->lastSection !== 'pre' ) {
+                                               if ( $this->lastParagraph !== 'pre' ) {
                                                        $pendingPTag = false;
                                                        $output .= $this->closeParagraph() . '<pre>';
-                                                       $this->lastSection = 'pre';
+                                                       $this->lastParagraph = 'pre';
                                                }
                                                $t = substr( $t, 1 );
                                        } elseif ( preg_match( '/^(?:<style\\b[^>]*>.*?<\\/style>\s*|<link\\b[^>]*>\s*)+$/iS', $t ) ) {
@@ -364,9 +379,9 @@ class BlockLevelPass {
                                                        if ( $pendingPTag ) {
                                                                $output .= $pendingPTag . '<br />';
                                                                $pendingPTag = false;
-                                                               $this->lastSection = 'p';
+                                                               $this->lastParagraph = 'p';
                                                        } else {
-                                                               if ( $this->lastSection !== 'p' ) {
+                                                               if ( $this->lastParagraph !== 'p' ) {
                                                                        $output .= $this->closeParagraph();
                                                                        $pendingPTag = '<p>';
                                                                } else {
@@ -377,10 +392,10 @@ class BlockLevelPass {
                                                        if ( $pendingPTag ) {
                                                                $output .= $pendingPTag;
                                                                $pendingPTag = false;
-                                                               $this->lastSection = 'p';
-                                                       } elseif ( $this->lastSection !== 'p' ) {
+                                                               $this->lastParagraph = 'p';
+                                                       } elseif ( $this->lastParagraph !== 'p' ) {
                                                                $output .= $this->closeParagraph() . '<p>';
-                                                               $this->lastSection = 'p';
+                                                               $this->lastParagraph = 'p';
                                                        }
                                                }
                                        }
@@ -393,7 +408,11 @@ class BlockLevelPass {
                        if ( $pendingPTag === false ) {
                                if ( $prefixLength === 0 ) {
                                        $output .= $t;
-                                       $output .= "\n";
+                                       // Add a newline if there's an open paragraph
+                                       // or we've yet to reach the last line.
+                                       if ( $notLastLine || $this->hasOpenParagraph() ) {
+                                               $output .= "\n";
+                                       }
                                } else {
                                        // Trim whitespace in list items
                                        $output .= trim( $t );
@@ -403,15 +422,13 @@ class BlockLevelPass {
                while ( $prefixLength ) {
                        $output .= $this->closeList( $prefix2[$prefixLength - 1] );
                        --$prefixLength;
-                       if ( !$prefixLength ) {
+                       // Note that a paragraph is only ever opened when `prefixLength`
+                       // is zero, but we'll choose to be overly cautious.
+                       if ( !$prefixLength && $this->hasOpenParagraph() ) {
                                $output .= "\n";
                        }
                }
-               if ( $this->lastSection !== '' ) {
-                       $output .= '</' . $this->lastSection . '>';
-                       $this->lastSection = '';
-               }
-
+               $output .= $this->closeParagraph( true );
                return $output;
        }
 
index bf4c098..2d75c86 100644 (file)
@@ -87,7 +87,10 @@ class RemexStripTagHandler implements TokenHandler {
                'pre' => true,
                'section' => true,
                'table' => true,
+               'td' => true,
                'tfoot' => true,
+               'th' => true,
+               'tr' => true,
                'ul' => true,
                'video' => true,
        ];
index b51f92f..99e6dde 100644 (file)
@@ -148,7 +148,7 @@ class EmailConfirmation extends UnlistedSpecialPage {
         * @param string $code Confirmation code
         */
        private function attemptConfirm( $code ) {
-               $user = User::newFromConfirmationCode( $code, User::READ_LATEST );
+               $user = User::newFromConfirmationCode( $code, User::READ_EXCLUSIVE );
                if ( !is_object( $user ) ) {
                        $this->getOutput()->addWikiMsg( 'confirmemail_invalid' );
 
index ea72bda..786f288 100644 (file)
@@ -1414,10 +1414,6 @@ class User implements IDBAccessObject, UserIdentity {
                                ] );
                                if ( $shouldSetCookie ) {
                                        $block->setCookie( $this->getRequest()->response() );
-
-                                       // temporary measure the use of cookies on ip blocks
-                                       $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
-                                       $stats->increment( 'block.ipblock.setCookie.success' );
                                }
                        } elseif ( $this->isLoggedIn() && $config->get( 'CookieSetOnAutoblock' ) ) {
                                $shouldSetCookie = $block->getType() === Block::TYPE_USER && $block->isAutoblocking();
@@ -1829,7 +1825,7 @@ class User implements IDBAccessObject, UserIdentity {
         *   Check when actually saving should be done against master.
         */
        private function getBlockedStatus( $bFromReplica = true ) {
-               global $wgProxyWhitelist, $wgUser, $wgApplyIpBlocksToXff, $wgSoftBlockRanges;
+               global $wgProxyWhitelist, $wgApplyIpBlocksToXff, $wgSoftBlockRanges;
 
                if ( $this->mBlockedby != -1 ) {
                        return;
@@ -1849,11 +1845,12 @@ class User implements IDBAccessObject, UserIdentity {
                # know which IP address they're actually coming from
                $ip = null;
                if ( !$this->isAllowed( 'ipblock-exempt' ) ) {
-                       // $wgUser->getName() only works after the end of Setup.php. Until
-                       // then, assume it's a logged-out user.
-                       $globalUserName = $wgUser->isSafeToLoad()
-                               ? $wgUser->getName()
-                               : IP::sanitizeIP( $wgUser->getRequest()->getIP() );
+                       $sessionUser = RequestContext::getMain()->getUser();
+                       // the session user is set up towards the end of Setup.php. Until then,
+                       // assume it's a logged-out user.
+                       $globalUserName = $sessionUser->isSafeToLoad()
+                               ? $sessionUser->getName()
+                               : IP::sanitizeIP( $sessionUser->getRequest()->getIP() );
                        if ( $this->getName() === $globalUserName ) {
                                $ip = $this->getRequest()->getIP();
                        }
@@ -1935,9 +1932,9 @@ class User implements IDBAccessObject, UserIdentity {
                }
 
                // Avoid PHP 7.1 warning of passing $this by reference
-               $user = $this;
+               $thisUser = $this;
                // Extensions
-               Hooks::run( 'GetBlockedStatus', [ &$user ] );
+               Hooks::run( 'GetBlockedStatus', [ &$thisUser ] );
        }
 
        /**
index e092859..8aca689 100644 (file)
@@ -211,6 +211,10 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
                                }
                        }
                }
+
+               $pageSeenKey = $this->getPageSeenTimestampsKey( $user );
+               $this->latestUpdateCache->delete( $pageSeenKey );
+               $this->stash->delete( $pageSeenKey );
        }
 
        /**
@@ -805,36 +809,64 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
        }
 
        /**
+        * Set the "last viewed" timestamps for certain titles on a user's watchlist.
+        *
+        * If the $targets parameter is omitted or set to [], this method simply wraps
+        * resetAllNotificationTimestampsForUser(), and in that case you should instead call that method
+        * directly; support for omitting $targets is for backwards compatibility.
+        *
+        * If $targets is omitted or set to [], timestamps will be updated for every title on the user's
+        * watchlist, and this will be done through a DeferredUpdate. If $targets is a non-empty array,
+        * only the specified titles will be updated, and this will be done immediately (not deferred).
+        *
         * @since 1.27
         * @param User $user
-        * @param string|int $timestamp
-        * @param LinkTarget[] $targets
+        * @param string|int $timestamp Value to set the "last viewed" timestamp to (null to clear)
+        * @param LinkTarget[] $targets Titles to set the timestamp for; [] means the entire watchlist
         * @return bool
         */
        public function setNotificationTimestampsForUser( User $user, $timestamp, array $targets = [] ) {
                // Only loggedin user can have a watchlist
-               if ( $user->isAnon() ) {
+               if ( $user->isAnon() || $this->readOnlyMode->isReadOnly() ) {
                        return false;
                }
 
-               $dbw = $this->getConnectionRef( DB_MASTER );
-
-               $conds = [ 'wl_user' => $user->getId() ];
-               if ( $targets ) {
-                       $batch = new LinkBatch( $targets );
-                       $conds[] = $batch->constructSet( 'wl', $dbw );
+               if ( !$targets ) {
+                       // Backwards compatibility
+                       $this->resetAllNotificationTimestampsForUser( $user, $timestamp );
+                       return true;
                }
 
+               $rows = $this->getTitleDbKeysGroupedByNamespace( $targets );
+
+               $dbw = $this->getConnectionRef( DB_MASTER );
                if ( $timestamp !== null ) {
                        $timestamp = $dbw->timestamp( $timestamp );
                }
+               $ticket = $this->lbFactory->getEmptyTransactionTicket( __METHOD__ );
+               $affectedSinceWait = 0;
 
-               $dbw->update(
-                       'watchlist',
-                       [ 'wl_notificationtimestamp' => $timestamp ],
-                       $conds,
-                       __METHOD__
-               );
+               // Batch update items per namespace
+               foreach ( $rows as $namespace => $namespaceTitles ) {
+                       $rowBatches = array_chunk( $namespaceTitles, $this->updateRowsPerQuery );
+                       foreach ( $rowBatches as $toUpdate ) {
+                               $dbw->update(
+                                       'watchlist',
+                                       [ 'wl_notificationtimestamp' => $timestamp ],
+                                       [
+                                               'wl_user' => $user->getId(),
+                                               'wl_namespace' => $namespace,
+                                               'wl_title' => $toUpdate
+                                       ]
+                               );
+                               $affectedSinceWait += $dbw->affectedRows();
+                               // Wait for replication every time we've touched updateRowsPerQuery rows
+                               if ( $affectedSinceWait >= $this->updateRowsPerQuery ) {
+                                       $this->lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
+                                       $affectedSinceWait = 0;
+                               }
+                       }
+               }
 
                $this->uncacheUser( $user );
 
@@ -859,7 +891,13 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
                return $timestamp;
        }
 
-       public function resetAllNotificationTimestampsForUser( User $user ) {
+       /**
+        * Schedule a DeferredUpdate that sets all of the "last viewed" timestamps for a given user
+        * to the same value.
+        * @param User $user
+        * @param string|int|null $timestamp Value to set all timestamps to, null to clear them
+        */
+       public function resetAllNotificationTimestampsForUser( User $user, $timestamp = null ) {
                // Only loggedin user can have a watchlist
                if ( $user->isAnon() ) {
                        return;
@@ -868,7 +906,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
                // If the page is watched by the user (or may be watched), update the timestamp
                $job = new ClearWatchlistNotificationsJob(
                        $user->getUserPage(),
-                       [ 'userId'  => $user->getId(), 'casTime' => time() ]
+                       [ 'userId'  => $user->getId(), 'timestamp' => $timestamp, 'casTime' => time() ]
                );
 
                // Try to run this post-send
@@ -1191,7 +1229,7 @@ class WatchedItemStore implements WatchedItemStoreInterface, StatsdAwareInterfac
        }
 
        /**
-        * @param TitleValue[] $titles
+        * @param LinkTarget[] $titles
         * @return array
         */
        private function getTitleDbKeysGroupedByNamespace( array $titles ) {
index f703514..6d0427f 100644 (file)
        "apisandbox-sending-request": "Изпращане на API заявка...",
        "apisandbox-loading-results": "Получаване на API резултати...",
        "apisandbox-request-selectformat-label": "Показване на заявката с данни като:",
-       "apisandbox-request-format-url-label": "URL низ на запитването",
+       "apisandbox-request-format-url-label": "URL-низ на заявката",
        "apisandbox-request-url-label": "URL-адрес на заявката:",
        "apisandbox-request-format-json-label": "JSON",
        "apisandbox-request-json-label": "JSON заявка:",
        "trackingcategories-desc": "Критерий за включване на категория",
        "restricted-displaytitle-ignored": "Страници с игнорирани заглавия за показване",
        "restricted-displaytitle-ignored-desc": "Страницата съдържа игнориран <code><nowiki>{{DISPLAYTITLE}}</nowiki></code>, защото той не съвпада с действителното заглавие на страницата.",
-       "noindex-category-desc": "СÑ\82Ñ\80аниÑ\86аÑ\82а Ð½Ðµ Ñ\81е Ð¸Ð½Ð´ÐµÐºÑ\81иÑ\80а Ð¾Ñ\82 Ñ\80обоÑ\82и, Ð·Ð°Ñ\89оÑ\82о Ñ\81Ñ\8aдÑ\8aÑ\80жа Ð²Ñ\8aлÑ\88ебнаÑ\82а Ð´Ñ\83миÑ\87ка <code><nowiki>__NOINDEX__</nowiki></code> Ð¸ Ðµ Ð² Ð¸Ð¼ÐµÐ½Ð½Ð¾ Ð¿Ñ\80оÑ\81Ñ\82Ñ\80анÑ\81Ñ\82во, ÐºÑ\8aдето такова отбелязване е позволено.",
-       "index-category-desc": "СÑ\82Ñ\80аниÑ\86аÑ\82а Ñ\81Ñ\8aдÑ\8aÑ\80жа <code><nowiki>__INDEX__</nowiki></code> (и Ðµ Ð² Ð¸Ð¼ÐµÐ½Ð½Ð¾ Ð¿Ñ\80оÑ\81Ñ\82Ñ\80анÑ\81Ñ\82во, ÐºÑ\8aдето такова отбелязване е позволено), поради което се индексира от роботи, където обикновено не би била индексирана.",
+       "noindex-category-desc": "СÑ\82Ñ\80аниÑ\86аÑ\82а Ð½Ðµ Ñ\81е Ð¸Ð½Ð´ÐµÐºÑ\81иÑ\80а Ð¾Ñ\82 Ñ\80обоÑ\82и, Ð·Ð°Ñ\89оÑ\82о Ñ\81Ñ\8aдÑ\8aÑ\80жа Ð²Ñ\8aлÑ\88ебнаÑ\82а Ð´Ñ\83миÑ\87ка <code><nowiki>__NOINDEX__</nowiki></code> Ð¸ Ðµ Ð¾Ñ\82 Ð¸Ð¼ÐµÐ½Ð½Ð¾ Ð¿Ñ\80оÑ\81Ñ\82Ñ\80анÑ\81Ñ\82во, Ð² ÐºÐ¾ето такова отбелязване е позволено.",
+       "index-category-desc": "СÑ\82Ñ\80аниÑ\86аÑ\82а Ñ\81Ñ\8aдÑ\8aÑ\80жа <code><nowiki>__INDEX__</nowiki></code> (и Ðµ Ð¾Ñ\82 Ð¸Ð¼ÐµÐ½Ð½Ð¾ Ð¿Ñ\80оÑ\81Ñ\82Ñ\80анÑ\81Ñ\82во, Ð² ÐºÐ¾ето такова отбелязване е позволено), поради което се индексира от роботи, където обикновено не би била индексирана.",
        "post-expand-template-inclusion-category-desc": "Страницата е по-голяма от <code>$wgMaxArticleSize</code> след разгръщането на всички шаблони, поради което някои шаблони не са разгърнати.",
-       "post-expand-template-argument-category-desc": "Страницата е по-голяма от <code>$wgMaxArticleSize</code> след разгръщането на аргументите на шаблона (нещо в тройни къдрави скоби, например <code>{{{Foo}}}</code>).",
+       "post-expand-template-argument-category-desc": "Страницата е по-голяма от <code>$wgMaxArticleSize</code> след разгръщането на аргументите на шаблона (нещо в тройни фигурни скоби, например <code>{{{Foo}}}</code>).",
        "expensive-parserfunction-category-desc": "Страницата използва твърде много ресурсоемки анализиращи функции (като <code>#ifexist</code>). Вижте [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:$wgExpensiveParserFunctionLimit Manual:$wgExpensiveParserFunctionLimit].",
        "broken-file-category-desc": "Страницата съдържа повредена препратка към файл (препратка за поставяне на файл, когато такъв не съществува).",
        "hidden-category-category-desc": "Категорията съдържа <code><nowiki>__HIDDENCAT__</nowiki></code>, което предотвратява показването ѝ в страниците по подразбиране.",
        "revertpage": "Премахване на [[Special:Contributions/$2|редакции на $2]] ([[User talk:$2|беседа]]); възвръщане към последната версия на [[User:$1|$1]]",
        "revertpage-nouser": "Връщане на редакции на скрит потребител до последната версия на [[User:$1|$1]]",
        "rollback-success": "Отменени редакции на {{GENDER:$3|$1}};\nвъзвръщане към последната версия на {{GENDER:$4|$2}}.",
-       "rollback-success-notify": "Премахнати редакции на $1; възвръщане към последна версия на $2. [$3 Показване на промени]",
+       "rollback-success-notify": "Премахнати редакции на $1;\nвръщане към последна версия на $2. [$3 Показване на промени]",
        "sessionfailure-title": "Прекъсната сесия",
        "sessionfailure": "Изглежда има проблем със сесията ви;\nдействието беше отказано като предпазна мярка срещу крадене на сесията.\nМоля, изпратете формуляра повторно.",
        "changecontentmodel": "Промяна на модела на съдържанието на страница",
        "namespace": "Именно пространство:",
        "invert": "Обръщане на избора",
        "tooltip-invert": "Поставянето на отметка ще скрие всички промени в страниците от избраното именно пространство (и свързаните именни пространства)",
-       "tooltip-whatlinkshere-invert": "Отбелязване на полето, за да скриете препратките от страниците в избраното именно пространство.",
+       "tooltip-whatlinkshere-invert": "Отбележете полето, за да скриете препратки от страници от избраното именно пространство.",
        "namespace_association": "Свързани именни пространства",
        "tooltip-namespace_association": "Поставянето на отметка ще включи и беседите и именните пространства, свързани с избраното именно пространство.",
        "blanknamespace": "(Основно)",
        "expand_templates_input": "Входящ уикитекст:",
        "expand_templates_output": "Резултат",
        "expand_templates_xml_output": "Изход на XML",
+       "expand_templates_html_output": "Суров HTML резултат",
        "expand_templates_ok": "ОК",
        "expand_templates_remove_comments": "Премахване на коментари",
        "expand_templates_remove_nowiki": "Потискане на елементите <nowiki> в резултата",
        "mw-widgets-titleinput-description-redirect": "пренасочване към $1",
        "mw-widgets-categoryselector-add-category-placeholder": "Добавяне на категория...",
        "mw-widgets-usersmultiselect-placeholder": "Добавяне на още...",
+       "mw-widgets-titlesmultiselect-placeholder": "Добавяне на още...",
        "date-range-from": "От дата:",
        "date-range-to": "До дата:",
        "sessionprovider-generic": "$1 сесии",
index b1c5c1b..f364c67 100644 (file)
        "accmailtitle": "পাসওয়ার্ড পাঠানো হয়েছে",
        "accmailtext": "[[User talk:$1|$1]] এর জন্য দৈব ভাবে উৎপন্ন শব্দ চাবি $2 এ পাঠানো হয়েছে।\nলগ-ইন করার পর ''[[Special:ChangePassword|পাসওয়ার্ড পরিবর্তন]]'' পাতা থেকে এটি পরিবর্তন করা যাব।",
        "newarticle": "(নতুন)",
-       "newarticletext": "à¦\86পনি à¦\8fমন à¦\8fà¦\95à¦\9fি à¦ªà¦¾à¦¤à¦¾à¦° à¦¸à¦\82যà§\8bà¦\97 à¦\85নà§\81সরণ à¦\95রà¦\9bà§\87ন, à¦¯à¦¾à¦° à¦\85সà§\8dতিসà§\8dত নেই।\nপাতাটি তৈরি করতে, নিচের বাক্সে তা টাইপ করা শুরু করুন (আরও তথ্য জানতে [$1 সহায়িকা পাতা] দেখুন)।\nআপনি যদি ভুল করে এখানে এসে থাকেন, তাহলে আপনার ব্রাউজারের <strong>পিছন</strong> বোতামে ক্লিক করুন।",
+       "newarticletext": "à¦\86পনি à¦\8fমন à¦\8fà¦\95à¦\9fি à¦ªà¦¾à¦¤à¦¾à¦° à¦¸à¦\82যà§\8bà¦\97 à¦\85নà§\81সরণ à¦\95রà¦\9bà§\87ন, à¦¯à¦¾à¦° à¦\85সà§\8dতিতà§\8dব নেই।\nপাতাটি তৈরি করতে, নিচের বাক্সে তা টাইপ করা শুরু করুন (আরও তথ্য জানতে [$1 সহায়িকা পাতা] দেখুন)।\nআপনি যদি ভুল করে এখানে এসে থাকেন, তাহলে আপনার ব্রাউজারের <strong>পিছন</strong> বোতামে ক্লিক করুন।",
        "anontalkpagetext": "----\n<em>এটি একটি বেনামী ব্যবহারকারীর আলাপের পাতা, যিনি এখনও কোন অ্যাকাউন্ট তৈরি করেননি, কিংবা তিনি অ্যাকাউন্টটি ব্যবহার করছেন না।</em>\nআমরা তাই সাংখ্যিক আইপি ঠিকানা ব্যবহার করে তাঁদের শনাক্ত করছি।\nএকাধিক ব্যবহারকারী এরকম একটি আইপি ঠিকানা ব্যবহার করতে পারেন।\nআপনি যদি একজন বেনামী ব্যবহারকারী হয়ে থাকেন এবং যদি অনুভব করেন যে আপনার প্রতি অপ্রাসঙ্গিক মন্তব্য করা হয়েছে, তাহলে অন্যান্য বেনামী ব্যবহারকারীর সাথে ভবিষ্যতে বিভ্রান্তি এড়াতে অনুগ্রহ করে [[Special:CreateAccount|একটি অ্যাকাউন্ট তৈরি করুন]] অথবা  [[Special:UserLogin|অ্যাকাউন্টে প্রবেশ করুন]]।",
        "noarticletext": "বর্তমানে এই পাতায় কোন লেখা নেই।\nআপনি চাইলে অন্যান্য পাতায় [[Special:Search/{{PAGENAME}}| এই শিরোনামটি অনুসন্ধান করতে পারেন]],\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} এ সম্পর্কিত লগ অনুসন্ধান করতে পারেন], \nকিংবা [{{fullurl:{{FULLPAGENAME}}|action=edit}} এই পাতাটি তৈরি করতে পারেন]</span>।",
        "noarticletext-nopermission": "বর্তমানে এই পাতায় কোন লেখা নেই।\nআপনি চাইলে অন্য পাতায় [[Special:Search/{{PAGENAME}}| শিরোনামটি অনুসন্ধান করতে পারেন]], অথবা <span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} সম্পর্কিত লগ অনুসন্ধান করতে পারেন]</span>, কিন্তু আপনার এই পাতাটি তৈরী করার অনুমতি নেই।",
index e2a08b9..a031eef 100644 (file)
@@ -95,7 +95,7 @@
        "march-gen": "مارس",
        "april-gen": "آڤریل",
        "may-gen": "مئی",
-       "june-gen": "جۊٱن",
+       "june-gen": "جۊئٱن",
        "july-gen": "جۊئیٱ",
        "august-gen": "آگوست",
        "september-gen": "سپتامبر",
        "category_header": "بٱلگاْیٱل میٛن دٱسداْ \"$1\"",
        "subcategories": "زیر دٱسداْیٱل",
        "category-media-header": "ڤارسگر میٛن دٱسداْ \"$1\"",
-       "category-empty": "<em> ای دٱسدٱ هیژ بٱلگاْ یا ڤارسگٱری مئن خوس ناراْ.</em>",
+       "category-empty": "<em> ای دٱسدٱ هیژ بٱلگاْ یا ڤارسگٱری میٛن خوس ناراْ.</em>",
        "hidden-categories": "{{PLURAL:$1|دٱسداْ قام ڤابیڌٱ|دٱسداْیٱل قام ڤابیڌٱ}}",
        "hidden-category-category": "دٱسداْیٱل قام ڤابیڌٱ",
        "category-subcat-count": "{{PLURAL:$2|ای دٱسداْ فٱقٱت ز ڤٱرگرهڌاْ زیردٱسداْیٱل نیاییاْ.|ای دٱسداْ ز ڤٱرگرهڌاْ {{PLURAL:$1|زیردٱسداْ|$1 زیردٱسداْیٱل}}, بیشتر ز کول $2 .}}",
        "faq": "اْف اٛی کیۊ",
        "actions": "کونشتکارۊن",
        "namespaces": "نوم ڤارگٱیٱل",
-       "variants": "Ø¢Ù\84شدگٱرÛ\8aÙ\86",
+       "variants": "Ø¢Ù\84شدکارٱÙ\84",
        "navigation-heading": "نوم جاگٱ ناڤگٱردی",
        "errorpagetitle": "خٱتا",
        "returnto": "ڤورگٱشدن ب $1.",
        "tagline": "ز {{SITENAME}}",
-       "help": "رٱنمۊنی",
+       "help": "رٱنمونی",
        "help-mediawiki": "هومیاری سی مدیاڤیکی",
        "search": "پاٛی جۊری",
        "search-ignored-headings": "#<!-- ای بٱلٛگاْ ناْ هٱمی بٱرتی کاْ هؽڌا رها کونین --> <pre>\n# سٱرتال ٱلؽ  که ڤا موڌی نیڌاْ اْڤۊهن\n# تٱسیر آلشڌ راتؽ ایاهاْ ڤارۊ کاْ بٱلٛگاْ هاڤی او سٱرتال، نماواْ ڤۊهاْ.\n# اؽسا تٱرین ڤا ٱنجوم یٱ آلشڌکاری پیک بٱلٛگاْ ناْ بؽرٱ ڤاْ دو کرات نماواْ ڤیڌن کونین\n# رڤشڌس چونوݩ هؽڌآ:\n#  *هٱر چاْ زاْ یٱ هؽلنیڌاْ «#» تا تٱهاْ هؽل ڤاهین، یٱ اشکافنیڌن هؽڌا.\n#  *هٱر هؽل بؽ تلاهاْ، دٱیخٱن اوڌڤانی  هؽڌا کاْ نیڌاْ گریڌاْ اْڤۊهاْ (ڤا رعایٱت گاپی ۉ ساوائی هٱرفٱل).\nکونڳگٱیٱل(مٱنابع)\nمؽنڌاری ڤا دٱر\nهٱم چونوݩ ڤنٱرین\n#</pre> <!-- leave this line exactly as it is -->",
        "history_short": "ڤیرگار",
        "history_small": "ڤیرگار",
        "updatedmarker": "ڤانها(ڤ رۊز)آڤیڌاْ زاْ ٱخیرین کرٱتی کاْ سٱرؤر داماْ",
-       "printableversion": "نوسقاْ پاْلا ڤابیڌنی",
+       "printableversion": "نوسقاْ پیٛلا ڤابیڌنی",
        "permalink": "هومپاٛیڤٱند دایومی",
        "print": "چاپ گرهڌن",
        "view": "ديڌن",
        "view-foreign": "میٛن $1 ناْ باْنیٱر",
-       "edit": "آلشدکاری",
+       "edit": "آلشدکاری کردن",
        "edit-local": "آلشڌکاری اشکافنیڌیٱل بۊمی",
        "create": "راس كردن",
        "create-local": "یٱ تۉزی ڤولات نشینی اْزاف کونین",
        "otherlanguages": "میٛن زڤونا دیٱ",
        "redirectedfrom": "(ڤاگٱردۊنی سی $1)",
        "redirectpagesub": "بٱلگاْ ڤاگٱردۊنی",
-       "redirectto": "ڤاگٱردۊنی سی:",
-       "lastmodifiedat": "ای بٱلگٱ تازاٛییا ماٛن $1 و میٛن $2 آلشدکاری ڤابیڌاْ.",
+       "redirectto": "ڤاگٱردونی سی:",
+       "lastmodifiedat": "ای بٱلگاْ تازاٛییا میٛن $1 و میٛن $2 آلشدکاری ڤابیڌاْ.",
        "viewcount": "ای بٱلگاْ میٛن دٱسرساْ {{PLURAL:$1|یٱ کاْرٱت|$1 چٱن کاْرٱت}}.",
        "protectedpage": "بٱلگاْ پٱر و پیم ڤابیڌاْ",
        "jumpto": "پراٛستن سی:",
        "viewsourceold": "دیڌن سرچشمٱ",
        "editlink": "آلشدکاری کردن",
        "viewsourcelink": "ساٛیل سرچشماْ کونین",
-       "editsectionhint": "آلشدکاری بٱرجا: $1",
+       "editsectionhint": "Ø¢Ù\84شدکارÛ\8c Ø¨Ù±Ø¦Ø±Ø¬Ø§: $1",
        "toc": "مینۊناْیٱل",
        "showtoc": "دیاری کردن",
        "hidetoc": "قام کردن",
        "nstab-project": "بٱلگاْ پوروجاْ",
        "nstab-image": "جانیا",
        "nstab-mediawiki": "پیغوم",
-       "nstab-template": "چۊاْ",
+       "nstab-template": "Ú\86Û\8aئاÙ\92",
        "nstab-help": "بٱلگاْ هومیاری",
        "nstab-category": "دٱسدٱ",
        "mainpage-nstab": "سرتال",
        "delete-hook-aborted": "پژار ڤا قولاڤ لٱق آڤیڌ\nاشکافنیڌنی سی هؽ داڌ نڤیڌ",
        "no-null-revision": "سی بٱلگاْ $1 ڤانیٱری خومسا ناْ راس کونین",
        "badtitle": "داسوݩ گٱن",
-       "badtitletext": "داسوݩ خاسدنی نادیار، هالی، یا داسۊنی کاْ میٛنجقا زڤونی یا میٛنجقا ڤیکی ڤا هومپاٛیڤٱند دوروسد ناراْ و یا گاشا چٱنتا کاراکتر داراْ کاْ ڤا میٛن داسۊن نۉ باْیوفتاْ ڤا کار.",
+       "badtitletext": "داسوݩ خاسدنی نادیار، هالی، یا داسۊنی کاْ میٛنجقا زڤونی یا میٛنجقا ڤیکی ڤا هومپاٛیڤٱند دوروسد ناراْ و یا گاشا چٱنتا کاراکتر داراْ کاْ ڤا میٛن داسوݩ نۉ باْیوفتاْ ڤا کار.",
        "title-invalid-empty": "اوڌڤان بٱلٛگاْ دٱرخاس آڤیڌاْ پٱتی هؽڌآ یا تاٛنا اوڌڤان مؽن نوم گوڌ آڤیڌاْ هؽڌآ",
        "title-invalid-utf8": "اوڌڤان بٱلٛگاْ دٱرخاس آڤیڌاْ هؽل ڤیڌاْ نادوروس یونیکوڌ هؽڌآ",
        "title-invalid-interwiki": "بٱلٛگاْ دٱرخاس آڤیڌاْ دارای پاٛڤٱن مؽن ڤیکی هؽڌآ کاْ نؽڤۊهاْ مؽن اوڌڤانٱل نهاڌاْ ڤۊهاْ",
        "actionthrottled": "نها کار اؽسا گریداٛ آڤیڌ",
        "actionthrottledtext": "ڤ سی نهاگری زاْ ؤولٱ ڤیڌن چۊلکاری،اْجازاٛ نارین کاْ چونوݩ کارؽ ناْ ڤؽشڌر زاْ چٱن کرٱت ڤ یٱ رات کول ٱنجوم ڤڌین\nلوتفٱن دیناتٱر زاْ چٱن دٱیخاْ سٱرزنۊ پلرڌ کونین",
        "protectedpagetext": "ای بٱلٛگاْ سی نهاگری راْ آلشڌکاری یا جومجیل دهرؽ پلڌاری آڤیڌاْ",
-       "viewsourcetext": "ایسا تاْرین سرچشماْ ای بلگاْ ناْ هٱم بنیٱرین و هم ڤوردارینس:",
+       "viewsourcetext": "ایسا تیٛرین سرچشماْ ای بلگاْ ناْ هٱم بنیٱرین و هم ڤوردارینس:",
        "viewyourtext": "ایسا تاْرین یٱ کوپی ز سرچشمٱ<strong>آلشدکاریٱل خوتوݩ</strong> ڤوردارین سی ای بٱلگاْ",
        "protectedinterface": "ای بٱلگاْ سی نٱرم ٱفزاری کاْ سی ڤیکی نڤیسی هڌ آماڌاْ ڤابیڌاْ،و ز موزاهمٱت کاری پٱر و پیم ڤابیڌاْ سی اْزاف کردن یا آلشدکاری کردن میٛن هٱماْ ڤیکیٱل لوتف کونین [https://translatewiki.net/ translatewiki.net] ناْ ڤٱنین ڤا کار، پوروجاْ ڤولات نشین سازی ڤیکیمدیا.",
        "editinginterface": "<strong>هوشڌار:</strong> بٱلٛگاْ کاْآلشڌکاری اْکونین مٱتنؽ ڌاراْ کاْ مؽن ڤاست  مؽنتور ای نٱرمٱفزار ڤ کار رٱئڌاْ\nآلشڌ ای بٱلٛگاْ ڤانی آلشڌ بارت ڤاست مؽنتور ای نٱرم‌ٱفزار سی مؽنتورٱل داٛری اْڤۊهاْ",
        "yourpasswordagain": "رازیناْ گوڌٱشدن خوتۊناْ ز نۉ بزنین:",
        "createacct-yourpasswordagain": "پوشت راسدکاری رازینٱ گوڌاْشتن",
        "createacct-yourpasswordagain-ph": "ز نۉ رازیناْ گوڌاْشتن نٱ بزٱ",
-       "userlogin-remembermypassword": "مۊناْ میٛن سامۊناْ ڤاڌار",
+       "userlogin-remembermypassword": "موناْ میٛن ساموناْ ڤاڌار",
        "userlogin-signwithsecure": "ز رٱڤشت ٱمن ڤٱسل ڤابۊین",
        "cannotlogin-title": "نٱترین بیایین ڤامیٛن",
        "cannotlogin-text": "نٱترین بیائین ڤامیٛن",
        "userlogin-noaccount": "یٱ هساو کاریاری دارین؟",
        "userlogin-joinproject": "ٱندوم دیارگٱ {{SITENAME}} ڤابۊین",
        "createaccount": "راسد کردن هساو کاریاری",
-       "userlogin-resetpassword-link": "رازیناْ گوڤٱرتنتۊ ز ڤیرتۊن رٱهڌاْ؟",
+       "userlogin-resetpassword-link": "رازیناْ گوڤٱرتنتۊ ز ڤیرتوݩ رٱهڌاْ؟",
        "userlogin-helplink2": "هومیاری کردن سی ڤامیٛن ٱڤوڌن",
        "userlogin-loggedin": "ایسا ایساْ چی {{GENDER:$1|$1}} ٱڤۊڌین ڤامیٛن. فورم داْڤۊنی ناْ ڤٱنین ڤا کار و چی یٱ کاریار دیٱ بیائین ڤا میٛن",
        "userlogin-reauth": "ایسا ڤا ز نۉ بیائین ڤامیٛن سی یو کاْ دیار ڤابۊ ایسا {{GENDER:$1|$1}} هڌین.",
        "userlogin-createanother": "یٱ هساو کاریاری دیٱ راسد کونین",
        "createacct-emailrequired": "تیرنشوݩ ٱنجومانامٱ",
        "createacct-emailoptional": "تیرنشوݩ ٱنجومانامٱ",
-       "createacct-email-ph": "تیرنشوݩ ٱنجوماناماْ تۊناْ بزنین.",
+       "createacct-email-ph": "تیرنشوݩ ٱنجوماناماْ توناْ بزنین.",
        "createacct-another-email-ph": "تیرنشوݩ ٱنجوماناماْ تۊناْ بزنین.",
        "createaccountmail": "یٱ رازیناْ گوڌٱشتن موڤٱقٱتی ناْ ڤاْنین ڤا کار و سی یٱ تیرنشوݩ ٱنجوماناماْ تیار ڤابیڌاْ باْسیس کونین.",
        "createaccountmail-help": "ایسا ترین یٱ هساو کاریاری سی یکی دیٱ راسد کونین بی یو کاْ رازیناْ گوڌٱشتنساْ ڤٱنین ڤا ڤیر.",
        "loginlanguagelabel": "زڤون:$1",
        "suspicious-userlogout": "خاستتوݩ سی رٱهڌن ب دٱر ز ساموناْ رٱڌ ڤابی چونو کاْ دیاراْ چونو خاستی ڤا یٱ یا یٱ پوروکسی میٛنجقاگر بیٛسی ڤابیڌاْ بۊ",
        "createacct-another-realname-tip": "نو راستٱکی دل ب خائیاْ.\nٱر بزنینس گات ڤورگٱشتن ب آریٛنگٱلتوݩ و ڤورگٱشت هونو ب ایسا نوم راستٱکی توݩ ناْ ڤٱناْ ڤا کار.",
-       "pt-login": "ڤامین ٱڤوڌن",
+       "pt-login": "ڤاÙ\85Û\8cÙ\9bÙ\86 Ù±Ú¤Ù\88Ú\8cÙ\86",
        "pt-login-button": "ڤامیٛن ٱڤوڌن",
        "pt-login-continue-button": "پوشت سریٱک بیائین ڤامیٛن",
        "pt-createaccount": "راسد کردن هساو کاریاری",
        "publishchanges-start": "تیژنیڌن آلشڌکاریٱل",
        "preview": "پيش ساٛیل",
        "showpreview": "نشوݩ دائن پیش ساٛیل",
-       "showdiff": "نشوݩ دائن آلشدا",
+       "showdiff": "نشوݩ دائن آلشدکاریٱل",
        "anoneditwarning": "<strong>ب ڤیرتوݩ بۊ:</strong> ایسا هاْنی نٱڤۊڌین ڤامین. تیرنشوݩ آی پی ایسا سی هر گاتی کاْ آلشدکاری کونین سی کول خٱلک دیاراْ. ٱر <strong>[$1 رۉین ڤامین]</strong> یا <strong>[$2 یٱ هساو کاریاری راسد کونین]</strong>، آلشدکاریٱل ایسا ڤا نوم کاریاری خوتوݩ دیاری اْبۊ و یو سی ایسا بیتراْ.",
        "missingcommenttext": "لوتفٱن یٱ کامنت بیٛنین.",
        "missingcommentheader": "<strong>ب ڤیر ڤٱن:</strong> ایسا هیٛنی یٱ داسوݩ سی ای کامنت کۊ نکردیناْ.\nٱر ایسا یٱ کرٱت دٱ ری \"$1\" بپۊرنین، ڤیرایشت کاریوݩ هالی کۊ اْبۊ.",
        "loginreqpagetext": "$1 لوتف کونین بٱلگاْیٱل دیٱر ناْ ساٛیل کونین.",
        "accmailtitle": "رازیناْ گوڌٱشتن باْسی ڤابیڌاْ",
        "newarticle": "(تازاْ)",
-       "newarticletext": "ایسا ز دین یٱ هومپاٛیڤٱندی هڌین کاْ نیڌس. سی رٱڤٱندیاری بٱلگاْ شورۊ کونین میٛن ای جٱڤاْ داٛڤۊنی بنڤیسین(سی دۊنسدن بیشدر سئیل [$1]کونین).\nیر ایسا سی اْشتڤاکارش ايچونین، دوگماْ رٱهڌن ڤاپوشد نٱ بپۊرنین.",
+       "newarticletext": "ایسا ز دین یٱ هومپاٛیڤٱندی هڌین کاْ نیڌس. سی رٱڤٱندیاری بٱلگاْ شورۊ کونین میٛن ای جٱڤاْ دیٛڤونی بنڤیسین(سی دۊنسدن بیشدر ساٛیل [$1]کونین).\nیر ایسا سی اْشتڤاکارش ايچونین، دوگماْ رٱهڌن ڤاپوشد نٱ بپۊرنین.",
        "noarticletext": " ایساْ ای بٱلگاْ نڤشداْیی ناراْ، ایسا تاْرین [[Special:Search/{{PAGENAME}}داسۊن ای بٱلگاْ نٱ میٛن بٱلگاْیٱل دیٱری پاٛی جۊری کونین]] یا [{{fullurl:{{FULLPAGENAME}}|action=edit}} ای بٱلگاْ نٱ آلشدکاری کونين].",
        "noarticletext-nopermission": " ایساْ ای بٱلگاْ نڤشداْیی ناراْ، ایسا تاْرین [[Special:Search/{{PAGENAME}}داسۊن ای بٱلگاْ نٱ میٛن بٱلگاْیٱل دیٱری پاٛی جۊری کونین]] یا [{{fullurl:{{FULLPAGENAME}}|action=edit}} ای بٱلگاْ نٱ آلشد کونين].",
        "userpage-userdoesnotexist-view": "هساو کاریاری \"$1\" سٱبت نٱڤابیڌاْ.",
        "editundo": "ٱنجومشیڤ کردن",
        "diff-empty": "(یٱ جۊر)",
        "diff-multi-sameuser": "({{PLURAL:$1|یٱ دۊناٛ نوسقاٛ مؽنجخایی|$1 نوسقاٛیٱل مؽنجخایی}} ب دٱسد{{PLURAL:$2|کاریاری ديٱ|$2 کاريارا}} نشۊن دیاری نٱکرداْ)",
-       "diff-multi-otherusers": "({{PLURAL:$1|یٱ نوسقاْ میٛنجقایی|$1 نوسقاْیٱل میٛنجایی}} ڤا دٱسد {{PLURAL:$2|کاریاری دیٱ|$2 کاریارٱل}} نشۊن داڌاْ نٱڤابیڌاْ)",
+       "diff-multi-otherusers": "({{PLURAL:$1|یٱ نوسقاْ میٛنجقایی|$1 نوسقاْیٱل میٛنجایی}} ڤا دٱسد {{PLURAL:$2|کاریاری دیٱ|$2 کاریارٱل}} نشوݩ داڌاْ نٱڤابیڌاْ)",
        "diff-paragraph-moved-tonew": "پاراگراف جا ب جا ڤابی، یٱ کاْرٱت بپۊرنین تا رۉین یٱ جا دیٱر.",
        "diff-paragraph-moved-toold": "پاراگراف جا ب جا ڤابی، یٱ کاْرٱت بپۊرنین تا رۉین ب جا نیایی.",
        "searchresults": "نتيجاْیٱل پاٛی جۊری",
        "nextn-title": "نیایی $1 {{PLURAL:$1|نتيجٱ|نتیجاْیٱل}}",
        "shown-title": "نشوݩ دائن $1 {{PLURAL:$1|نتیجاْ|نتیجاْیٱل}} سی هر بٱلگاْ",
        "viewprevnext": "دیڌن ($1 {{int:pipe-separator}} $2) ($3)",
-       "searchmenu-exists": "<strong>ایچو میٛن ای ڤیکی یٱ بٱلگاْ هڌ کاْاْسمس \"[[:$1]]\" اْ </strong> {{PLURAL:$2|0=|هٱمچونو ساٛیل نتیجاْیٱلی کاْ دیار کرداْ ناْ کونین.}}",
+       "searchmenu-exists": "<strong>ایچو میٛن ای ڤیکی یٱ بٱلگاْ هڌ کاْ اْسمس \"[[:$1]]\" اْ </strong> {{PLURAL:$2|0=|هٱمچونو ساٛیل نتیجاْیٱلی کاْ دیار کرداْ ناْ کونین.}}",
        "searchmenu-new": "<strong>اي بٱلگاْ نٱ میٛن \"[[:$1]]\" ای ڤیکی راسد کو!</strong> {{PLURAL:$2|0=|See also the page found with your search.|See also the search results found.}}",
        "searchprofile-articles": "بٱلگاْیٱل مینۊناْ دار",
        "searchprofile-images": "مۊلتی مدیا",
        "group-user": "کاریارٱل",
        "group-autoconfirmed": "کاریارٱل خودپوشت راسد ڤابیڌاْ.",
        "group-bot": "روڤاتٱل",
-       "group-sysop": "سٱردیڤۊنکارۊن",
+       "group-sysop": "سٱردیڤۊنکاروݩ",
        "group-bureaucrat": "بوروکراتٱل",
        "group-all": "(هٱماْ)",
        "group-user-member": "{{GENDER:$1|کاریار}}",
        "nchanges": "$1 {{PLURAL:$1|آلشدکاری|آلشدکاریٱل}}",
        "enhancedrc-since-last-visit": "$1 {{PLURAL:$1|ز آخری دیڌن}}",
        "enhancedrc-history": "ڤیرگار",
-       "recentchanges": "آلشدکاریا ایسنی",
+       "recentchanges": "آلشدکاریٱل ایسنی",
        "recentchanges-legend": "گوزیناْیٱل آلشدکاریٱل ایسنی",
        "recentchanges-summary": "دو بیشتر آلشدٱل تازاْ باڤ ڤیکی ناْ ز ای بٱلگاْ پاٛیگری کو.",
        "recentchanges-noresult": "هیژ آلشدکاری میٛن گات ای چیا اْتفاق نٱڤٱسداْ",
        "rc-enhanced-hide": "قام کردن جوزئیات",
        "rc-old-title": "زاتٱ چی \"$1\" راس ڤابیڌاْ",
        "recentchangeslinked": "آلشدکاریٱل تاْ یٱک",
-       "recentchangeslinked-feed": "تغÛ\8cÛ\8cرات Ù\85رتبط",
-       "recentchangeslinked-toolbox": "آلشدکاریٱل تاْ یٱک",
-       "recentchangeslinked-title": "آلشدکاریٱل تاٛ یکی سی $1",
+       "recentchangeslinked-feed": "Ø¢Ù\84شدکارÛ\8cÙ±Ù\84 ØªÛ\8cÙ\9b Û\8cÙ±Ú©",
+       "recentchangeslinked-toolbox": "آلشدکاریٱل تیٛ یٱک",
+       "recentchangeslinked-title": "آلشدکاریٱل تیٛ یکی سی $1",
        "recentchangeslinked-summary": "نوم یٱ بٱلٛگاْ ناْ ڤامؽ کونین تا آلشڌکاری بٱلٛگیٱل کاْ ڤاْ هومؽنڌارکرڌیناْ یا زاْ هو مؽنڌاری گریڌین ناْ ڤڤینین(سی نیٱشڌن هوم ڤٱنوناْ یٱ بنکۊ چونوݩ چی ائی ناْ ڤزٱنین:نوم بونکۊ). \nآلشڌکاریٱل بلٛگیٱلؽ کاْ مؽن[[Special:Watchlist|نومگٱ دیناگریٱل اؽسا]] هؽڌن <strong>ؤٱرڌار</strong> نمای اْڤۊهاْ",
        "recentchangeslinked-page": "نوم بٱلگاْ:",
-       "recentchangeslinked-to": "آلشدکاریٱلی کاْ میٛن بٱلگاْیٱل هومپاٛیڤٱند بیناْ ب جا بٱلگاْ داڌاْ ڤابیڌاْ دیاریسۊن کو",
+       "recentchangeslinked-to": "آلشدکاریٱلی کاْ میٛن بٱلگاْیٱل هومپاٛیڤٱند بیناْ ب جا بٱلگاْ داڌاْ ڤابیڌاْ دیاریسوݩ کو",
        "recentchanges-page-added-to-category": "[[:$1]] اْزاف ڤابی ب دٱسداْ",
        "recentchanges-page-removed-from-category": "[[:$1]] ز دٱسداْ جوڌا ڤابی",
        "upload": "سوڤار کردن جانیا",
        "linkstoimage-redirect": "$1 (ڤاگٱردۊنی جانیا) $2",
        "sharedupload": "ای جانیا کاْ ز  $1 گاشا میٛن پوروجاْیٱل دیٱ ڤٱسداْ بۊ ڤاکار",
        "sharedupload-desc-here": "جانیایی کاْ میٛن $1 گاشا میٛن پوروجٱیٱل هٱنی ٱم ب کار گرهڌاْ ڤابیڌاْ بۊ.\nتۉزی سی [$2 file description page] میٛن دڤۊن دیاراْ",
-       "filepage-nofile": "چونو جانیایی ڤا چونڤ اْسمی نیڌس.",
+       "filepage-nofile": "چونو جانیایی ڤا چونو اْسمی نیڌس.",
        "uploadnewversion-linktext": "یٱ نوسقاْ تازاْ زی جانیا سوڤار کونین",
        "shared-repo-from": "ز $1",
-       "upload-disallowed-here": "ايسا ناْترین ای جانیا نٱ ز نۉ سوڤار کونین",
+       "upload-disallowed-here": "ايسا نیٛترین ای جانیا نٱ ز نۉ سوڤار کونین",
        "filerevert": "ز سرگرهڌن سی $1",
        "filerevert-legend": "ز سرگرهڌن جانیا",
        "filerevert-comment": "دلیل:",
        "sp-contributions-logs": "پاْرستنۊماْیٱل",
        "sp-contributions-talk": "چٱک چناْ",
        "sp-contributions-search": "سی هومیاریٱل پاٛی جۊری ڤابۊ",
-       "sp-contributions-username": "Ù\86Ù\88Ù\85 Ù\86اÙ\9bØ´Û\8aÙ\86 آی پی یا نوم کاریاری",
+       "sp-contributions-username": "Ù\86Ù\88Ù\85 Ù\86Ø´Ù\88Ý© آی پی یا نوم کاریاری",
        "sp-contributions-toponly": "فقٱت آلشدکاریٱلی کاْ جۏزڤاْ آخریݩ دۉران دیاری کو",
        "sp-contributions-newonly": "فٱقٱت آلشدکاریٱلی نٱ کاْ میٛن گات راست کردن بٱلگاْ بیڌناْ دیاری کو.",
        "sp-contributions-submit": "پاٛی جۊری",
        "whatlinkshere-page": "بٱلگاْ",
        "linkshere": "چونو بٱلگاْیٱلی هومپاٛیڤٱند ڤابیناْ ب '''$2''':",
        "nolinkshere": "هیژ بٱلگاْ ب '''$2''' هوم پاٛیڤٱند ناراْ.",
-       "isredirect": "بٱلگاْ ڤاگٱردۊنی",
+       "isredirect": "بٱلگاْ ڤاگٱردونی",
        "istemplate": "ڤارو گونجایشدٱل",
        "isimage": "جانیا هومپاٛیڤٱند",
        "whatlinkshere-prev": "{{PLURAL:$1|دیندایی|دیندایی$1}}",
        "import-upload-filename": "نوم جانیا:",
        "import-comment": "ڤير و باڤٱر",
        "importlogpage": "پهرستنوماْ داڌن",
-       "tooltip-pt-userpage": "{{GENDER:|بٱلگاْ کاریاریتۊن}} بٱلگاْ",
+       "tooltip-pt-userpage": "{{GENDER:|بٱلگاْ کاریاریتوݩ}} بٱلگاْ",
        "tooltip-pt-mytalk": "{{GENDER:|بٱلگاْ چٱک چناْ کاریاریام}}",
        "tooltip-pt-preferences": "{{GENDER:|ایسا}} ٱسل کاریٱل",
        "tooltip-pt-watchlist": "نومگٱ بٱلگاْیٱلی کاْ ایسا آلشدکاریا خوتۊناْ دینداگٱردی اْکونین",
        "tooltip-pt-mycontris": "یٱ نومگٱ ز هومیاریٱل {{GENDER:|ایسا}}",
-       "tooltip-pt-login": "اÛ\8cÙ\85ا Ø§Ù\9bÚ¯Û\8aÛ\8cÙ\85 Ú©Ø§Ù\92 Ø±Û\89Û\8cÙ\86 Ú¤Ø§Ù\85Û\8cÙ\86 Ø³Ø§Ù\85Û\8aÙ\86Ú¯Ù±: Ú¤Ø§Ù\92Ù\84Û\8c Ú\86Ù\88Ù\86Ù\88 Ú©Ø§Ø±Û\8c Ø§Ù\9bژباری نی",
-       "tooltip-pt-logout": "ز سامۊناْ درٱڤوڌن",
-       "tooltip-pt-createaccount": "اÙ\8aسا Ù¾Ù\88شت Ú¯Ù±Ø±Ù\85 Ú¤Ø§Ø¨Û\8cÚ\8cÛ\8cÙ\86اÙ\92 Ú©Ø§Ù\92 Û\8cÙ± Ù\87ساÙ\88 Ø±Ø§Ø³Ø¯ Ú©Ù\88Ù\86Û\8cÙ\86 Ù\88 Ø¨Û\8cائÛ\8cÙ\86 Ú¤Ø§Ù\85Û\8cÙ\86. Ú¤Ø§Ù\92Ù\84Û\8c Ú\86Ù\88Ù\86Ù\88 Ú©Ø§Ø±Û\8c Ø§Ù\9bژباری نی.",
-       "tooltip-ca-talk": "Ú\86Ù±Ú© Ú\86Ù\86اÙ\92 Ø³Û\8c Ù\85Û\8cÙ\86Û\8aÙ\86اÙ\92 Ø¨Ù±Ù\84Ú¯Ù±",
+       "tooltip-pt-login": "اÛ\8cÙ\85ا Ø§Ù\92Ú¯Û\8aÛ\8cÙ\85 Ú©Ø§Ù\92 Ø±Û\89Û\8cÙ\86 Ú¤Ø§Ù\85Û\8cÙ\9bÙ\86 Ø³Ø§Ù\85Ù\88Ù\86Ú¯Ù±: Ú¤Ø§Ù\92Ù\84Û\8c Ú\86Ù\88Ù\86Ù\88 Ú©Ø§Ø±Û\8c Ø§Ù\92ژباری نی",
+       "tooltip-pt-logout": "ز ساموناْ درٱڤوڌن",
+       "tooltip-pt-createaccount": "اÙ\8aسا Ù¾Ù\88شت Ú¯Ù±Ø±Ù\85 Ú¤Ø§Ø¨Û\8cÚ\8cÛ\8cÙ\86اÙ\92 Ú©Ø§Ù\92 Û\8cÙ± Ù\87ساÙ\88 Ø±Ø§Ø³Ø¯ Ú©Ù\88Ù\86Û\8cÙ\86 Ù\88 Ø¨Û\8cائÛ\8cÙ\86 Ú¤Ø§Ù\85Û\8cÙ\9bÙ\86. Ú¤Ø§Ù\92Ù\84Û\8c Ú\86Ù\88Ù\86Ù\88 Ú©Ø§Ø±Û\8c Ø§Ù\92ژباری نی.",
+       "tooltip-ca-talk": "Ú\86Ù±Ú© Ú\86Ù\86اÙ\92 Ø³Û\8c Ù\85Û\8cÙ\9bÙ\86Ù\88Ù\86اÙ\92 Ø¨Ù±Ù\84گاÙ\92",
        "tooltip-ca-edit": "ای بٱلگاْ نٱ آلشدکاری کو",
        "tooltip-ca-addsection": "شورۊ کردن یٱ بٱرجا دیٱ",
        "tooltip-ca-viewsource": "ای بٱلگاْ پٱر و پیم ڤابیڌاْ.\nایسا تاْرین سرچشماْساْ بڤنین",
        "tooltip-ca-protect": "ای بٱلگاْ ناْ پٱر و پیم کو",
        "tooltip-ca-delete": "ای بٱلگاْ ناْ پاکسا کو",
        "tooltip-ca-move": "جابجا کردن ای بٱلگاْ",
-       "tooltip-ca-watch": "اْزاف کردن ای بٱلگٱ ب سئیل بٱرگ خوتۊن",
+       "tooltip-ca-watch": "اْزاف کردن ای بٱلگاْ ب ساٛیل بٱرگ خوتوݩ",
        "tooltip-ca-unwatch": "ڤورداشتن بٱلگاْ ز ساٛیل بٱرگتۊن",
        "tooltip-search": "جوستن {{SITENAME}}",
-       "tooltip-search-go": "رۉ میٛن بٱلگاْیٱلی کاْ نوم راستٱکی داشتاْ بۊن",
-       "tooltip-search-fulltext": "بٱلگاْیٱل نٱ سی چونو نڤشداْیٱلی پاٛی جۊری کو",
+       "tooltip-search-go": "رۉ میٛن بٱلگاْیٱلی کاْ نوم راستٱکی داشتاْ بوݩ",
+       "tooltip-search-fulltext": "بٱلگاْیٱل ناْ سی چونو نڤشداْیٱلی پاٛی جۊری کو",
        "tooltip-p-logo": "بنیٱرین ب سرآسوناْ",
        "tooltip-n-mainpage": "بنیٱرین ب سرآسوناْ",
        "tooltip-n-mainpage-description": "بنیٱرین ب سرآسوناْ",
        "tooltip-t-emailuser": "فرشناڌن ب ٱنجوماناماْ {{GENDER:$1|ای کاریار}}",
        "tooltip-t-upload": "سوڤار کردن جانیایٱل",
        "tooltip-t-specialpages": "یٱ نومگٱ ز بٱلگاْیٱل ڤیجٱ",
-       "tooltip-t-print": "نوسقاْ پرینت گرهڌنی سی ای بٱلگٱ",
-       "tooltip-t-permalink": "هومپاٛیڤٱند دایومی سی ڤانیٱری بٱلگٱ",
-       "tooltip-ca-nstab-main": "دÛ\8cÚ\8cÙ\86 Ù\85Û\8cÙ\86Û\8aÙ\86Ù± Ø¨Ù±Ù\84Ú¯Ù±",
+       "tooltip-t-print": "نوسقاْ پرینت گرهڌنی سی ای بٱلگاْ",
+       "tooltip-t-permalink": "هومپاٛیڤٱند دایومی سی ڤانیٱری بٱلگاْ",
+       "tooltip-ca-nstab-main": "دÛ\8cÚ\8cÙ\86 Ù\85Û\8cÙ\9bÙ\86Ù\88Ù\86اÙ\92 Ø¨Ù±Ù\84گاÙ\92",
        "tooltip-ca-nstab-user": "دیڌن بٱلگاْ کاریار",
        "tooltip-ca-nstab-media": "دیدن صفحه مدیا",
        "tooltip-ca-nstab-special": "ای بٱلگاْ یٱ بٱلگاْ ڤیجاْ، و نیبۊ آلشدکاریس کونین",
        "tooltip-recreate": "ز نۉ راسد کردن بٱلگاْیی کاْ دینداتر پاکسا ڤابیڌاْ.",
        "tooltip-upload": "شورۊ سوڤار کرد",
        "tooltip-rollback": "\"ڤورگٱنیئن\" لرنیڌن سی هال و بال ٱڤٱل ای بٱلگٱ سی یو کاْ هومیاری نیایی سی بیتٱر کردن بۊ ٱلڤٱت ڤا یٱ کرٱت پۊرنیڌن.",
-       "tooltip-undo": "Ù±Ù\86جÙ\88Ù\85 Ù\86ٱگرÙ\87Ú\8cÙ\86 Ø§Û\8c Ø¢Ù\84شدکارÛ\8c Ù\86اÙ\92 Ú¤Ù\88رگٱÙ\86 Ù\88 Ù\87Ù±Ù\85اÙ\92 Ù\81Ù\88رÙ\85Ù±Ù\84 Ú¤Û\8cراÛ\8cشت Ú©Ø§Ø±Û\8cا Ù\86Ù± Ø¬Û\8aر Ù\87اÙ\84 Ù\88 Ø¨Ø§Ù\84 Ù¾Û\8cØ´ Ø³Ø¦یل کو. چونو کاری بتون سلا اْڌاْ کاْ ب چٱکستاْ خوتۊن یٱ دلیل اْزاف کونین.",
+       "tooltip-undo": "Ù±Ù\86جÙ\88Ù\85 Ù\86ٱگرÙ\87Ú\8cÙ\86 Ø§Û\8c Ø¢Ù\84شدکارÛ\8c Ù\86اÙ\92 Ú¤Ù\88رگٱÙ\86 Ù\88 Ù\87Ù±Ù\85اÙ\92 Ù\81Ù\88رÙ\85Ù±Ù\84 Ú¤Û\8cراÛ\8cشت Ú©Ø§Ø±Û\8cا Ù\86Ù± Ø¬Û\8aر Ù\87اÙ\84 Ù\88 Ø¨Ø§Ù\84 Ù¾Û\8cØ´ Ø³Ø§Ù\9bیل کو. چونو کاری بتون سلا اْڌاْ کاْ ب چٱکستاْ خوتۊن یٱ دلیل اْزاف کونین.",
        "tooltip-summary": "یٱ چکستاْ کۊچیر ناْ بیارین ڤامیٛن",
        "others": "دیٱروݩ",
        "simpleantispam-label": "Anti-spam check.\nپور<strong>نکنين</strong> ایچو ناْ!",
        "pageinfo-title": "ڌونائی زاْ «$1»",
        "pageinfo-header-basic": "ڌونائیٱل بٱلٛگاْ",
-       "pageinfo-header-edits": "ڤیرایشت ڤیرگار",
+       "pageinfo-header-edits": "آلدشکاری کردن ڤیرگار",
        "pageinfo-header-restrictions": "هناڌاری زاْ بٱلٛگاْ",
        "pageinfo-header-properties": "ؤیژگیٱل بٱلٛگاْ",
        "pageinfo-display-title": "نماونیڌن داسوݩ",
        "pageinfo-subpages-value": "1 ($2 {{PLURAL:$2|آلشڌتور|آلشڌ تور}}; $3 {{PLURAL:$3|خاٛراز آلشڌ تور|خاٛراز آلشڌ تور}})",
        "pageinfo-firstuser": "بٱلگاْ راس کون",
        "pageinfo-firsttime": "گات دروس ڤابیڌن بٱلگاْ",
-       "pageinfo-lastuser": "آخری ڤیرایشتکار",
-       "pageinfo-lasttime": "گات آخری ڤیرایشت",
+       "pageinfo-lastuser": "آخری آلشدکار",
+       "pageinfo-lasttime": "گات آخری آلشدکاری کردن",
        "pageinfo-edits": "کول آلشدکاریٱل",
        "pageinfo-authors": "شوماراْ کولی نڤیسیارٱل یٱکۊنٱ",
        "pageinfo-recent-edits": "شوماراْ آلشدکاریٱل ایسنی (د $1 دینداتر)",
        "metadata-help": "ای جانیا ز ڤٱرگرهڌاْ دۊنسمٱندیٱل اْزافیاْ کاْ هونو گاشا(شایڌ) ڤا دیربین دیجیتالی یا اْسکٱنر سی ڤا کار ڤٱندن یا راست کردنسۊن یا دیجیتالی کردنسۊن اْزاف ڤابیناْ. ٱر جانیا ز هال و بال ٱڤلی خو آلشد ڤابیڌاْ بۊ شایڌ تٱموم تۉزیات دۊنسمٱندیٱل ٱسگ نٱ دیاری نٱکوناْ.",
        "metadata-expand": "نشودادن جزئیات تفصیلی",
        "metadata-collapse": "قایم کردن جزئیات تفصیلی",
-       "metadata-fields": "رشناْیٱل گٱپ دۊنسمٱندیٱلی کاْ میٛن ای پاٛیغوم نومگٱ کاری ڤابیڌاْ ناْ ز ڤٱر گرهڌاْ بٱلگاْ ٱسگی کاْ گات ڤٱختی کاْ جٱدڤٱل گٱپ دۊنسمٱندیٱل ڤا اْبۊن دیاری کونن.\n*راست کو\n*مودل\n*مجال گات ٱسل\n*گات آشگار\n*اْف اْن شومارٱ\n*ایزو نرخ میٛن سورٱت\n*فوکالنس\n*هونٱرمٱند\n*کوپی رایت\n*هال و بال جی پی اْس \n*جی پی اْس گٱپ\n*جی پی اْس هٱماْ جۊرٱ",
+       "metadata-fields": "رشناْیٱل گٱپ دۊنسمٱندیٱلی کاْ میٛن ای پاٛیغوم نومگٱ کاری ڤابیڌاْ ناْ ز ڤٱر گرهڌاْ بٱلگاْ ٱسگی کاْ گات ڤٱختی کاْ جٱدڤٱل گٱپ دۊنسمٱندیٱل ڤا اْبۊن دیاری کونن.\n*راست کو\n*مودل\n*مجال گات ٱسل\n*گات آشگار\n*اْف اْن شوماراْ\n*ایزو نرخ میٛن سورٱت\n*فوکالنس\n*هونٱرمٱند\n*کوپی رایت\n*هال و بال جی پی اْس \n*جی پی اْس گٱپ\n*جی پی اْس هٱماْ جۊرٱ",
        "namespacesall": "هٱمٱ",
        "monthsall": "هٱمٱ",
        "confirm_purge_button": "خۊڤاْ",
        "logentry-delete-revision": "$1 دیاری {{PLURAL:$5|یٱ نوسخاْ|$5 نوسخاْ}} بٱلٛگاْ $3 ناْ{{GENDER:$2|آلشڌکرڌ}}: $4",
        "revdelete-content-hid": "هؽلنیڌناْ بؽڌیارکرڌ",
        "logentry-move-move": "$1 {{GENDER:$2|جا ب جا کرداْ}} بٱلگاْ $3 نٱ سی $4",
-       "logentry-move-move-noredirect": "$1 {{GENDER:$2|جا ب جا کرد}} بٱلگاْ $3 نٱ سی $4 بی یو یٱ ڤاگٱردۊنی داشداْ بۊ",
+       "logentry-move-move-noredirect": "$1 {{GENDER:$2|جا ب جا کرد}} بٱلگاْ $3 نٱ سی $4 بی یو یٱ ڤاگٱردونی داشداْ بۊ",
        "logentry-move-move_redir": "$1 بٱلٛگاْ $3 ناْ ڤاْ $4 کاْ آلشڌ تور ڤیڌاْ {{GENDER:$2|کل کرڌ}}",
        "logentry-patrol-patrol-auto": "$1 نوسخهٔ $4 بٱلٛگاْ $3 ناْ خودکار ڤاْ عنڤان لرخوؤٱرداٛ {{GENDER:$2|دزاْ کونین}}",
        "logentry-newusers-create": "هساڤ کاریاری $1 {{GENDER:$2|راسد ڤابی}}",
index bc596f2..f8e43e4 100644 (file)
        "logentry-suppress-block": "$1 $3ی بۆ ماوەی $5 $6 بەربەست کرد",
        "logentry-suppress-reblock": "$1 ھەڵبژاردەکانی بەربەستنی $3ی گۆڕی بە ماوەی بەسەرچوونی $5 $6",
        "logentry-import-upload": "$1 {{GENDER:$2|بارکرد}} $3 بە بەکارھێنانی [[special:Import|بارکەر]]",
+       "logentry-import-interwiki": "$1 $3ی لە ویکییەکی ترەوە ھاوردەکرد",
        "logentry-import-interwiki-details": "$1 $3ی لە $5ەوە ھەناردە کرد ($4 بەسەرداچوونەوە)",
        "logentry-move-move": "$1 پەڕەی $3ی {{GENDER:$2|گواستەوە}} بۆ $4",
        "logentry-move-move-noredirect": "$1 پەڕەی $3ی بە بێ بەجێھشتنی ڕەوانەکەرێک {{GENDER:$2|گواستەوە}} بۆ $4",
        "log-action-filter-block": "جۆری بلۆک:",
        "log-action-filter-contentmodel": "جۆری گۆڕینی مۆدێلی ناوەڕۆک:",
        "log-action-filter-delete": "جۆری سڕینەوە:",
+       "log-action-filter-import": "جۆری ھاوردن:",
        "log-action-filter-all": "ھەموو",
        "log-action-filter-block-block": "بەربەستن",
        "log-action-filter-block-unblock": "ھەڵگرتنی بەربەستن",
index ac4a792..2834381 100644 (file)
        "ipb-confirm": "Potvrdit zablokování",
        "ipb-sitewide": "Na celém projektu",
        "ipb-partial": "Částečný",
+       "ipb-sitewide-help": "Všechny stránky na wiki a všechny ostatní způsoby přispívání.",
+       "ipb-partial-help": "Konkrétní stránky nebo jmenné prostory.",
        "ipb-pages-label": "Stránky",
        "ipb-namespaces-label": "Jmenné prostory",
        "badipaddress": "Neplatná IP adresa",
        "ipb_expiry_old": "Čas vypršení je v minulosti.",
        "ipb_expiry_temp": "Blokování skrytých uživatelských jmen by měla být trvalá.",
        "ipb_hide_invalid": "Tento účet nelze utajit; má více než $1 {{PLURAL:$1|editaci|editace|editací}}.",
+       "ipb_hide_partial": "Zablokování se skrytím uživatelského jména musí platit na celém projektu.",
        "ipb_already_blocked": "„$1“ již je zablokován.",
        "ipb-needreblock": "$1 je již {{GENDER:$1|zablokován|zablokována|zablokován(a)}}. Chcete změnit nastavení bloku?",
        "ipb-otherblocks-header": "{{PLURAL:$1|Jiné zablokování|Jiná zablokování}}",
        "passwordpolicies-policy-passwordcannotbepopular": "Heslo nesmí být {{PLURAL:$1|dané oblíbené heslo|v seznamu $1 oblíbených hesel}}",
        "passwordpolicies-policy-passwordnotinlargeblacklist": "Heslo nesmí být v seznamu 100 000 nejčastěji používaných hesel.",
        "passwordpolicies-policyflag-forcechange": "nutné změnit při přihlášení",
+       "passwordpolicies-policyflag-suggestchangeonlogin": "navrhnout změnu při přihlášení",
        "easydeflate-invaliddeflate": "Poskytnutý obsah nebyl správně zkomprimován",
        "unprotected-js": "Z bezpečnostních důvodů nelze načítat JavaScript z nechráněných stran. Vyrábějte prosím JavaScriptové skripty jen ve jmenném prostoru MediaWiki: nebo jako uživatelskou podstránku"
 }
index c71c147..f23fc0e 100644 (file)
        "tog-enotifminoredits": "Auch bei kleinen Änderungen an Seiten und Dateien E-Mails senden",
        "tog-enotifrevealaddr": "Meine E-Mail-Adresse in Benachrichtigungs-E-Mails anzeigen",
        "tog-shownumberswatching": "Anzahl der beobachtenden Benutzer anzeigen",
-       "tog-oldsig": "Die vorhandene Signatur:",
+       "tog-oldsig": "Die genutzte Signatur:",
        "tog-fancysig": "Signatur als Wikitext behandeln (ohne automatische Verlinkung)",
        "tog-uselivepreview": "Vorschau ohne Neuladen der Seite anzeigen",
        "tog-forceeditsummary": "Warnen, sofern beim Speichern die Zusammenfassung fehlt",
index fe41bb3..8df2180 100644 (file)
        "grant-group-watchlist-interaction": "Lista da xoya tesir",
        "grant-group-email": "e-poste bırışe",
        "grant-group-high-volume": "Performansa aktiviteya vengê berzi",
-       "grant-group-customization": "Şexsi kerdış u tercihi",
+       "grant-group-customization": "Xısusikerdış û tercihi",
        "grant-group-administration": "Performans hereketa idarey",
        "grant-group-private-information": "Melumatê xısusiyê ke heqa şıma derê, bıresê inan",
        "grant-group-other": "Enwayi babet aktivitey",
index 28e0b05..3b0c524 100644 (file)
        "deleting-backlinks-warning": "<strong>Warning:</strong> [[Special:WhatLinksHere/{{FULLPAGENAME}}|Other pages]] link to or transclude the page you are about to delete.",
        "deleting-subpages-warning": "<strong>Warning:</strong> The page you are about to delete has [[Special:PrefixIndex/{{FULLPAGENAME}}/|{{PLURAL:$1|a subpage|$1 subpages|51=over 50 subpages}}]].",
        "rollback": "Roll back edits",
+       "rollback-confirmation-confirm": "Rollback of {{PLURAL:$1|0=these edits|one edit|$1 edits}}?",
+       "rollback-confirmation-yes": "Rollback",
+       "rollback-confirmation-no": "Cancel",
        "rollbacklink": "rollback",
        "rollbacklinkcount": "rollback $1 {{PLURAL:$1|edit|edits}}",
        "rollbacklinkcount-morethan": "rollback more than $1 {{PLURAL:$1|edit|edits}}",
index c39fb38..4fbc4ec 100644 (file)
        "ipb-confirm": "Confirmar bloqueo",
        "ipb-sitewide": "En todo el sitio",
        "ipb-partial": "Parcial",
-       "ipb-sitewide-help": "Todas las páginas en la Wiki y todas las acciones de contribución.",
+       "ipb-sitewide-help": "Todas las páginas del wiki y el resto de las acciones de contribución.",
        "ipb-partial-help": "Páginas concretas o espacios de nombres.",
        "ipb-pages-label": "Páginas",
        "ipb-namespaces-label": "Espacios de nombres",
index c6c1906..03fc793 100644 (file)
        "exif-iimcategory-hth": "Weşeyey",
        "exif-iimcategory-hum": "Elekey merduman",
        "exif-iimcategory-lab": "Gurweyayin",
-       "exif-iimcategory-lif": "Cıwiyayış u keyf kerdış",
+       "exif-iimcategory-lif": "Cıwiyayış û keyfkerdış",
        "exif-iimcategory-pol": "Siyaset",
-       "exif-iimcategory-rel": "Din u iman kerdış",
+       "exif-iimcategory-rel": "Din û baweriye",
        "exif-iimcategory-sci": "Zanış u teknoloci",
        "exif-iimcategory-soi": "Sosyal meseley",
        "exif-iimcategory-spo": "Spor",
index 13454d1..9c4c047 100644 (file)
@@ -4,7 +4,8 @@
                        "Ebraminio",
                        "Huji",
                        "Meisam",
-                       "ZxxZxxZ"
+                       "ZxxZxxZ",
+                       "Reza1615"
                ]
        },
        "exif-imagewidth": "عرض",
@@ -52,6 +53,7 @@
        "exif-exposuretime": "زمان نوردهی",
        "exif-exposuretime-format": "$1 ثانیه ($2)",
        "exif-fnumber": "ضریب اف",
+       "exif-fnumber-format": "f/$1",
        "exif-exposureprogram": "برنامهٔ نوردهی",
        "exif-spectralsensitivity": "حساسیت طیفی",
        "exif-isospeedratings": "درجه‌بندی سرعت ایزو",
        "exif-compression-4": "رمزگذاری نمابر سی‌سی‌آی‌تی‌تی گروه ۴",
        "exif-copyrighted-true": "دارای حق تکثیر",
        "exif-copyrighted-false": "وضعیت حق‌تکثیر تعیین نشده است",
+       "exif-photometricinterpretation-0": "سیاه و سفید (سفید ۰ است)",
        "exif-photometricinterpretation-1": "سیاه و سفید (سیاه ۰ است)",
+       "exif-photometricinterpretation-3": "پالت",
+       "exif-photometricinterpretation-4": "شفافیت پوشش",
+       "exif-photometricinterpretation-5": "جداشده (احتمالاُ CMYK)",
+       "exif-photometricinterpretation-8": "CIE L*a*b*",
+       "exif-photometricinterpretation-9": "CIE L*a*b* (رمزنگاری ICC)",
+       "exif-photometricinterpretation-10": "CIE L*a*b* (رمزنگاری ITU)",
        "exif-unknowndate": "تاریخ نامعلوم",
        "exif-orientation-1": "عادی",
        "exif-orientation-2": "افقی پشت و روشده",
index 4c19e31..43c77e8 100644 (file)
        "exif-writer": "نیسنه",
        "exif-languagecode": "زون",
        "exif-iimversion": "نسقه آی آی ام",
-       "exif-iimcategory": "دسه",
+       "exif-iimcategory": "دٱسٱ",
        "exif-iimsupplementalcategory": "دسه یا اضافی",
        "exif-datetimeexpires": "وا نها دش استفاده نبوئه",
        "exif-datetimereleased": "ول بیه د",
index 405a3c1..f30c520 100644 (file)
@@ -39,7 +39,7 @@
        "exif-rowsperstrip": "Number of rows per strip",
        "exif-stripbytecounts": "Bytes per compressed strip",
        "exif-jpeginterchangeformat": "Offset to JPEG SOI",
-       "exif-jpeginterchangeformatlength": "Bytes of JPEG data",
+       "exif-jpeginterchangeformatlength": "JPEG verilerinin baytı",
        "exif-whitepoint": "Beyaz nokta kromatiği",
        "exif-primarychromaticities": "Chromaticities of primarities",
        "exif-ycbcrcoefficients": "Renk aralığı dönüştürme matris katsayısı",
index 9086e42..e0316b3 100644 (file)
@@ -71,7 +71,8 @@
                        "Amirsara",
                        "Physicsch",
                        "Nbi",
-                       "Amjad Khan"
+                       "Amjad Khan",
+                       "Ahmad252"
                ]
        },
        "tog-underline": "خط کشیدن زیر پیوندها:",
        "subject-preview": "پیش‌نمایش موضوع:",
        "previewerrortext": "در زمان تلاش برای نمایش دادن تغییرات شما، خطایی رخ داد.",
        "blockedtitle": "کاربر بسته شده‌است",
+       "blockedtext-partial": "<strong>حساب کاربری یا آدرس آی‌پی شما از انجام تغییرات در این صفحه منع شده‌است. شما همچنان می‌توانید در دیگر صفحه‌های این ویکی ویرایش کنید.</strong> برای مشاهده جزئیات کامل قطع دسترسی به [[ویژه:مشارکت‌های من|مشارکت‌های حساب]] مراجعه کنید.\n\nاین قطع دسترسی توسط $1 انجام گرفته‌است.\n\nدلیل قطع دسترسی <em>$2</em> است.\n\n* زمان آغاز قطع دسترسی: $8\n* زمان پایان قطع دسترسی: $6\n* موارد مورد نظر: $7\n* شناسه قطع دسترسی: #$5",
        "blockedtext": "<strong>دسترسی حساب کاربری یا نشانی آی‌پی شما بسته شده‌است.</strong>\n\nاین قطع دسترسی توسط $1 انجام شده است.\nدلیل ارائه‌شده چنین است: <em>$2</em>\n\n* شروع قطع دسترسی: $8\n* پایان قطع دسترسی: $6\n* کاربری هدف قطع دسترسی: $7\n\nشما می‌توانید با $1 یا [[{{MediaWiki:Grouppage-sysop}}|مدیری]] دیگر تماس بگیرید و در این باره صحبت کنید.\nتوجه کنید که شما نمی‌توانید از قابلیت «{{int:emailuser}}» استفاده کنید مگر آنکه آدرس ایمیل معتبری در [[Special:Preferences|ترجیحات کاربری]] خودتان ثبت کرده باشید و نیز باید امکان استفاده از این قابلیت برای شما قطع نشده باشد.\nنشانی آی‌پی فعلی شما $3 و شمارهٔ قطع دسترسی شما $5 است.\nلطفاً تمامی جزئیات فوق را در کلیهٔ درخواست‌هایی که در این باره مطرح می‌کنید ذکر کنید.",
        "autoblockedtext": "دسترسی نشانی آی‌پی شما قطع شده‌است، زیرا این نشانی آی‌پی توسط کاربر دیگری استفاده شده که دسترسی او توسط $1 قطع شده‌است.\nدلیل ارائه‌شده چنین است:\n\n:''$2''\n\n* شروع قطع دسترسی: $8\n* پایان قطع دسترسی: $6\n* کاربری هدف قطع دسترسی: $7\n\nشما می‌توانید با $1 یا [[{{MediaWiki:Grouppage-sysop}}|مدیری]] دیگر تماس بگیرید و در این باره صحبت کنید.\nتوجه کنید که شما نمی‌توانید از قابلیت «{{int:emailuser}}» استفاده کنید مگر آنکه نشانی ایمیل معتبری در [[Special:Preferences|ترجیحات کاربری]] خودتان ثبت کرده باشید و نیز باید امکان استفاده از این قابلیت برای شما قطع نشده باشد.\nنشانی آی‌پی فعلی شما $3 و شمارهٔ قطع دسترسی شما $5 است.\nلطفاً تمامی جزئیات فوق را در کلیهٔ درخواست‌هایی که در این باره مطرح می‌کنید ذکر کنید.",
        "systemblockedtext": "نام کاربری یا نشانی آی‌پی شما خودکار توسط مدیاویکی مسدود شده‌است.\nدلیل ارائه‌شده:\n\n:<em>$2</em>\n\n* آغاز بلاک: $8\n* پایان بلاک: $6\n* قطع دسترسی‌شده مورد نظر: $7\n\nنشانی آی‌پی کنونی شما $3 است.\nخواهشمند است تمام جزئیات بالا را در هر پرس‌وجویی که انجام می‌دهید قرار دهید.",
        "accmailtext": "یک گذرواژهٔ تصادفی برای [[User talk:$1|$1]] به $2 فرستاده شد. می‌توان آن را از صفحهٔ ''[[Special:ChangePassword|تغییر گذرواژه]]'' که هنگام ثبت ورود نمایش می‌یابد تغییر داد.",
        "newarticle": "(تازه)",
        "newarticletext": "شما پیوندی را دنبال کرده‌اید و به صفحه‌ای رسیده‌اید که هنوز وجود ندارد.\nبرای ایجاد صفحه، در مستطیل زیر شروع به نوشتن کنید (برای اطلاعات بیشتر به [$1 صفحهٔ راهنما] مراجعه کنید).\nاگر به اشتباه اینجا آمده‌اید، دکمهٔ «بازگشت» مرورگرتان را بزنید.",
-       "anontalkpagetext": "----<em>این صفحهٔ بحث برای کاربر گمنامی است که هنوز حسابی درست نکرده است یا از آن استفاده نمی‌کند.\nبنا بر این برای شناسایی‌اش مجبوریم از نشانی آی‌پی عددی استفاده کنیم.</em>\nچنین نشانی‌های آی‌پی ممکن است توسط چندین کاربر به شکل مشترک استفاده شود.\nاگر شما کاربر گمنامی هستید و تصور می‌کنید اظهار نظرات نامربوط به شما صورت گرفته است، لطفاً برای پیشگیری از اشتباه گرفته شدن با کاربران گمنام دیگر در آینده [[Special:CreateAccount|حسابی ایجاد کنید]] یا [[Special:UserLogin|به سامانه وارد شوید]].",
+       "anontalkpagetext": "----<em>این صفحهٔ بحث برای کاربر گمنامی است که هنوز حسابی درست نکرده است یا از آن استفاده نمی‌کند.\nبنا بر این برای شناسایی‌اش مجبوریم از نشانی آی‌پی عددی استفاده کنیم.</em> \nچنین نشانی‌های آی‌پی ممکن است توسط چندین کاربر به شکل مشترک استفاده شود.\nاگر شما کاربر گمنامی هستید و تصور می‌کنید اظهار نظرات نامربوط به شما صورت گرفته است، لطفاً برای پیشگیری از اشتباه گرفته شدن با کاربران گمنام دیگر در آینده [[Special:CreateAccount|حسابی ایجاد کنید]] یا [[Special:UserLogin|به سامانه وارد شوید]].",
        "noarticletext": "این صفحه هم‌اکنون دارای هیچ متنی نیست.\nشما می‌توانید در صفحه‌های دیگر [[Special:Search/{{PAGENAME}}|عنوان این صفحه را جستجو کنید]]،\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} سیاهه‌های مرتبط را جستجو کنید]،\nیا [{{fullurl:{{FULLPAGENAME}}|action=edit}} این صفحه را ایجاد کنید]</span>.",
        "noarticletext-nopermission": "این صفحه هم‌اکنون متنی ندارد.\nشما می‌توانید در دیگر صفحات [[Special:Search/{{PAGENAME}}|این عنوان را جستجو کنید]]،\nیا <span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} سیاهه‌های مرتبط را بگردید]</span> ولی شما اجازه ایجاد این صفحه را ندارید.",
        "missing-revision": "ویرایش #$1 از صفحهٔ «{{FULLPAGENAME}}» موجود نیست.\n\nاین اتفاق معمولاً در اثر دنبال کردن پیوندی به تاریخچهٔ یک صفحهٔ حذف‌شده پیش می‌آید.\nمی‌توانید جزئیات بیشتر را در [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} سیاههٔ حذف] بیابید.",
        "ipb-disableusertalk": "ویرایش صفحهً بحث توسط خود کاربر",
        "ipb-change-block": "بستن دوبارهٔ کاربر با این تنظیم‌ها",
        "ipb-confirm": "تأیید بستن",
-       "ipb-partial": "جزئی",
+       "ipb-sitewide": "کلی",
+       "ipb-partial": "موردی",
+       "ipb-sitewide-help": "هر صفحه‌ای در ویکی و تمام فعالیت‌های مشارکتی دیگر",
+       "ipb-partial-help": "صفحات خاص یا فضاهای نامی",
        "ipb-pages-label": "صفحات",
        "ipb-namespaces-label": "فضاهای نام",
        "badipaddress": "نشانی آی‌پی نامعتبر",
        "log-action-filter-suppress-reblock": "مخفی‌سازی کاربر با بستن مجدد",
        "log-action-filter-upload-upload": "بارگذاری جدید",
        "log-action-filter-upload-overwrite": "بارگذاری دوباره",
+       "log-action-filter-upload-revert": "واگردانی",
        "authmanager-authn-not-in-progress": "ارزیابی ورود در جريان نيست یا اطلاعات جلسه کاری از بين رفته است. لطفاً دوباره از ابتدا شروع کنيد.",
        "authmanager-authn-no-primary": "اعتبارسنجی اطلاعات ارائه شده جهت ورود ميسر نيست",
        "authmanager-authn-no-local-user": "اطلاعات ورود ارائه شده با هيچ کاربری در اين ويکی مرتبط نيست",
index 31efa81..c504973 100644 (file)
@@ -25,7 +25,7 @@
                ]
        },
        "tog-underline": "Keppelings ûnderstreekje:",
-       "tog-hideminor": "Tekstwizigings wei litte út 'Koartlyn feroare'",
+       "tog-hideminor": "Feroarings fan lytse betsjutting ferbergje yn Koartlyn feroare",
        "tog-hidepatrolled": "Markearre feroarings ferskûlje yn resinte feroarings",
        "tog-newpageshidepatrolled": "Markearre siden ferskûlje yn 'e list mei nije siden",
        "tog-extendwatchlist": "Wreidzje folchlist út om alle wizigings sjen te litten, net allinnich de lêste wizigings",
        "tog-watchdefault": "Sides dy't jo feroare hawwe folgje",
        "tog-watchmoves": "Siden dy't jo werneamd hawwe folgje",
        "tog-watchdeletion": "Siden dy't jo wiske hawwe folgje",
-       "tog-minordefault": "Feroarings yn it earst oanjaan as tekstwizigings.",
+       "tog-minordefault": "Markearje alle feroarings standert as fan lytse betsjutting",
        "tog-previewontop": "By it neisjen, bewurkingsfjild ûnderoan sette",
        "tog-previewonfirst": "Lit foarbyld sjen by earste wiziging",
        "tog-enotifwatchlistpages": "E-mail my as in side op myn folchlist feroare is.",
        "tog-enotifusertalkpages": "E-mail my as myn oerlisside feroare wurdt",
-       "tog-enotifminoredits": "E-mail my ek by lytse feroarings fan siden op myn folchlist",
+       "tog-enotifminoredits": "E-mail my ek by feroarings fan lytse betsjutting oan siden en bestannen",
        "tog-enotifrevealaddr": "Myn e-mailadres sjen litte yn e-mailberjochten",
        "tog-shownumberswatching": "It tal meidoggers sjen litte dat dizze side folget",
        "tog-oldsig": "Aktuele sinjatuerprintallyk:",
@@ -51,7 +51,7 @@
        "tog-forceeditsummary": "Warskôgje at ik de gearfetting leech lit.",
        "tog-watchlisthideown": "Eigen bewurkings op myn folchlist ferbergje",
        "tog-watchlisthidebots": "Lit gjin bot wizigings sjen yn de folchlist",
-       "tog-watchlisthideminor": "Lit gjin tekstwizigings sjen yn de folchlist",
+       "tog-watchlisthideminor": "Feroarings fan lytse betsjutting ferbergje yn de folchlist",
        "tog-watchlisthideliu": "Bewurkings fan oanmelde meidoggers op myn folchlist ferbergje",
        "tog-watchlisthideanons": "Bewurkings fa anonyme meidoggers op myn folchlist ferbergje",
        "tog-watchlisthidepatrolled": "Markearre feroarings op myn folchlist ferskûlje",
        "categorypage": "Besjoch kategoryside",
        "viewtalkpage": "Oerlisside",
        "otherlanguages": "In oare talen",
-       "redirectedfrom": "(Trochwiisd fan \"$1\")",
+       "redirectedfrom": "(Trochwiisd fan $1)",
        "redirectpagesub": "Trochferwiis-side",
        "lastmodifiedat": "Dizze side is it lêst bewurke op $1 om $2.",
        "viewcount": "Disse side is {{PLURAL:$1|ienris|$1 kear}} iepenslein.",
        "hr_tip": "Horizontale line (mei ferdrach brûke)",
        "summary": "Gearfetting:",
        "subject": "Underwerp:",
-       "minoredit": "Dit is in tekstwiziging",
+       "minoredit": "Dit is fan lytse betsjutting",
        "watchthis": "Folgje dizze side",
        "savearticle": "Side bewarje",
        "publishpage": "Side fêstlizze",
        "anontalkpagetext": "----\n<em>Dit is de oerlisside fan in ûnbekende meidogger; in meidogger dy't him/har net oanmeld hat.</em>\nOm't der gjin namme bekend is, wurdt it ynternet-adres brûkt om oan te jaan om wa't it giet.\nMar faak is it sa dat sa'n adres net altyd troch deselde persoan brûkt wurdt.\nAs jo it idee hawwe dat jo as ûnbekende meidogger opmerkings foar in oar krije, dan kinne jo jo [[Special:CreateAccount|registrearje]], of jo [[Special:UserLogin|oanmelde]]. Fan in oanmelde meidogger is it ynternet-adres net sichtber, en as oanmelde meidogger krije jo allinnich opmerkings dy't foar josels bedoeld binne.",
        "noarticletext": "Der stjit noch gjin tekst op dizze side. Jo kinne\n[[Special:Search/{{PAGENAME}}|hjirboppe nei dy tekst sykje]], of [{{fullurl:{{FULLPAGENAME}}|action=edit}} de side skriuwe].",
        "userpage-userdoesnotexist": "Jo bewurkje in meidoggerside fan in meidogger dy't net bestiet (meidogger \"<nowiki>$1</nowiki>\").\nKontrolearje oft jo dizze side wol oanmeitsje/bewurkje wolle.",
+       "userpage-userdoesnotexist-view": "It meidochakkount \"$1\" bestiet net.",
        "clearyourcache": "<strong>Opmerking:</strong> Nei it fêstlizzen kin it nedich wêze de oerslach fan dyn blêder te leegjen foardat de wizigings te sjen binne.\n* <strong>Firefox / Safari:</strong> Hâld <em>Shift</em> yntreaun wylst jo op <em>Dizze side fernije</em> klikke, of typ <em>Ctrl-F5</em> of <em>Ctrl-R</em> (<em>⌘-R</em> op in Mac)\n* <strong>Google Chrome:</strong> Typ <em>CTRL-Shift-R</em> (<em>⌘-Shift-R</em> op in Mac)\n* <strong>Internet Explorer:</strong> Hâld <em>Ctrl</em> yntreaun wylst jo <em>Vernieuwen'' klikke of typ <em>Ctrl-F5</em>\n* <strong>Opera:</strong> Leegje jo cache yn <em>Extra → Voorkeuren</em>",
        "usercssyoucanpreview": "<strong>Tip:</strong> Brûk de knop \"{{int:showpreview}}\" om jo nije CSS te testen foar it fêstlizzen.",
        "userjsyoucanpreview": "<strong>Tip:</strong> Brûk de knop \"{{int:showpreview}}\" om jo nije JS te testen foar it fêstlizzen.",
        "last": "foarige",
        "page_first": "earste",
        "page_last": "lêste",
-       "histlegend": "Utlis: (no) = ferskil mei de side sa't dy no is,\n(doe) = ferskill mei de side sa't er doe wie, foar de feroaring, T = Tekstwiziging",
+       "histlegend": "Ferskil oanjaan: Markearje de rûntsjes fan 'e te ferlykjen ferzjes, en druk op Enter of de knop ûnderoan.<br />\nLeginda: <strong>({{int:cur}})</strong> = ferskil mei de lêste ferzje, <strong>({{int:last}})</strong> = ferskil mei de eardere ferzje, <strong>{{int:minoreditletter}}</strong> = lytse feroaring.",
        "history-fieldset-title": "Troch skiednis blêdzje",
        "histfirst": "âldste",
        "histlast": "nijste",
        "prefs-email": "E-mail",
        "prefs-rendering": "Uterlik",
        "saveprefs": "Bewarje",
-       "restoreprefs": "Tebek nei de standertynstellings",
+       "restoreprefs": "Alle standertynstellings weromsette (yn alle parten)",
        "prefs-editing": "Siden bewurkje",
        "searchresultshead": "Sykje",
        "stub-threshold": "Drompel foar markearring <a href=\"#\" class=\"stub\">stobbe</a> (bytes):",
        "default": "standert",
        "prefs-files": "Bestannen",
        "prefs-custom-js": "Persoanlik JS",
+       "prefs-reset-intro": "Jo kinne dizze side brûke, en set jo ynstellings werom nei de websteestandert.\nDit kin net ûngedien makke wurde.",
        "prefs-emailconfirm-label": "E-mailbefêstiging:",
        "youremail": "E-mail:",
        "username": "{{GENDER:$1|Meidochnamme}}:",
        "right-createpage": "Siden oanmeitsjen (net oerlissiden)",
        "right-createtalk": "Oerlissiden oanmeitsjen",
        "right-createaccount": "Nije meidoggers oanmeitsje",
-       "right-minoredit": "Bydragen markearje as tekstwiziging",
+       "right-minoredit": "Feroarings as fan lytse betsjutting markearje",
        "right-move": "Siden werneamen",
        "right-move-subpages": "Siden ynklusyf har subsiden ferpleatse.",
        "right-move-rootuserpages": "Meidoggersiden fan it heechste nivo in oare namme jaan",
        "right-purge": "De cache foar in side leegje sûnder befêstiging",
        "right-autoconfirmed": "Hat gjin op IP-adres basearre tiidsôfhinklike beheinings",
        "right-bot": "Behannele wurde as in automatisearre proses",
-       "right-nominornewtalk": "Lytse bewurkings oan in oerlisside liede net ta in melding 'nije berjochten'",
+       "right-nominornewtalk": "Feroarings fan lytse betsjutting oan in oerlisside liede net ta in melding 'nije berjochten'",
        "right-apihighlimits": "Hegere limiten yn API-sykopdrachten brûke",
        "right-writeapi": "Bewurkje fia API",
        "right-delete": "Siden wiskje",
        "action-createpage": "siden oan te meitsjen",
        "action-createtalk": "oerlissiden oan te meitsjen",
        "action-createaccount": "oanmeitsjen fan dit meidochakkount",
-       "action-minoredit": "dizze bewurking as lyts te markearjen",
+       "action-minoredit": "dizze feroaring as fan lytse betsjutting te markearjen",
        "action-move": "dizze side in oare namme te jaan",
        "action-move-subpages": "dizze side en de derby hearrende subsiden in oare namme te jaan",
        "action-move-rootuserpages": "meidoggersiden fan it heechste nivo in oare namme te jaan",
        "recentchanges-summary": "Folgje de lêste feroarings oan 'e wiki op dizze side.",
        "recentchanges-feed-description": "Mei dizze feed kinne jo de nijste feroarings yn dizze wiki besjen.",
        "recentchanges-label-newpage": "Mei dizze wiziging is in nije side makke",
-       "recentchanges-label-minor": "Dit is in tekstwiziging",
+       "recentchanges-label-minor": "Dizze feroaring is fan lytse betsjutting",
        "recentchanges-label-bot": "Dizze bewurking is troch in bot útfierd",
        "recentchanges-label-unpatrolled": "Dizze wiziging is noch net neisjûn",
        "recentchanges-label-plusminus": "De sidegrutte is mei dit oantal bytes wizige",
        "rcfilters-legend-heading": "<strong>List fan ôfkoartings:</strong>",
        "rcnotefrom": "Dit binne de feroarings sûnt <b>$2</b> (maksimaal <b>$1</b>).",
        "rclistfrom": "Jou nije feroarings, begjinnende mei $3 $2",
-       "rcshowhideminor": "$1 tekstwizigings",
+       "rcshowhideminor": "lytse feroarings $1",
        "rcshowhideminor-show": "werjaan",
        "rcshowhideminor-hide": "ferbergje",
        "rcshowhidebots": "bots $1",
        "hist": "skied.",
        "hide": "gjin",
        "show": "al",
-       "minoreditletter": "T",
+       "minoreditletter": "L",
        "newpageletter": "N",
        "boteditletter": "b",
        "unpatrolledletter": "!",
        "upload_directory_missing": "De heechlaadmap ($1) is der net en koe net oanmakke wurde troch de webserver.",
        "upload_directory_read_only": "De webserver kin net skriuwe yn de oanbiedpad ($1).",
        "uploaderror": "Oanbiedfout",
-       "uploadtext": "Om in nije bestannen oan te bieden, brûke jo de ûndersteande formulier. Earder oanbeane bestannen, kinne jo fine op de [[Special:FileList|list fan oanbeane ôfbylden]].\nWat oanbean en wat wiske wurdt, wurdt delskreaun yn it [[Special:Log/upload|lochboek]].\n\nOm it bestân yn in side op te nimmen, meitsje jo dêr sa'n keppeling:\n*'''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:jo_foto.jpg]]</nowiki></code>''', foar grutte ferzje,\n*'''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:jo_logo.png|omskriuwing]]</nowiki></code>''' foar 200 in piksel ferzje, mei 'alternative tekst' as beskriuwing, of\n*'''<code><nowiki>[[</nowiki>{{ns:media}}<nowiki>:jo_lûd.ogg]]</nowiki></code>''', foar direkt keppeling nei it bestân (sûnder byld).",
+       "uploadtext": "Brûk it formulier dat hjir folget om bestannen op te laden.\nGean nei de [[Special:FileList|bestânslist]], om earder opladen bestannen te besjen of op te sykjen. De (wer)opladen bestannen wurde ek opnommen yn it [[Special:Log/upload|oanbiedloch]], fuortsmiten bestannen yn it [[Special:Log/delete|wiskloch]].\n\nBrûk in keppeling yn ien fan 'e neikommende foarmen, en heakje in bestân oan in side ta:\n* <strong><code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:Bestân.jpg]]</nowiki></code></strong> om de folsleine ferzje fan it bestân te brûken\n* <strong><code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:Bestân.png|200px|thumb|left|alt. tekst]]</nowiki></code></strong> om in ôfbylding fan 200 pixel breed te brûken, yn in ramt oan de lofter kant mei \"alt. tekst\" as beskriuwing\n* <strong><code><nowiki>[[</nowiki>{{ns:media}}<nowiki>:Bestân.ogg]]</nowiki></code></strong> foar it sûnder werjefte, streekrjocht ferwizen nei it bestân",
        "upload-permitted": "Talitten bestânstypen: $1.",
        "upload-preferred": "Oanwiisde bestânstypen: $1.",
        "upload-prohibited": "Ferbeane bestânstypen: $1.",
        "filehist-deleteone": "fuortsmite",
        "filehist-revert": "werom sette",
        "filehist-current": "lêste",
-       "filehist-datetime": "Tiid",
+       "filehist-datetime": "Datum/tiid",
        "filehist-thumb": "Miniatuer",
        "filehist-thumbtext": "Miniatuer foar de ferzje sûnt $1",
        "filehist-nothumb": "Gjin miniatuerôfbylding",
        "nolinkstoimage": "Der binne gjin siden oan dit ôfbyld keppele.",
        "morelinkstoimage": "[[Special:WhatLinksHere/$1|Mear ferwizings]] nei dit bestân besjen.",
        "duplicatesoffile": "{{PLURAL:$1|It|De}} neikommend{{PLURAL:$1|&#32;bestân is|e $1 bestannen binne}} identyk oan dit bestân ([[Special:FileDuplicateSearch/$2|mear bysûnderheden]]):",
-       "sharedupload": "Dit bestân komt fan $1 en kin ek troch oare projekten brûkt wurde.",
+       "sharedupload": "Dit bestân komt fan $1, en kin ek troch oare projekten brûkt wurde.",
+       "sharedupload-desc-here": "Dit bestân komt fan $1, en kin ek troch oare projekten brûkt wurde.\nDe beskriuwing op syn [$2 bestânsside] dêre wurdt hjirûnder werjûn.",
        "filepage-nofile": "Der bestiet gjin bestân mei sa'n namme.",
        "filepage-nofile-link": "Der bestiet gjin bestân mei sa'n namme [bied $1 oan].",
        "uploadnewversion-linktext": "Bied in nije ferzje fan dit bestân oan",
        "tooltip-ca-nstab-template": "Sjabloan sjen litte",
        "tooltip-ca-nstab-help": "Helpside sjen litte",
        "tooltip-ca-nstab-category": "Kategory-side sjen litte",
-       "tooltip-minoredit": "Markearje dit as in lytse feroaring",
+       "tooltip-minoredit": "Markearje dizze feroaring as fan lytse betsjutting",
        "tooltip-save": "Jo feroarings bewarje",
        "tooltip-preview": "Oerlêze foar't de side fêstlein is!",
        "tooltip-diff": "Sjen litte hokker feroarings jo yn'e tekst makke hawwe.",
        "days-abbrev": "$1 d",
        "seconds": "{{PLURAL:$1|$1 sekonde|$1 sekonden}}",
        "minutes": "{{PLURAL:$1|$1 minút|$1 minuten}}",
-       "hours": "{{PLURAL:$1|$1 oere|$1 oere}}",
+       "hours": "{{PLURAL:$1|$1 oere|$1 oeren}}",
        "days": "{{PLURAL:$1|$1 dei|$1 dagen}}",
        "weeks": "{{PLURAL:$1|$1 wike|$1 wiken}}",
        "months": "{{PLURAL:$1|$1 moanne|$1 moannen}}",
        "htmlform-cloner-delete": "Fuortsmite",
        "revdelete-restricted": "hat beheinings oplein oan behearders",
        "revdelete-unrestricted": "hat beheinings foar behearders goedmakke",
+       "logentry-newusers-create": "It meidochakkount $1 is {{GENDER:$2|oanmakke}}",
+       "logentry-newusers-autocreate": "It meidochakkount $1 is automatysk {{GENDER:$2|oanmakke}}",
        "logentry-upload-upload": "$1 hat $3 {{GENDER:$2|opladen}}",
        "logentry-upload-overwrite": "$1 hat in nije ferzje fan $3 {{GENDER:$2|opladen}}",
        "rightsnone": "(gjin)",
index cf7eb60..efe06b4 100644 (file)
@@ -96,7 +96,8 @@
                        "Tavleen",
                        "Jayantanth",
                        "Gopalindians",
-                       "Prong$31"
+                       "Prong$31",
+                       "Eisheeta"
                ]
        },
        "tog-underline": "कड़ी रेखांकित:",
        "tog-norollbackdiff": "सम्पादन वापस लेने के बाद अन्तर न दिखायें",
        "tog-useeditwarning": "जब मैं किसी सम्पादन पृष्ठ को बिना बदलावों को बिना सहेजे छोड़ूँ तो मुझे सूचित करें।",
        "tog-prefershttps": "सत्र आरम्भ करते समय सदैव सुरक्षित कनेक्शन का प्रयोग करें",
+       "tog-showrollbackconfirmation": "रोलबैक लिंक पर क्लिक करते समय एक पुष्टिकरण संकेत दिखाएं",
        "underline-always": "सदैव",
        "underline-never": "कभी नहीं",
        "underline-default": "त्वचा या प्राथमिक ब्राउज़र",
        "badretype": "आपने जो कूटशब्द दिये हैं वे एक दूसरे से नहीं मिलते। फिर से लिखें।",
        "usernameinprogress": "इस प्रयोक्ता का खाता निर्माण अभी चालू है।\nकृपया प्रतीक्षा करें।",
        "userexists": "आपका दिया सदस्यनाम पहले से प्रयोग में है।\nकृपया कोई अन्य सदस्यनाम चुनें।",
+       "createacct-normalization": "आपका उपयोगकर्ता नाम तकनीकी प्रतिबंधों के कारण \"$2\" में समायोजित किया जाएगा।",
        "loginerror": "लॉग इन त्रुटि",
        "createacct-error": "खाता निर्माण त्रुटि",
        "createaccounterror": "खाता नहीं बन पाया: $1",
        "log-action-filter-suppress-reblock": "पुन: ब्लॉक द्वारा युजर अवरोध",
        "log-action-filter-upload-upload": "नया अपलोड",
        "log-action-filter-upload-overwrite": "फिर से अपलोड",
+       "log-action-filter-upload-revert": "पूर्ववत करें",
        "authmanager-authn-not-in-progress": "प्रमाणीकरण प्रगति में नहीं है या सत्र डेटा खो गया है। कृपया शुरुआत से फिर से शुरू करें",
        "authmanager-authn-no-primary": "आपूर्ति किए गए क्रेडेंशियल्स को प्रमाणित नहीं किया जा सका।",
        "authmanager-authn-no-local-user": "दिए गए क्रेडेंशियल इस विकी पर किसी भी उपयोगकर्ता से जुड़े नहीं हैं।",
index 644716b..301ba80 100644 (file)
@@ -80,7 +80,7 @@
        "february": "Саь-кур ''(февраль)''",
        "march": "Мутт-хьал",
        "april": "Тушол",
-       "may_long": "Села ''(май)''",
+       "may_long": "села",
        "june": "Этинга ''(июнь)''",
        "july": "Баьцамеа",
        "august": "Мяцхали",
@@ -92,7 +92,7 @@
        "february-gen": "Саь-кур ''(февраль)'' бетта",
        "march-gen": "Мутт-хьал",
        "april-gen": "Тушол",
-       "may-gen": "Села ''(май)'' бетта",
+       "may-gen": "Села",
        "june-gen": "Этинга ''(июнь)'' бетта",
        "july-gen": "Баьцамеа",
        "august-gen": "Мяцхали",
        "feb": "Саь-кур ''(фев)''",
        "mar": "мутт-хьал",
        "apr": "Tушоли",
-       "may": "Села ''(май)''",
+       "may": "села",
        "jun": "Этинга ''(июн)''",
        "jul": "Баьцамеа",
        "aug": "Мяцхали",
        "february-date": "Саь-кур ''(февраль)'' $1",
        "march-date": "Мутт-хьал $1",
        "april-date": "Тушол $1",
-       "may-date": "Села ''(май)'' $1",
+       "may-date": "Села $1",
        "june-date": "Этинга ''(июнь)'' $1",
        "july-date": "Баьцамеа $1",
        "august-date": "Мяцхали $1",
        "namespacesall": "деррига",
        "monthsall": "деррига",
        "confirm-purge-title": "Укх оагIон кэш ӀоцIенъе",
-       "confirm_purge_button": "Мега",
+       "confirm_purge_button": "Мег",
        "confirm-purge-top": "Укх оагӀон кэш ӀоцIенъйой?",
        "confirm-purge-bottom": "Кэш ӀоцӀенъячул тӀехьагIа оагIон тӀехьара эрш хьахьокхаргья.",
        "imgmultipagenext": "тӀехьайоагӀа оагӀув →",
index 70ed457..edeeb8a 100644 (file)
        "ipblocklist-submit": "Serchar",
        "ipblocklist-otherblocks": "Altra {{PLURAL:$1|blokuso|blokusi}}",
        "infiniteblock": "nefinita",
+       "expiringblock": "finas ye $2 kloki, en $1",
        "emailblock": "e-posto blokusita",
        "blocklist-nousertalk": "ne povas redaktar lua propra diskuto-pagino",
        "blocklink": "blokusar",
index aa0949c..051475b 100644 (file)
        "logentry-rights-autopromote": "$1 が $4 から $5 に自動的に{{GENDER:$2|昇格しました}}",
        "logentry-upload-upload": "$1 が $3 を {{GENDER:$2|アップロードしました}}",
        "logentry-upload-overwrite": "$1 が $3 の新しいバージョンを {{GENDER:$2|アップロードしました}}",
-       "logentry-upload-revert": "$1 が $3 を {{GENDER:$2|アップロードしました}}",
+       "logentry-upload-revert": "$1 が $3 を元の版に {{GENDER:$2|巻き戻しました}}",
        "log-name-managetags": "タグ管理記録",
        "log-description-managetags": "このページは[[Special:Tags|タグ]]に関係する管理タスクをリストアップしています。ログには管理者によって手動で実行された操作の記録しか記載されていません。ウィキ・ソフトウェアによって、ログを残さずにタグが作成・削除されている場合があります。",
        "logentry-managetags-create": "$1 がタグ「$4」を{{GENDER:$2|作成しました}}",
index b33e3ef..265bb3d 100644 (file)
        "view": "Deleng",
        "view-foreign": "Deleng ing $1",
        "edit": "Besut",
-       "edit-local": "Besut andharan enggon-enggonan",
+       "edit-local": "Besut wedharan enggonan",
        "create": "Gawé",
-       "create-local": "Tambah panyadra enggon-enggonan",
+       "create-local": "Wuwuhi wedharan enggonan",
        "delete": "Busak",
        "undelete_short": "Wurung busak {{PLURAL:$1|sabesutan|$1 besutan}}",
        "viewdeleted_short": "Deleng {{PLURAL:$1|sabesutan kabusak|$1 besutan kabusak}}",
index fd43962..5d1ece3 100644 (file)
        "timezonelegend": "Zäitzon:",
        "localtime": "Lokalzäit:",
        "timezoneuseserverdefault": "De Standardwäert vun der Wiki ($1) benotzen",
-       "timezoneuseoffset": "Aner (Differenz uginn)",
+       "timezoneuseoffset": "Aner (Differenz hei drënner uginn)",
        "servertime": "Serverzäit:",
        "guesstimezone": "Vum Browser iwwerhuelen",
        "timezoneregion-africa": "Afrika",
        "grant-createaccount": "Benotzerkonten opmaachen",
        "grant-createeditmovepage": "Säiten uleeën, änneren a réckelen",
        "grant-delete": "Säiten, Versiounen a Rubriken a Logbicher läschen",
-       "grant-editinterface": "MediaWiki-Nummraum a Benotzer CSS/JSON/JavaScript änneren",
+       "grant-editinterface": "De MediaWiki-Nummraum an de Benotzer CSS/JSON/JavaScript vum ganze wiki-Site änneren",
        "grant-editmycssjs": "Äre Benotzer CSS/JSON/JavaScript änneren",
-       "grant-editmyoptions": "Ännert Är Benotzerastellungen",
+       "grant-editmyoptions": "Ännert Är Benotzerastellungen an d'JSON-Konfiguratioun",
        "grant-editmywatchlist": "Ännert Är Iwwerwaachungslëscht",
        "grant-editpage": "Säiten déi et gëtt änneren",
        "grant-editprotected": "Gespaart Säiten änneren",
        "speciallogtitlelabel": "Zil (Titel oder {{ns:user}}:Benotzernumm fir e Benotzer):",
        "log": "Logbicher",
        "logeventslist-submit": "Weisen",
-       "logeventslist-more-filters": "Méi Filteren:",
+       "logeventslist-more-filters": "Méi Logbicher weisen:",
        "all-logs-page": "All ëffentlech Logbicher",
        "alllogstext": "Dëst ass eng kombinéiert Lëscht vu Logbicher op {{SITENAME}}.\nDir kënnt d'Siche limitéiere wann Dir e Log-Typ, e Benotzernumm (case-senisitive) oder déi gefrot Säit (och case-senisitive) agitt.",
        "logempty": "Näischt fonnt.",
        "ipbreason-dropdown": "*Heefeg Ursaache fir Benotzer ze spären:\n**Bewosst falsch Informatiounen an eng oder méi Säite gesat\n**Ouni Grond Inhalt vu Säite geläscht\n**Spam-Verknëppunge mat externe Säiten\n**Topereien an d'Säite gesat\n**Beleidegt oder bedreet aner Mataarbechter\n**Mëssbrauch vu verschiddene Benotzernimm\n**Net akzeptabele Benotzernumm",
        "ipb-hardblock": "Verhënneren datt ageloggt Benotzer vun dëser IP-Adress aus Ännerunge maache kënnen",
        "ipbcreateaccount": "Benotzerkont opmaachen",
-       "ipbemailban": "Verhënneren datt de Benotzer E-Maile verschéckt",
+       "ipbemailban": "E-Maile verschécken",
        "ipbenableautoblock": "Automatesch déi lescht IP-Adress spären déi vun dësem Benotzer benotzt gouf, an all IP-Adresse vun denen dëse Benotzer versicht Ännerunge virzehuelen",
        "ipbsubmit": "Dës IP-Adress resp dëse Benotzer spären",
        "ipbother": "Aner Dauer:",
        "previousdiff": "← Méi al Ännerung",
        "nextdiff": "Méi nei Ännerung →",
        "mediawarning": "<strong>Warnung:</strong> Dës Zort vu Fichier kann e béiswëllege Programmcode enthalen.\nDuerch d'Opmaache vum Fichier kann Äre System beschiedegt ginn.",
-       "imagemaxsize": "Maximal Gréisst fir Biller:<br />''(fir Billerbeschreiwungssäiten)''",
+       "imagemaxsize": "Maximal Gréisst fir Biller op Beschreiwungssäite fir Fichieren:",
        "thumbsize": "Gréisst vun der Miniatur:",
        "widthheightpage": "$1 × $2, $3 {{PLURAL:$3|Säit|Säiten}}",
        "file-info": "Fichiersgréisst: $1, MIME-Typ: $2",
        "logentry-rights-autopromote": "De Benotzer $1 {{GENDER:$2|krut}} d'Benotzerrechter automatesch vu(n) $4 op $5 geännert",
        "logentry-upload-upload": "$1 huet $3 {{GENDER:$2|eropgelueden}}",
        "logentry-upload-overwrite": "$1 huet eng nei Versioun vu(n) $3 {{GENDER:$2|eropgelueden}}",
-       "logentry-upload-revert": "$1 huet $3 {{GENDER:$2|eropgelueden}}",
+       "logentry-upload-revert": "$1 huet $3 {{GENDER:$2|zréckgesat}} op eng al Versioun",
        "logentry-tag-update-add-revision": "$1 {{GENDER:$2|huet}} d'{{PLURAL:$7|Markéierung|Markéierunge(n)}} $6 op d'Versioun $4 vun der Säit $3 dobäigesat",
        "rightsnone": "(keen)",
        "rightslogentry-temporary-group": "$1 (temporär, bis $2)",
index d27e71f..7458dea 100644 (file)
        "toolbox": "ٱڤزارؽا",
        "imagepage": "ديئن بألگە جانیا",
        "mediawikipage": "ديئن بألگە پئيغوم",
-       "templatepage": "دیئن بٱلگٱ چۊٱ",
+       "templatepage": "دیئن بٱلگٱ چۊئٱ",
        "viewhelppage": "ديئن بألگە هومیاری",
        "categorypage": "ديئن بألگە دأسە بأنی",
        "viewtalkpage": "دیئن چأک چئنە یا",
        "nstab-project": "بٱلگٱ پرۉژٱ",
        "nstab-image": "جانؽا",
        "nstab-mediawiki": "پاٛغوم",
-       "nstab-template": "چۊٱ",
+       "nstab-template": "چۊئٱ",
        "nstab-help": "بألگە هومیاری",
        "nstab-category": "دٱسٱ",
        "mainpage-nstab": "سرآسونٱ",
        "filereadonlyerror": "نأبوٙە جانیا \"$1\" نە آلئشت کاری بأکیت سی یە کئ ئمایە جا \"$2\" ئیسئ ها د حال و بال حأنئن.\n\nدیڤوٙنداری کئ ڤئ نە قولف کئردە ها د حال و بال گوتە دیاری \"$3\" .",
        "invalidtitle-knownnamespace": "داسوٙن نادیار سی نوم جا \"$2\" و نیسئسە \"$3\"",
        "invalidtitle-unknownnamespace": "داسوٙن نادیار سی شومارە نادیار نوم جا \"$2\" و نیسئسە \"$3\"",
-       "exception-nologin": "Ù\87Ù±Ù\86Û\8c Ù\86Û\8cÙ\88مایتٱ ڤامیٛن",
+       "exception-nologin": "Ù\87Ù\86Û\8c Ù\86Û\8fمایتٱ ڤامیٛن",
        "exception-nologin-text": "لوطف بأکیت بیایت ڤامین سی یە کئ د ئی بألگە یا کونئشتکاری دأسرئسی داشتوٙییت.",
        "exception-nologin-text-manual": "لوطف بأکیت ڤئ $1 صئلا بئیتوٙ کئ د ئی بألگە یا کونئشتکاری دأسرئسی داشتوٙە.",
        "virus-badscanner": "سازڤارە گأن:ڤیروٙس نادیار:<em>$1</em>",
        "nav-login-createaccount": " ڤامین ئوٙمائن/راس کئردئن حئساڤ",
        "logout": "د ساموٙنە دئرئوٙمائن",
        "userlogout": "د ساموٙنە دئرئوٙمائن",
-       "notloggedin": "Ù\87Ù±Ù\86Û\8c Ù\86Û\8cÙ\88مایتٱ ڤامیٛن",
+       "notloggedin": "Ù\87Ù\86Û\8c Ù\86Û\8fمایتٱ ڤامیٛن",
        "userlogin-noaccount": "یاٛ هساو نارؽت؟",
        "userlogin-joinproject": "ٱندوم دؽارگٱ {{SITENAME}} بۊئؽت",
        "createaccount": "هساو دۏرس بٱکؽت",
        "semiprotectedpagewarning": "<strong>د ڤیر داشتوٙئیت:</strong> ئی بألگە سی یە کئ فأقأط کاریاریا ثأڤتئنام کئردە تونئسوٙئن دئش ڤیراشتکار بأکأن پأر و پیم بییە.\nآخئری پئھرئستنوٙمە دأئە بییە سی سأرچئشمە ھاری نئھا ئمایە بییە:",
        "cascadeprotectedwarning": "<strong>زئنار:</strong> ئی بألگە ڤئ دأس کاریاریایی کئ صئلا سأردیڤوٙنکاری دارن می توٙنە ڤیرایئشت کاری بوٙە سی یە کئ ئی بألگە ڤئ رأڤئشت تاف نئمایی پأر و پیم کاری بییە {{PLURAL:$1|بألگە|بألگە یا}}:",
        "titleprotectedwarning": "<strong>زئنار:ئی بألگە پأر و پیم بییە سی یە کئ [[Special:نومگە حوقوٙق کاریاری جأرغە|حوقوٙق ڤیجە]] بایأد ڤئنە رأڤأندیاری بأکأن.</strong>\nآخئری پئھرئستنوٙمە دأ بییە سی سأرچئشمە دأئن نئھا ئمایە بییە:",
-       "templatesused": "{{PLURAL:$1|چۊٱ|چۊٱ یا}} ڤ کار گرتٱ بیٱ د اؽ بٱلگٱ:",
-       "templatesusedpreview": "{{PLURAL:$1| چۊٱ|چۊٱ یا}} ڤ کار گرتٱ بیٱ د پیش ساٛلٛ :",
-       "templatesusedsection": "{{PLURAL:$1|چوٙأ|چوٙأ یا}} ڤئ کار گئرئتە بییە د ئی بأرجا:",
+       "templatesused": "{{PLURAL:$1|چۊئٱ|چۊئٱ یا}} ڤ کار گرتٱ بیٱ د اؽ بٱلگٱ:",
+       "templatesusedpreview": "{{PLURAL:$1| چۊئٱ|چۊئٱ یا}} ڤ کار گرتٱ بیٱ د پیش ساٛلٛ :",
+       "templatesusedsection": "{{PLURAL:$1|چۊئٱ|چۊئٱ یا}} ڤ کار گرتٱ بیٱ د اؽ بٱلگٱ:",
        "template-protected": "(پٱر ۉ پیم بیٱ)",
        "template-semiprotected": "(نسم ۉ نیمٱ پٱر ۉ پیم بیٱ)",
        "hiddencategories": "اؽ بٱلگٱ یٱکؽ د ٱندومؽا ٱ {{PLURAL:$1|1 hidden category|$1 hidden categories}} :",
        "uploadbtn": "سوڤار کئردئن جانیا",
        "reuploaddesc": "سوار کردن نه انجوم شیو بکیت و د ورئردیت جابلگ سوارکرد",
        "upload-tryagain": "کل کردن توضیحیا آلشت دئیه بیه جانیا",
-       "uploadnologin": "Ù\87Ù±Ù\86Û\8c Ù\86Û\8cÙ\88مایتٱ ڤامیٛن",
+       "uploadnologin": "Ù\87Ù\86Û\8c Ù\86Û\8fمایتٱ ڤامیٛن",
        "uploadnologintext": "لطفن $1 سی سوارکرد جانیایا.",
        "upload_directory_missing": "نشونگه سوارکرد ($1) وجود ناره و نبوئه دروسش بکی.",
        "upload_directory_read_only": "نشونگه سوارکرد($1) د لا سرور قاول نیسنن نئ.",
        "watchlistfor2": "سی $1 $2",
        "nowatchlist": "شما هیچی د سیل برگ خوتو ناریت",
        "watchlistanontext": "لطفن بیایت وامین و ویرایشتیا نه د سیل برگتو سیل بکیت.",
-       "watchnologin": "Ù\87Ù±Ù\86Û\8c Ù\86Û\8cÙ\88مایتٱ ڤامیٛن",
+       "watchnologin": "Ù\87Ù\86Û\8c Ù\86Û\8fمایتٱ ڤامیٛن",
        "addwatch": "ئضاف کئردئن د سئیل بأرگ",
        "addedwatchtext": "بألگە «[[:$1]]» د [[Special:Watchlist|سئیل بأرگ]] شوما ئضاف بی.\nآلئشتیا ئی بألگە د بألگە چأک چئنە ری ڤئ ریشت د نئھاتئر د ئیچئ نومگە کاری با.",
        "addedwatchtext-short": "بلگه \"$1\" وه سیل برگ شما اضاف بیه.",
        "tooltip-ca-nstab-project": "ديئن بٱلگٱ پرۉژٱ",
        "tooltip-ca-nstab-image": "دیئن بٱلگٱ جانؽا",
        "tooltip-ca-nstab-mediawiki": "دیئن پاٛغوم سامونٱ",
-       "tooltip-ca-nstab-template": "ديئن چۊٱ",
+       "tooltip-ca-nstab-template": "ديئن چۊئٱ",
        "tooltip-ca-nstab-help": "ديئن بلگه هومیاری",
        "tooltip-ca-nstab-category": "دیئن بٱلگٱ دٱسٱ بٱنی",
        "tooltip-minoredit": "یٱ ناْ ڤ عونڤان هیردٱ ڤیرایش سٱبت کو",
        "pageinfo-recent-authors": "شمارٱ کولٛی نڤیسٱیا یٱکونٱ",
        "pageinfo-magic-words": "جادۊیی{{PLURAL:$1|کلٱمٱ|کلٱمٱیا}} ($1)",
        "pageinfo-hidden-categories": "$1{{PLURAL:$1|دٱسٱ|دٱسٱيا}} قایم بیٱ",
-       "pageinfo-templates": "{{PLURAL:$1|چۊٱ|چۊٱ یا}} ڤ کار گرتٱ بیٱ ($1)",
+       "pageinfo-templates": "{{PLURAL:$1|چۊئٱ|چۊئٱ یا}} ڤ کار گرتٱ بیٱ ($1)",
        "pageinfo-transclusions": "{{PLURAL:$1|بلگه|بلگه یا}} وه کار گرته بیه د ($1)",
        "pageinfo-toolboxlink": "دونسمٱنیٛا بٱلگٱ",
        "pageinfo-redirectsto": "واگردونی سی",
index cec48e7..dac0bcc 100644 (file)
        "logentry-delete-delete_redir": "$1 pervadindamas {{GENDER:$2|ištrynė}} buvusį nukreipimą $3",
        "logentry-delete-restore": "$1 atkūrė puslapį $3 ($4)",
        "logentry-delete-restore-nocount": "$1 {{GENDER:$2|atkūrė}} puslapį $3",
-       "restore-count-revisions": "{{PLURAL:$1|1 versija|versijų: $1}}",
+       "restore-count-revisions": "{{PLURAL:$1|$1 versija|$1 versijos|$1 versijų}}",
        "restore-count-files": "{{PLURAL:$1|1 failas|$1 failai}}",
        "logentry-delete-event": "$1 {{GENDER:$2|pakeitė}} matomumą {{PLURAL:$5|žurnalo įvykio|$5 žurnalo įvykių}} $3: $4",
        "logentry-delete-revision": "$1 {{GENDER:$2|pakeitė}} matomumą {{PLURAL:$5|versijos|$5 versijų}} puslapyje $3: $4",
index 44c9fef..c3adb57 100644 (file)
        "index-category": "Indeksētās lapas",
        "noindex-category": "Neindeksētās lapas",
        "broken-file-category": "Lapas, kurās ir bojātas failu saites",
+       "categoryviewer-pagedlinks": "($1) ($2)",
+       "category-header-numerals": "$1–$2",
        "about": "Par",
        "article": "Raksts",
        "newwindow": "(atveras jaunā logā)",
        "versionrequired": "Nepieciešamā ''MediaWiki'' versija: $1.",
        "versionrequiredtext": "Lai lietotu šo lapu, nepieciešama ''MediaWiki'' versija $1. Sk. [[Special:Version|versija]].",
        "ok": "Labi",
+       "pagetitle": "$1 — {{SITENAME}}",
+       "pagetitle-view-mainpage": "{{SITENAME}}",
+       "backlinksubtitle": "← $1",
        "retrievedfrom": "Saturs iegūts no \"$1\"",
        "youhavenewmessages": "Tev ir $1 (skatīt $2).",
        "youhavenewmessagesfromusers": "{{PLURAL:$4|Jums ir}} $1 no {{PLURAL:$3|cita dalībnieka|$3 dalībniekiem}} ($2).",
        "site-atom-feed": "$1 Atom padeve",
        "page-rss-feed": "\"$1\" RSS barotne",
        "page-atom-feed": "\"$1\" Atom barotne",
+       "feed-atom": "Atom",
+       "feed-rss": "RSS",
        "red-link-title": "$1 (lapa nepastāv)",
        "sort-descending": "Kārtot dilstošā secībā",
        "sort-ascending": "Kārtot augošā secībā",
        "createaccounterror": "Neizdevās izveidot kontu: $1",
        "nocookiesnew": "Lietotājvārds tika izveidots, bet tu neesi iegājis iekšā. {{SITENAME}} izmanto sīkdatnes (<i>cookies</i>), lai lietotāji varētu tajā ieiet. Tavs pārlūks nepieņem tās. Lūdzu, atļauj to pieņemšanu un tad nāc iekšā ar savu lietotājvārdu un paroli.",
        "nocookieslogin": "{{SITENAME}} izmanto sīkdatnes (<i>cookies</i>), lai lietotāji varētu ieiet tajā. Diemžēl tavs pārlūks tos nepieņem. Lūdzu, atļauj to pieņemšanu un mēģini vēlreiz.",
+       "nocookiesforlogin": "{{int:nocookieslogin}}",
        "noname": "Tu neesi norādījis derīgu lietotāja vārdu.",
        "loginsuccesstitle": "Pieteikšanās veiksmīga",
        "loginsuccess": "Tu esi ienācis {{grammar:lokatīvs|{{SITENAME}}}} kā \"$1\".",
        "user-mail-no-body": "Mēģināja sūtīt e-pastu ar tukšu vai nepamatoti īsu pamata daļu.",
        "changepassword": "Mainīt paroli",
        "resetpass_announce": "Lai pabeigtu pieslēgšanos, tev ir jāuzstāda jauna parole.",
+       "resetpass_text": "<!-- Šeit pievieno tekstu -->",
        "resetpass_header": "Mainīt konta paroli",
        "oldpassword": "Vecā parole",
        "newpassword": "Jaunā parole",
        "group-autoconfirmed": "Automātiski apstiprinātie dalībnieki",
        "group-bot": "Boti",
        "group-sysop": "Administratori",
-       "group-interface-admin": "Interfeisa administrators",
+       "group-interface-admin": "Interfeisa administratori",
        "group-bureaucrat": "Birokrāti",
        "group-suppress": "Cenzētāji",
        "group-all": "(visi)",
index e7b6877..1f0dc81 100644 (file)
        "revdel-restore": "ganti tampilan",
        "pagehist": "Riwayaik laman",
        "deletedhist": "Riwayaik pangapuihan",
+       "revdelete-hide-current": "Gagal manyambunyian parubahan tanggal $2, $1: iko adolah parubahan paliang baru.\nParubahan ko indak dapek disambunyian.",
+       "revdelete-show-no-access": "Gagal manampilan parubahan tanggal $2, $1: parubahan ko alah ditandoi ''tabateh''.\nSanak indak punyo akses ka parubahan ko.",
+       "revdelete-modify-no-access": "Gagal maubah parubahan tanggal $2, $1: parubahan ko alah ditandoi ''tabateh''.\nSanak indak punyo akses ka parubahan ko.",
+       "revdelete-modify-missing": "Gagal maubah parubahan ID $1: parubahan ko indak ado di basis data!",
+       "revdelete-no-change": "<strong>Paringatan:</strong>Parubahan tanggal $2, $1 alah punyo aturan panyambunyian.",
+       "revdelete-concurrent-change": "Gagal maubah parubahan tanggal $2, $1: statusnyo mungkin alah diubah pangguno lain basamoan jo Sanak.\nCubo pareso catatan log.",
+       "revdelete-only-restricted": "Ado yang salah wakatu manyambunyian item tanggal $2, $1: Sanak indak dapek manyambunyiannyo dari panguruih tanpa mamiliah salah satu opsi panyambunyian lainnyo.",
        "revdelete-reason-dropdown": "*Alasan pangapuihan umum\n** Palanggaran hak cipta\n** Komentar atau informasi paribadi nan indak patuik\n** Namo pangguno nan indak patuik\n** Bapotensi mancemarkan namo baiak",
        "revdelete-otherreason": "Alasan lain/tambahan:",
        "revdelete-reasonotherlist": "Alasan lain",
        "revdelete-edit-reasonlist": "Alasan mangapuih laman",
        "revdelete-offender": "Pambuek reviri:",
        "suppressionlog": "Log pambanaman",
+       "suppressionlogtext": "Dibawah ko adolah daftar panghapuihan jo pamblokiran, tamasuak isi yang disambunyian dari panguruih.\nCaliak [[Special:BlockList|block list]] untuak daftar yang paliang baru.",
+       "mergehistory": "Riwayaik panggabuangan sajarah halaman",
+       "mergehistory-box": "Gabuang parubahan-parubahan dari duo halaman:",
+       "mergehistory-from": "Halaman sumber:",
+       "mergehistory-into": "Halaman tujuan:",
+       "mergehistory-go": "Tampilan suntiangan yang dapek digabuang",
+       "mergehistory-submit": "Gabuang revisi",
+       "mergehistory-empty": "Indak ado parubahan yang dapek digabuang.",
+       "mergehistory-done": "$3 {{PLURAL:$3|revision|revisions}} dari $1 {{PLURAL:$3|was|were}} berhasil digabuangan ka [[:$2]].",
+       "mergehistory-fail": "Indak dapek digabuang, mohon pareso baliak halaman jo parameter waktu.",
+       "mergehistory-fail-invalid-source": "Halaman asal indak sah.",
+       "mergehistory-fail-invalid-dest": "Halaman tujuan indak sah.",
+       "mergehistory-fail-self-merge": "Halaman sumber jo tujuannyo samo.",
        "mergehistory-reason": "Alasan:",
        "mergelog": "Log panggabuangan",
        "revertmerge": "Batal gabuang",
index b2a6bcc..42680f9 100644 (file)
        "continue-editing": "Оди на полето за уредување",
        "previewconflict": "Овој преглед прикажува како ќе изгледа текстот внесен во горниот дел откако ќе се зачува страницата.",
        "session_fail_preview": "За жал, не можев да го обработам уредувањето поради загуба на седнички податоци.\n\nМожеби сте биле одјавени. <strong>Проверете дали сè уште сте најавени и обидете се повторно</strong>.\nАко проблемот продолжи да се јавува, [[Special:UserLogout|одјавете се]] и повторно најавете се, и проверете дали прелистувачот дозволува колачиња од ова мрежно место.",
-       "session_fail_preview_html": "'''Жалиме, но Вашето уредување не можеше да се обработи поради загува на податоците од седницата.'''\n\n''{{SITENAME}} има овозможено чист HTML, па прегледот е скриен како мерка за заштита од JavaScript-напади.''\n\n'''Ако ова е разумен обид за уредување, тогаш обидете се повторно.'''\nАко и ова не го реши проблемот, обидете се со [[Special:UserLogout|одјавување]] и повторно најавување, и проверете дали прелистувачот дозволува колачиња од ова мрежно место.",
+       "session_fail_preview_html": "Жалиме, но Вашето уредување не можеше да се обработи поради загува на податоците од седницата.\n\n<em>{{SITENAME}} има овозможено чист HTML, па прегледот е скриен како мерка за заштита од JavaScript-напади.</em>\n\n<strong>Ако ова е разумен обид за уредување, тогаш обидете се повторно.</strong>\nАко и ова не го реши проблемот, обидете се со [[Special:UserLogout|одјавување]] и повторно најавување, и проверете дали прелистувачот дозволува колачиња од ова мрежно место.",
        "token_suffix_mismatch": "'''Вашето уредување е одбиено затоа што вашиот пребарувач направил проблеми со интерпукциските знаци во шифрата на уредувањето.\nУредувањето не е прифатено за да се спречи несакана промена на текстот на страницата.\nОва понекогаш се случува кога користите неисправна мрежна анонимна застапничка (proxy) служба.'''",
        "edit_form_incomplete": "'''Некои делови од образецот за уредување не стасаа до опслужувачот. Внимателно проверете дали уреденото не е пореметено и обидете се поввторно.'''",
        "editing": "Уредување на $1",
        "log-action-filter-move-move": "Преместување без запис врз пренасочувања",
        "log-action-filter-move-move_redir": "Преместување со запис врз пренасочувања",
        "log-action-filter-newusers-create": "Создавање од анонимен корисник",
-       "log-action-filter-newusers-create2": "Создавање од анонимен корисник",
+       "log-action-filter-newusers-create2": "Создавање од регистриран корисник",
        "log-action-filter-newusers-autocreate": "Автоматско создавање",
        "log-action-filter-newusers-byemail": "Создавање со лозинка испратена по е-пошта",
        "log-action-filter-patrol-patrol": "Рачна патрола",
index 62c4172..e749618 100644 (file)
@@ -78,7 +78,8 @@
        "tog-norollbackdiff": "റോൾബാക്കിനു ശേഷം വ്യത്യാസം കാണിക്കാതിരിക്കുക",
        "tog-useeditwarning": "സേവ് ചെയ്യാത്ത മാറ്റങ്ങളോടു കൂടിയ തിരുത്തൽ താളിൽ നിന്നും പോകുമ്പോൾ എന്നെ അറിയിക്കുക",
        "tog-prefershttps": "പ്രവേശിച്ചിരിക്കുമ്പോൾ എപ്പോഴും സുരക്ഷിതമായ കണൿഷൻ ഉപയോഗിക്കുക",
-       "underline-always": "എല്ലായ്പ്പോഴും",
+       "tog-showrollbackconfirmation": "തിരിച്ചാക്കാനുള്ള കണ്ണി ഞെക്കുമ്പോൾ, അത് സ്ഥിരീകരിക്കാനുള്ള ചോദ്യം പ്രദർശിപ്പിക്കുക",
+       "underline-always": "എല്ലായ്‌പ്പോഴും",
        "underline-never": "ഒരിക്കലും അരുത്",
        "underline-default": "ദൃശ്യരൂപത്തിൽ അഥവാ ബ്രൗസറിൽ സ്വതേയുള്ള സ്വഭാവം",
        "editfont-style": "തിരുത്തൽ മേഖലയിലെ ഫോണ്ടിന്റെ ശൈലി:",
        "content-model-text": "വെറും എഴുത്ത്",
        "content-model-javascript": "ജാവാസ്ക്രിപ്റ്റ്",
        "content-model-css": "സി.എസ്.എസ്.",
-       "content-json-empty-object": "à´¶àµ\82à´¨àµ\8dയമായ à´µà´¸àµ\8dà´¤àµ\81",
+       "content-json-empty-object": "à´¶àµ\82à´¨àµ\8dയമായ à´\92à´¬àµ\8dâ\80\8cà´\9càµ\86à´\95àµ\8dà´±àµ\8dà´±àµ\8d",
        "content-json-empty-array": "അറേ ശൂന്യമാണ്",
-       "deprecated-self-close-category": "Pages using invalid self-closed HTML tags",
+       "deprecated-self-close-category": "അസാധുവായ സ്വയം-അടയ്ക്കൽ എച്ച്.റ്റി.എം.എൽ. റ്റാഗുകൾ ഉപയോഗിക്കുന്ന താളുകൾ",
        "duplicate-args-warning": "<strong>മുന്നറിയിപ്പ്:</strong> [[:$1]], [[:$2]] എന്നതിനെ വിളിക്കുമ്പോൾ \"$3\" എന്ന ചരത്തിന് ഒന്നിലധികം വിലകൾ നൽകിയിട്ടുണ്ട്. നൽകിയ വിലകളിൽ അവസാനത്തേതുമാത്രം ഉപയോഗിക്കുന്നതാണ്.",
        "duplicate-args-category": "ഫലകങ്ങൾ വിളിക്കുമ്പോൾ ചരങ്ങൾ ആവർത്തിച്ചുപയോഗിക്കുന്ന താളുകൾ",
        "duplicate-args-category-desc": "താളിൽ ഫലകങ്ങൾ വിളിക്കുമ്പോൾ ചരങ്ങൾ അതായത് <code><nowiki>{{foo|bar=1|bar=2}}</nowiki></code> അല്ലെങ്കിൽ <code><nowiki>{{foo|bar|1=baz}}</nowiki></code> എന്ന രീതിയിൽ.",
        "rcfilters-filter-humans-description": "മനുഷ്യലേഖകർ ചെയ്ത തിരുത്തുകൾ",
        "rcfilters-filtergroup-reviewstatus": "സംശോധന സ്ഥിതി",
        "rcfilters-filter-reviewstatus-unpatrolled-label": "റോന്ത് ചുറ്റപ്പെടാത്തവ",
-       "rcfilters-filter-reviewstatus-auto-label": "à´¸àµ\8dവതàµ\87 à´±àµ\8bà´¨àµ\8dà´¤àµ\81à´\9aàµ\81à´±àµ\8dà´±àµ\81à´¨àµ\8dനവർ",
+       "rcfilters-filter-reviewstatus-auto-label": "à´¸àµ\8dവതàµ\87 à´±àµ\8bà´¨àµ\8dà´¤àµ\81à´\9aàµ\81à´±àµ\8dറിയവ",
        "rcfilters-filtergroup-significance": "പ്രാധാന്യം",
        "rcfilters-filter-minor-label": "ചെറുതിരുത്തുകൾ",
        "rcfilters-filter-minor-description": "ലേഖകൻ ചെറുതെന്ന് അടയാളപ്പെടുത്തിയ തിരുത്തുകൾ.",
        "uploadstash-errclear": "പ്രമാണങ്ങൾ ശൂന്യമാക്കൽ പരാജയപ്പെട്ടു.",
        "uploadstash-refresh": "പ്രമാണങ്ങളുടെ പട്ടിക പുതുക്കുക",
        "uploadstash-thumbnail": "ലഘുചിത്രം കാണുക",
+       "uploadstash-bad-path-invalid": "പാത്ത് അസാധുവാണ്.",
        "uploadstash-bad-path-unknown-type": "അപരിചിതമായ തരം \"$1\".",
        "uploadstash-file-not-found-no-thumb": "ലഘുചിത്രം സംഘടിപ്പിക്കാൻ കഴിഞ്ഞില്ല.",
        "uploadstash-file-not-found-no-remote-thumb": "ലഘുചിത്രം എടുക്കൽ പരാജയപ്പെട്ടു: $1\nയു.ആർ.എൽ.= $2",
        "uploadstash-no-extension": "എക്സ്റ്റെൻഷൻ ശൂന്യമാണ്.",
+       "uploadstash-zero-length": "പ്രമാണത്തിന്റെ നീളം ശൂന്യമാണ്.",
        "img-auth-accessdenied": "പ്രവേശനമില്ല",
        "img-auth-nopathinfo": "പാത്ത് വിവരങ്ങൾ ലഭ്യമല്ല.\nതാങ്കളുടെ സെർവർ REQUEST_URI ഒപ്പം/അല്ലെങ്കിൽ PATH_INFO കൈമാറ്റം ചെയ്യാൻ കഴിയുന്നതായി സജ്ജീകരിച്ചിരിക്കേണ്ടതുണ്ട്.\nഅങ്ങനെ ചെയ്തിട്ടുണ്ടെങ്കിൽ $wgUsePathInfo സജ്ജമാക്കുക.\nhttps://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Image_Authorization കാണുക.",
        "img-auth-notindir": "ആവശ്യപ്പെട്ട പാത അപ്‌‌ലോഡ് ഡയറക്റ്ററിയിൽ സജ്ജീകരിച്ചു നൽകിയിട്ടില്ല.",
        "apisandbox-submit-invalid-fields-title": "ചില മണ്ഡലങ്ങൾ അസാധുവാണ്",
        "apisandbox-results": "ഫലങ്ങൾ",
        "apisandbox-request-url-label": "അഭ്യർത്ഥനാ യൂ.ആർ.എൽ.:",
+       "apisandbox-request-json-label": "JSON നുവേണ്ടി അപേക്ഷിക്കുക:",
        "apisandbox-request-time": "അഭ്യർത്ഥനയുടെ സമയം: {{PLURAL:$1|$1 മി.സെ.}}",
        "apisandbox-results-fixtoken": "ചീട്ട് ശരിയാക്കിയ ശേഷം വീണ്ടും സമർപ്പിക്കുക",
+       "apisandbox-results-fixtoken-fail": "\"$1\" ടോക്കൻ എടുക്കുന്നത്‌ പരാജയപെട്ടു.",
+       "apisandbox-alert-page": "ഈ താളിലെ ഫീൽഡുകൾ അസാധുവാണ്.",
        "apisandbox-continue": "തുടരുക",
        "apisandbox-continue-clear": "ശൂന്യമാക്കുക",
        "apisandbox-multivalue-all-namespaces": "$1 (എല്ലാ നാമമേഖലകളും)",
        "booksources-search": "തിരയുക",
        "booksources-text": "പുതിയതും ഉപയോഗിച്ചതുമായ പുസ്തകങ്ങൾ വിൽക്കുന്ന സൈറ്റുകളിലേക്കുള്ള ലിങ്കുകളുടെ പട്ടിക ആണ്‌ താഴെ. താങ്കൾ തിരയുന്ന പുസ്തകത്തെ പറ്റിയുള്ള കൂടുതൽ വിവരങ്ങൾ ഈ പട്ടികയിൽ നിന്നു ലഭിച്ചേക്കാം:",
        "booksources-invalid-isbn": "തന്നിരിക്കുന്ന ഐ.എസ്.ബി.എൻ. സാധുവാണെന്നു തോന്നുന്നില്ല; യഥാർത്ഥ സ്രോതസ്സിൽ നിന്നും പകർത്തിയപ്പോൾ തെറ്റുപറ്റിയോ എന്നു പരിശോധിക്കുക",
+       "magiclink-tracking-rfc": "RFC മാജിക് കണ്ണികൾ ഉപയോഗിക്കുന്ന താളുകൾ",
+       "magiclink-tracking-pmid": "PMID മാജിക് കണ്ണികൾ ഉപയോഗിക്കുന്ന താളുകൾ",
+       "magiclink-tracking-isbn": "ISBN മാജിക് കണ്ണികൾ ഉപയോഗിക്കുന്ന താളുകൾ",
        "specialloguserlabel": "നടപ്പിലാക്കിയയാൾ:",
        "speciallogtitlelabel": "ലക്ഷ്യം (തലക്കെട്ട് അല്ലെങ്കിൽ ഉപയോക്താവിനെ തിരയാനുള്ള {{ns:user}}:ഉപയോക്തൃനാമം) :",
        "log": "പ്രവർത്തനരേഖകൾ",
        "ipb-confirm": "തടയൽ സ്ഥിരീകരിക്കുക",
        "ipb-sitewide": "സൈറ്റ്-വ്യാപകം",
        "ipb-partial": "ഭാഗികം",
+       "ipb-partial-help": "പ്രത്യേക താളുകൾ അല്ലെങ്കിൽ നാമമേഖലകൾ.",
        "ipb-pages-label": "താളുകൾ",
        "ipb-namespaces-label": "നാമമേഖലകൾ",
        "badipaddress": "അസാധുവായ ഐ.പി. വിലാസം.",
        "htmlform-date-invalid": "താങ്കൾ നൽകിയ വില തീയതിയായി കണക്കാക്കാനാകുന്നില്ല. വവവവ-മാമാ-തീതീ ഘടന ഉപയോഗിച്ചുനോക്കുക",
        "htmlform-time-invalid": "താങ്കൾ നൽകിയ വില സമയമായി കണക്കാക്കാനാകുന്നില്ല. മമ:മിമി:സെസെ ഘടന ഉപയോഗിച്ചുനോക്കുക",
        "htmlform-datetime-invalid": "താങ്കൾ നൽകിയ വില തീയതിയും സമയവുമായി കണക്കാക്കാനാകുന്നില്ല. വവവവ-മാമാ-തീതീ മമ:മിമി:സെസെ ഘടന ഉപയോഗിച്ചുനോക്കുക",
+       "htmlform-date-toohigh": "$1 എന്ന അനുവദനീയമായ തിയതിക്ക് ശേഷമുള്ളതാണ് താങ്കൾ കൊടുത്തിരിക്കുന്ന തീയതി.",
+       "htmlform-time-toolow": "$1 എന്ന അനുവദനീയമായ തിയതിക്ക് മുൻപുള്ള തീയതിയാണ് താങ്കൾ കൊടുത്തിരിക്കുന്നത്.",
        "htmlform-title-badnamespace": "[[:$1]] ഉള്ളത് \"{{ns:$2}}\" നാമമേഖലയിലല്ല.",
        "htmlform-title-not-creatable": "\"$1\" സൃഷ്ടിക്കാനാവുന്ന തലക്കെട്ടല്ല.",
        "htmlform-title-not-exists": "$1 നിലവിലില്ല.",
        "log-action-filter-suppress-delete": "താൾ ഒതുക്കൽ",
        "log-action-filter-upload-upload": "പുതിയ അപ്‌ലോഡ്",
        "log-action-filter-upload-overwrite": "പുനർ അപ്‌ലോഡ്",
+       "log-action-filter-upload-revert": "തിരിച്ചാക്കൽ",
        "authmanager-create-disabled": "അംഗത്വസൃഷ്ടി പ്രവർത്തനരഹിതമാക്കിയിരിക്കുന്നു.",
        "authmanager-create-from-login": "താങ്കളുടെ അംഗത്വം സൃഷ്ടിക്കാൻ, ദയവായി കളങ്ങൾ പൂരിപ്പിക്കുക.",
        "authmanager-create-not-in-progress": "സെഷൻ ഡേറ്റ നഷ്ടപ്പെട്ടതിനാൽ അംഗത്വസൃഷ്ടിയുടെ പുരോഗതി നഷ്ടമായിരിക്കുന്നു. ദയവായി  ആദ്യം മുതൽ വീണ്ടും തുടങ്ങുക.",
        "authmanager-provider-password": "രഹസ്യവാക്ക്-അധിഷ്ഠിത സാധൂകരണം",
        "authmanager-provider-password-domain": "രഹസ്യവാക്ക്-ഡൊമൈൻ-അധിഷ്ഠിത സാധൂകരണം",
        "authmanager-provider-temporarypassword": "താത്കാലിക രഹസ്യവാക്ക്",
+       "authprovider-confirmlink-success-line": "$1: വിജയകരമായി ലിങ്ക് ചെയ്തു.",
        "authprovider-resetpass-skip-label": "മറികടക്കുക",
+       "authform-newtoken": "ടോക്കൺ കാണുന്നില്ല. $1",
+       "authform-notoken": "ടോക്കൺ കാണുന്നില്ല",
+       "authform-wrongtoken": "തെറ്റായ ടോക്കൻ",
        "specialpage-securitylevel-not-allowed-title": "അനുവദിച്ചിട്ടില്ല",
        "specialpage-securitylevel-not-allowed": "താങ്കളുടെ വ്യക്തിത്വം പരിശോധിക്കാൻ കഴിയാഞ്ഞതിനാൽ ഈ താൾ ഉപയോഗിക്കാൻ താങ്കളെ അനുവദിക്കാനാവില്ല.",
        "authpage-cannot-login": "പ്രവേശനം തുടങ്ങാൻ സാധിക്കുന്നില്ല.",
        "edit-error-long": "പിഴവുകൾ:\n\n$1",
        "revid": "നാൾപ്പതിപ്പ് $1",
        "pageid": "താൾ ഐ.ഡി. $1",
+       "interfaceadmin-info": "$1\n\nസൈറ്റ്‌വ്യാപക സി.എസ്.എസ്./ജെ.എസ്./ജെസൺ പ്രമാണങ്ങൾ തിരുത്താനുള്ള അവകാശം സമീപകാലത്ത് <code>editinterface</code> അവകാശത്തിൽനിന്നും വേർപെടുത്തിയതാണ്. ഈ പിഴവ് എന്തുകൊണ്ടാണ് പ്രദർശിക്കപ്പെടുന്നതെന്ന് താങ്കൾക്ക് മനസ്സിലാകുന്നില്ലെങ്കിൽ [[mw:MediaWiki_1.32/interface-admin]] കാണുക.",
        "rawhtml-notallowed": "&lt;html&gt; ടാഗുകൾ സാധാരണ താളുകൾക്ക്പുറത്ത് ഉപയോഗിക്കാനാകില്ല.",
        "gotointerwiki": "{{SITENAME}} സംരംഭത്തിൽ നിന്നും പോകുകയാണ്",
        "gotointerwiki-invalid": "നൽകിയിരിക്കുന്ന തലക്കെട്ട് അസാധുവാണ്.",
        "passwordpolicies-policy-passwordcannotmatchusername": "ഉപയോക്തൃനാമം തന്നെ രഹസ്യവാക്ക് ആകാൻ പാടില്ല",
        "passwordpolicies-policy-passwordcannotmatchblacklist": "രഹസ്യവാക്ക് കരിമ്പട്ടികയിൽ ഉള്ള രഹസ്യവാക്കുകൾക്ക് സമാനമാകരുത്",
        "passwordpolicies-policy-maximalpasswordlength": "രഹസ്യവാക്കിന് കുറഞ്ഞത് $1 {{PLURAL:$1|അക്ഷരം|അക്ഷരങ്ങൾ}} നീളമുണ്ടാവണം",
-       "passwordpolicies-policy-passwordcannotbepopular": "രഹസ്യവാക്ക് {{PLURAL:$1|പ്രചുരപ്രചാരത്തിൽ ഉള്ളത്|പ്രചുരപ്രചാരത്തിലുള്ള $1 രഹസ്യവാക്കുകളുടെ പട്ടികയിൽ ഉള്ളത്}} ആകരുത്."
+       "passwordpolicies-policy-passwordcannotbepopular": "രഹസ്യവാക്ക് {{PLURAL:$1|പ്രചുരപ്രചാരത്തിൽ ഉള്ളത്|പ്രചുരപ്രചാരത്തിലുള്ള $1 രഹസ്യവാക്കുകളുടെ പട്ടികയിൽ ഉള്ളത്}} ആകരുത്.",
+       "passwordpolicies-policy-passwordnotinlargeblacklist": "രഹസ്യവാക്ക്, പരക്കെ ഉപയോഗിക്കപ്പെടുന്ന 1,00,000 രഹസ്യവാക്കുകളുടെ പട്ടികയിൽ ഉള്ളതാവരുത്.",
+       "passwordpolicies-policyflag-forcechange": "ലോഗിൻ മാറ്റിയിരിക്കണം",
+       "passwordpolicies-policyflag-suggestchangeonlogin": "ലോഗിൻ മാറ്റാൻ നിർദ്ദേശിക്കുന്നു",
+       "unprotected-js": "സുരക്ഷാകാരണങ്ങളാൽ സംരക്ഷണമില്ലാത്ത താളുകളിൽ നിന്നും ജാവാസ്ക്രിപ്റ്റ് എടുത്തുപയോഗിക്കാൻ കഴിയില്ല. ജാവാസ്ക്രിപ്റ്റ് താളുകൾ മീഡിയവിക്കി: നാമമേഖലയിലോ ഉപയോക്തൃ ഉപതാളായോ മാത്രം സൃഷ്ടിക്കുക"
 }
index bf7c76a..05016bf 100644 (file)
@@ -99,6 +99,7 @@
        "tog-norollbackdiff": "Ikke vis diff etter tilbakestilling",
        "tog-useeditwarning": "Si ifra dersom jeg forlater en side uten å lagre den.",
        "tog-prefershttps": "Bruk alltid en trygg forbindelse når du er innlogget",
+       "tog-showrollbackconfirmation": "Be om bekreftelse når man klikker på en tilbakestillingslenke",
        "underline-always": "Alltid",
        "underline-never": "Aldri",
        "underline-default": "Drakta eller nettleserens standardinnstillinger",
        "badretype": "Passordene samsvarte ikke.",
        "usernameinprogress": "Opprettelsesprosessen for dette brukernavnet er igang.\nVennligst vent.",
        "userexists": "Brukernavnet er allerede i bruk.\nVelg et annet brukernavn.",
+       "createacct-normalization": "Brukernavnet ditt vil bli endret til «$2» på grunn av tekniske begrensninger.",
        "loginerror": "Innloggingsfeil",
        "createacct-error": "Feil med kontoppretting",
        "createaccounterror": "Kunne ikke opprette konto: $1",
        "ipb-confirm": "Bekreft blokkering",
        "ipb-sitewide": "Hele nettstedet",
        "ipb-partial": "Delvis",
+       "ipb-sitewide-help": "Alle sider på wikien og alle andre bidragshandlinger.",
+       "ipb-partial-help": "Spesifikke sider eller navnerom.",
        "ipb-pages-label": "Sider",
        "ipb-namespaces-label": "Navnerom",
        "badipaddress": "Ugyldig IP-adresse.",
        "logentry-rights-autopromote": "$1 ble automatisk {{GENDER:$2|forfremmet}} fra $4 til $5",
        "logentry-upload-upload": "$1 {{GENDER:$2|lastet opp}} $3",
        "logentry-upload-overwrite": "$1 {{GENDER:$2|lastet opp}} en ny versjon av $3",
-       "logentry-upload-revert": "$1 {{GENDER:$2|lastet opp}} $3",
+       "logentry-upload-revert": "$1 {{GENDER:$2|tilbakestilte}} $3 til en gammel versjon",
        "log-name-managetags": "Taggbehandlingslogg",
        "log-description-managetags": "Denne siden lister opp behandlingsoppgaver i forbindelse med [[Special:Tags|tagger]]. Loggen inneholder bare handlinger som er blitt gjort manuelt av en administrator; tagger kan opprettes eller slettes av programvaren uten at det kommer et oppslag i denne loggen.",
        "logentry-managetags-create": "$1 {{GENDER:$2|opprettet}} taggen «$4»",
        "log-action-filter-suppress-reblock": "Brukerundertrykking ved gjenblokkering",
        "log-action-filter-upload-upload": "Ny opplasting",
        "log-action-filter-upload-overwrite": "Gjenopplasting",
+       "log-action-filter-upload-revert": "Tilbakestilling",
        "authmanager-authn-not-in-progress": "Autentisering foregår ikke eller sesjonsdata er tapt. Start igjen fra begynnelsen.",
        "authmanager-authn-no-primary": "De oppgitte akkreditivene kunne ikke autentiseres.",
        "authmanager-authn-no-local-user": "De oppgitte akkreditivene tilhører ingen bruker på denne wikien.",
        "passwordpolicies-policy-maximalpasswordlength": "Passordet kan maksimalt være på $1 {{PLURAL:$1|tegn}}",
        "passwordpolicies-policy-passwordcannotbepopular": "Passordet kan ikke være {{PLURAL:$1|det populære passordet|i lista over $1 populære passord}}",
        "passwordpolicies-policy-passwordnotinlargeblacklist": "Passord kan ikke være i listen over de vanligste 100&nbsp;000 passordene.",
+       "passwordpolicies-policyflag-forcechange": "må endres ved innlogging",
+       "passwordpolicies-policyflag-suggestchangeonlogin": "foreslå endring ved innlogging",
        "easydeflate-invaliddeflate": "Det gitte innholdet er ikke riktig komprimert",
        "unprotected-js": "Av sikkerhetsårsaker kan ikke JavaScript lastes fra ubeskyttede sider. Bare skap JavaScript i MediaWiki-navnerommet eller som en brukerunderside"
 }
index 681382c..e54a79e 100644 (file)
@@ -78,7 +78,8 @@
                        "MokaAkashiyaPT",
                        "Athena in Wonderland",
                        "Fitoschido",
-                       "Ldacosta"
+                       "Ldacosta",
+                       "CaiusSPQR"
                ]
        },
        "tog-underline": "Sublinhar hiperligações:",
        "trackingcategories-summary": "Esta página lista as categorias de monitorização geradas automaticamente pelo software MediaWiki. Os nomes das categorias podem ser alterados modificando as mensagens de sistema relevantes no domínio {{ns:8}}.",
        "trackingcategories-msg": "Categoria monitorada",
        "trackingcategories-name": "Nome da mensagem",
-       "trackingcategories-desc": "Critérios de inclusão",
+       "trackingcategories-desc": "Critérios de inclusão de categoria",
        "restricted-displaytitle-ignored": "Páginas com títulos de apresentação ignorados",
        "restricted-displaytitle-ignored-desc": "Esta página tem um <code><nowiki>{{DISPLAYTITLE}}</nowiki></code> ignorado porque não é equivalente ao título verdadeiro da página.",
        "noindex-category-desc": "A página não é indexada por robôs porque contém a palavra mágica <code><nowiki>__NOINDEX__</nowiki></code> e está num espaço nominal onde esta palavra mágica é permitida.",
        "nolinkshere": "Não existem afluentes para <strong>$2</strong> com as condições especificadas.",
        "nolinkshere-ns": "Não existem afluentes para <strong>$2</strong> no espaço nominal selecionado.",
        "isredirect": "página de redirecionamento",
-       "istemplate": "inclusão",
+       "istemplate": "transclusão",
        "isimage": "hiperligação para ficheiro",
        "whatlinkshere-prev": "{{PLURAL:$1|anterior|$1 anteriores}}",
        "whatlinkshere-next": "{{PLURAL:$1|próximo|próximos $1}}",
index 790633b..b9b59da 100644 (file)
        "tog-norollbackdiff": "Option in [[Special:Preferences]], 'Misc' tab. Only shown for users with the rollback right. By default a diff is shown below the return screen of a rollback. Checking this preference toggle will suppress that. {{Gender}}\n{{Identical|Rollback}}",
        "tog-useeditwarning": "Used as label for the checkbox in [[Special:Preferences#mw-prefsection-editing|Special:Preferences]].",
        "tog-prefershttps": "Toggle option used in [[Special:Preferences]] that indicates if the user wants to use a secure connection when logged in",
-       "tog-showrollbackconfirmation": "Toggle option used in [[Special:Preferences]] to enable/disable rollback confirmation prompt. Should be visible only to users with rollback rights",
+       "tog-showrollbackconfirmation": "Toggle option used in [[Special:Preferences]] to enable/disable rollback confirmation prompt. Should be visible only to users with rollback rights.",
        "underline-always": "Used in [[Special:Preferences#mw-prefsection-rendering|Preferences]].\n\nThis option means \"always underline links\", there are also options {{msg-mw|Underline-never}} and {{msg-mw|Underline-default}}.\n\n{{Gender}}\n{{Identical|Always}}",
        "underline-never": "Used in [[Special:Preferences#mw-prefsection-rendering|Preferences]].\n\nThis option means \"never underline links\", there are also options {{msg-mw|Underline-always}} and {{msg-mw|Underline-default}}.\n\n{{Gender}}\n{{Identical|Never}}",
        "underline-default": "Used in [[Special:Preferences#mw-prefsection-rendering|Preferences]].\n\nThis option means \"underline links as in your user skin or your browser\", there are also options {{msg-mw|Underline-never}} and {{msg-mw|Underline-always}}.\n\n{{Gender}}\n{{Identical|Browser default}}",
        "deleting-backlinks-warning": "A warning shown when a page that is being deleted has at least one link to it or is transcluded in at least one page.",
        "deleting-subpages-warning": "A warning shown when a page that is being deleted has at least one subpage. $1 is the number of subpages of the page. For any number of subpages over 50, $1 will be 51.\nSee also:\n* {{msg-mw|Deleting-backlinks-warning}}",
        "rollback": "{{Identical|Rollback}}",
+       "rollback-confirmation-confirm": "Question shown to user to confirm that they want to proceed with the rollback.\n\nParameters:\n* $1 - number of edits that will be rolled back.",
+       "rollback-confirmation-yes": "Button text to confirm that a rollback should be executed.",
+       "rollback-confirmation-no": "Button text to cancel a rollback instead of executing it.",
        "rollbacklink": "{{Doc-actionlink}}\nThis link text appears on the recent changes page to users who have the \"rollback\" right.\nThis message has a tooltip {{msg-mw|tooltip-rollback}}\n{{Identical|Rollback}}",
        "rollbacklinkcount": "{{doc-actionlink}}\nText of the rollback link showing the number of edits to be rolled back. See also {{msg-mw|rollbacklink}}.\n\nParameters:\n* $1 - the number of edits that will be rolled back. If $1 is over the value of <code>$wgShowRollbackEditCount</code> (default: 10) {{msg-mw|rollbacklinkcount-morethan}} is used.\n\nThe rollback link is displayed with a tooltip {{msg-mw|Tooltip-rollback}}",
        "rollbacklinkcount-morethan": "{{doc-actionlink}}\nText of the rollback link when a greater number of edits is to be rolled back. See also {{msg-mw|rollbacklink}}.\n\nWhen the number of edits rolled back is smaller than [[mw:Special:MyLanguage/Manual:$wgShowRollbackEditCount|$wgShowRollbackEditCount]], {{msg-mw|rollbacklinkcount}} is used instead.\n\nParameters:\n* $1 - number of edits",
index 5837b43..2689432 100644 (file)
        "nosuchusershort": "Ne postoji korisnik sa imenom \"$1\".\nProvjerite da li ste dobro ukucali.",
        "nouserspecified": "Morate izabrati korisničko ime.",
        "login-userblocked": "Ovaj korisnik je blokiran. Prijava nije dozvoljena.",
-       "wrongpassword": "Šifra koju ste uneli je neodgovarajuće. Molimo, upišite je ponovo.\n\nШифра коју сте унели је неодговарајућа. Молимо, упишите је поново.",
+       "wrongpassword": "Uneli ste pogrešno korisničko ime ili lozinku.\nPokušajte ponovo.",
        "wrongpasswordempty": "Unesena lozinka je bila prazna.\nPokušajte ponovno.",
        "passwordtooshort": "Lozinka mora imati najmanje {{PLURAL:$1|1 znak|$1 znakova}}.",
        "passwordtoolong": "Šifre/lozinke/zaporke ne mogu biti duže od {{PLURAL:$1|jednog znaka|$1 znaka|$1 znakova}}.",
        "newarticle": "(Novi)",
        "newarticletext": "Preko linka ste došli na stranicu koja još uvijek ne postoji.\n* Ako želite stvoriti stranicu, počnite tipkati u okviru dolje (v. [$1 stranicu za pomoć] za više informacija).\n* Ukoliko ste došli greškom, pritisnike dugme '''Nazad''' ('''back''') na vašem pregledniku.",
        "anontalkpagetext": "----''Ovo je stranica za razgovor za anonimnog korisnika koji još nije napravio račun ili ga ne koristi.\nZbog toga moramo da koristimo brojčanu IP adresu kako bismo identifikovali njega ili nju.\nTakvu adresu može dijeliti više korisnika.\nAko ste anonimni korisnik i mislite da su vam upućene nebitne primjedbe, molimo Vas da [[Special:CreateAccount|napravite račun]] ili se [[Special:UserLogin|prijavite]] da biste izbjegli buduću zabunu sa ostalim anonimnim korisnicima.''",
-       "noarticletext": "Na ovoj stranici trenutno nema teksta.\nMožete [[Special:Search/{{PAGENAME}}|tražiti naslov ove stranice]] u drugim stranicama,\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} pretraživati srodne registre],\nili [{{fullurl:{{FULLPAGENAME}}|action=edit}} urediti ovu stranicu]</span>.",
+       "noarticletext": "Na ovoj stranici trenutno nema teksta.\nMožete [[Special:Search/{{PAGENAME}}|tražiti naslov ove stranice]] u drugim stranicama,\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} pretraživati srodne registre],\nili [{{fullurl:{{FULLPAGENAME}}|action=edit}} napraviti ovu stranicu]</span>.",
        "noarticletext-nopermission": "Trenutno nema teksta na ovoj stranici.\nMožete [[Special:Search/{{PAGENAME}}|tražiti ovaj naslov stranice]] na drugim stranicama ili <span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} pretražiti povezane registre]</span>. alio nemate dozvolu za stvaranje ove stranice.",
        "missing-revision": "Ne mogu da pronađem izmenu br. $1 na stranici pod nazivom „{{FULLPAGENAME}}“.\n\nOvo se obično dešava kada pratite zastarjelu vezu do stranice koja je obrisana.\nViše informacija možete pronaći u [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} evidenciji brisanja].",
        "userpage-userdoesnotexist": "Korisnički račun \"<nowiki>$1</nowiki>\" nije registrovan.\nMolimo provjerite da li želite napraviti/izmijeniti ovu stranicu.",
        "yourtext": "Vaš tekst / Ваш текст",
        "storedversion": "Uskladištena verzija",
        "editingold": "'''PAŽNJA:  Vi mijenjate stariju reviziju ove stranice.\nAko je snimite, sve promjene učinjene od ove revizije će biti izgubljene.'''",
+       "unicode-support-fail": "Vaš preglednik ne podržava Unicode. On je neophodan za uređivanje stranica, pa zato neću moći sačuvati izmjenu.",
        "yourdiff": "Razlike / Разлике",
        "copyrightwarning": "Molimo da uzmete u obzir kako se smatra da su svi doprinosi u {{SITENAME}} izdani pod $2 (v. $1 za detalje).\nUkoliko ne želite da vaše pisanje bude nemilosrdno uređivano i redistribuirano po tuđoj volji, onda ga nemojte ovdje objavljivati.<br />\nTakođer obećavate kako ste ga napisali sami ili kopirali iz izvora u javnoj domeni ili sličnog slobodnog izvora.\n'''NEMOJTE SLATI RAD ZAŠTIĆEN AUTORSKIM PRAVIMA BEZ DOZVOLE!'''",
        "copyrightwarning2": "Zapamtite da svaki doprinos na stranici {{SITENAME}} može biti izmijenjen, promijenjen ili uklonjen od strane ostalih korisnika. Ako ne želite da ovo desi sa Vašim tekstom, onda ga nemojte slati ovdje.<br />\nTakođer nam garantujete da ste ovo Vi napisali, ili da ste ga kopirali iz javne domene ili sličnog slobodnog izvora informacija (pogledajte $1 za više detalja).\n'''NE ŠALJITE DJELA ZAŠTIĆENA AUTORSKIM PRAVOM BEZ DOZVOLE!'''",
        "permissionserrors": "Greška pri odobrenju",
        "permissionserrorstext": "Nemate dopuštenje da to uradite, iz {{PLURAL:$1|slijedećeg razloga|slijedećih razloga}}:",
        "permissionserrorstext-withaction": "Nemate dozvolu za $2, zbog {{PLURAL:$1|sljedećeg|sljedećih}} razloga:",
-       "contentmodelediterror": "Ne možete urediti ovu izmjenu jer je model sadržaja <code>$1</code>, a trenutni model sadržaja stranice je <code>$2</code>.",
+       "contentmodelediterror": "Ne možete urediti ovu izmjenu jer je njen sadržajni model <code>$1</code>, što se razlikuje od trenutnog sadržajnog modela stranice <code>$2</code>.",
        "recreate-moveddeleted-warn": "'''Upozorenje: Postavljate stranicu koja je prethodno brisana.'''\n\nRazmotrite da li je nastavljanje uređivanja ove stranice u skladu s pravilima.\nOvdje je naveden registar brisanja i premještanja s obrazloženjem:",
        "moveddeleted-notice": "Ova stranica je obrisana.\nRegistar brisanja, zaštite i premještanja stranice je prikazan ispod.",
        "moveddeleted-notice-recent": "Žao nam je, ova stranica je nedavno izbrisana (u prošla 24 sata). \nNiže je navedena evidencija brisanja, zaštite i premještanja.",
        "htmlform-user-not-exists": "<strong>$1</strong> ne postoji.",
        "htmlform-user-not-valid": "<strong>$1</strong> ne predstavlja validno korisničko ime.",
        "logentry-delete-delete": "$1 je {{GENDER:$2|obrisao|obrisala}} stranicu $3",
-       "logentry-delete-restore": "$1 je {{GENDER:$2|vratio|vratila}} stranicu $3",
+       "logentry-delete-delete_redir": "$1 {{GENDER:$2|obrisao|obrisala}} je preusmjerenje $3 presnimavanjem",
+       "logentry-delete-restore": "$1 {{GENDER:$2|vratio je|vratila je}} stranicu $3 ($4)",
+       "logentry-delete-restore-nocount": "$1 {{GENDER:$2|vratio je|vratila je}} stranicu $3",
+       "restore-count-revisions": "{{PLURAL:$1|1 izmjena|$1 izmjene|$1 izmjena}}",
+       "restore-count-files": "{{PLURAL:$1|1 datoteka|$1 datoteke|$1 datoteka}}",
        "logentry-delete-event": "$1 je {{GENDER:$2|promijenio|promijenila}} vidljivost {{PLURAL:$5|događaja|$5 događaja}} u evidenciji na $3: $4",
        "logentry-delete-revision": "$1 je {{GENDER:$2|promijenio|promijenila}} vidljivost {{PLURAL:$5|izmjene|$5 izmjene|$5 izmjena}} na stranici $3: $4",
        "logentry-delete-event-legacy": "$1 je {{GENDER:$2|promijenio|promijenila}} vidljivost događaja u evidenciji na $3",
        "revdelete-uname-unhid": "korisničko ime je otkriveno",
        "revdelete-restricted": "primijenjena ograničenja za administratore",
        "revdelete-unrestricted": "uklonjena ograničenja za administratore",
+       "logentry-block-block": "$1 {{GENDER:$2|blokirao je|blokirala je}} {{GENDER:$4|$3}} u trajanju od $5 $6",
+       "logentry-block-unblock": "$1 {{GENDER:$2|deblokirao je|deblokirala je}} {{GENDER:$4|$3}}",
+       "logentry-block-reblock": "$1 {{GENDER:$2|izmijenio je|izmijenila je}} blok {{GENDER:$4|korisnika|korisnice}} {{GENDER:$4|$3}} u trajanju od $5 $6",
+       "logentry-partialblock-block-page": "{{PLURAL:$1|stranica|stranice}} $2",
+       "logentry-partialblock-block-ns": "{{PLURAL:$1|imenski prostor|imenski prostori}} $2",
+       "logentry-partialblock-block": "$1 {{GENDER:$2|blokirao je|blokirala je}} {{GENDER:$4|$3}} od uređivanja $7 u trajanju od $5 $6",
+       "logentry-partialblock-reblock": "$1 {{GENDER:$2|izmijenio je|izmijenila je}} blokovske postavke za {{GENDER:$4|$3}}, sprečavanje uređivanja $7 u trajanju od $5 $6",
+       "logentry-non-editing-block-block": "$1 {{GENDER:$2|blokirao je|blokirala je}} {{GENDER:$4|$3}} od navedenih neuređivačkih radnji u trajanju od $5 $6",
+       "logentry-non-editing-block-reblock": "$1 {{GENDER:$2|izmijenio je|izmijenila je}} blokovske postavke za {{GENDER:$4|$3}} za navedene neuređivačke radnje u trajanju od $5 $6",
+       "logentry-suppress-block": "$1 {{GENDER:$2|blokirao je|blokirala je}} {{GENDER:$4|$3}} u trajanju od $5 $6",
+       "logentry-suppress-reblock": "$1 {{GENDER:$2|izmijenio je|izmijenila je}} blok {{GENDER:$4|korisnika|korisnice}} {{GENDER:$4|$3}} u trajanju od $5 $6",
+       "logentry-import-upload": "$1 {{GENDER:$2|je uvezao|je uvezla}} $3 otpremanjem datoteke",
+       "logentry-import-upload-details": "$1 {{GENDER:$2|je uvezao|je uvezla}} $3 otpremanjem datoteke ($4 {{PLURAL:$4|izmjena|izmjene|izmjena}})",
+       "logentry-import-interwiki": "$1 {{GENDER:$2|je uvezao|je uvezla}} $3 s drugog wikija",
+       "logentry-import-interwiki-details": "$1 {{GENDER:$2|je uvezao|je uvezla}} $3 sa $5 ($4 {{PLURAL:$4|izmjena|izmjene|izmjena}})",
+       "logentry-merge-merge": "$1 {{GENDER:$2|je pripojio|je pripojila}} $3 u $4 (sve do izmjene $5)",
        "logentry-move-move": "$1 je {{GENDER:$2|premjestio|premjestila}} stranicu $3 na $4",
        "logentry-move-move-noredirect": "$1 je {{GENDER:$2|premjestio|premjestila}} stranicu $3 na $4 bez ostavljanja preusmjerenja",
        "logentry-move-move_redir": "$1 je {{GENDER:$2|premjestio|premjestila}} stranicu $3 na $4 preko preusmjeravanja",
        "logentry-newusers-create2": "Korisnički račun $3 {{GENDER:$2|je napravio|je napravila|je napravio}} $1",
        "logentry-newusers-byemail": "Korisnički račun $3 je {{GENDER:$2|napravio|napravila}} $1 i lozinka/šifra je poslana putem e-maila",
        "logentry-newusers-autocreate": "Korisnički račun $1 je automatski {{GENDER:$2|napravljen}}",
-       "logentry-rights-rights": "$1 je {{GENDER:$2|promijenio|promijenila|promijenio}} članstvo grupe za $3 iz $4 u $5",
+       "logentry-protect-move_prot": "$1 {{GENDER:$2|premjestio|premjestila}} je zaštitne postavke sa $4 na $3",
+       "logentry-protect-unprotect": "$1 {{GENDER:$2|uklonio je|uklonila je}} zaštitu sa stranice $3",
+       "logentry-protect-protect": "$1 {{GENDER:$2|stavio zaštitu|stavila zaštitu}} $3 $4",
+       "logentry-protect-protect-cascade": "$1 {{GENDER:$2|stavio zaštitu|stavila zaštitu}} $3 $4 [prenosiva zaštita]",
+       "logentry-protect-modify": "$1 {{GENDER:$2|izmijenio je|izmijenila je}} stepen zaštite za $3 $4",
+       "logentry-protect-modify-cascade": "$1 {{GENDER:$2|izmijenio je|izmijenila je}} stepen zaštite za $3 $4 [prenosiva zaštita]",
+       "logentry-rights-rights": "$1 {{GENDER:$2|izmijenio je|izmijenila je}} grupno članstvo {{GENDER:$6|korisnika|korisnice}} $3 iz $4 u $5",
        "logentry-rights-rights-legacy": "$1 {{GENDER:$2|je promijenio|je promijenila|je promijenio}} članstvo grupe za $3",
        "logentry-rights-autopromote": "$1 {{GENDER:$2|je automatski unaprijeđen|je automatski unaprijeđena}} iz $4 u $5",
        "logentry-upload-upload": "$1 {{GENDER:$2|postavio|postavila}} je $3",
+       "logentry-upload-overwrite": "$1 {{GENDER:$2|postavio|postavila}} је novu verziju $3",
+       "logentry-upload-revert": "$1 {{GENDER:$2|je postavio|je postavila}} $3 na stariju inačicu",
+       "log-name-managetags": "Evidencija upravljanja oznakama",
+       "log-description-managetags": "Na ovoj stranici nalaze se upraviteljski zadaci što se odnose na [[Special:Tags|oznake]]. Evidencija sadrži samo radnje koje je ručno izvršili administratori; oznake se mogu stvoriti i izbrisati iz wikiprograma i ne nalaze se u evidenciju.",
+       "logentry-managetags-create": "$1 {{GENDER:$2|napravio je|napravila je}} oznaku \"$4\"",
+       "logentry-managetags-delete": "$1 {{GENDER:$2|obrisao je|obrisala je}} oznaku \"$4\" (uklonjena iz {{PLURAL:$5|jedne izmjene ili zapisničkog unosa|$5 izmjena i/ili zapisničkih unosa}})",
+       "logentry-managetags-activate": "$1 {{GENDER:$2|aktivirao je|aktivirala je}} oznaku \"$4\" za upotrebu od strane korisnika i botova",
+       "logentry-managetags-deactivate": "$1 {{GENDER:$2|deaktivirao je|deaktivirala je}} oznaku \"$4\" za upotrebu od strane korisnika i botova",
+       "log-name-tag": "Evidencija oznaka",
+       "log-description-tag": "Ova stranica prikazuje dodavanja i brisanja [[Special:Tags|oznake]] iz pojedinačnih verzija ili zapisničkih unosa. Time se ne bilježe oznake napravljene kao dio uređivanja, brisanja i sličnih radnji.",
+       "logentry-tag-update-add-revision": "$1 {{GENDER:$2|dodao|dodala}} je {{PLURAL:$7|oznaku|oznaka}} $6 u verziji $4 stranice $3",
+       "logentry-tag-update-add-logentry": "$1 {{GENDER:$2|dodao|dodala}} je {{PLURAL:$7|oznaku|oznaka}} $6 u zapisničkom unosu $5 stranice $3",
+       "logentry-tag-update-remove-revision": "$1 {{GENDER:$2|uklonio|uklonila}} je {{PLURAL:$9|oznaku|oznaka}} $8 sa verzije $4 stranice $3",
+       "logentry-tag-update-remove-logentry": "$1 {{GENDER:$2|uklonio|uklonila}} je {{PLURAL:$9|oznaku|oznake}} $8 sa zapisničkog unosa $5 stranice $3",
+       "logentry-tag-update-revision": "$1 {{GENDER:$2|obnovio|obnovila}} je oznake u verziji $4 strane $3 ({{PLURAL:$7|dodana|dodanih}} $6; {{PLURAL:$9|uklonjena|uklonjenih}} $8)",
+       "logentry-tag-update-logentry": "$1 {{GENDER:$2|obnovio|obnovila}} je oznake u zapisničkom unosu $5 strane $3 ({{PLURAL:$7|dodana|dodanih}} $6; {{PLURAL:$9|uklonjena|uklonjenih}} $8)",
        "rightsnone": "(nema)",
+       "rightslogentry-temporary-group": "$1 (privremeno, do $2)",
        "feedback-adding": "Dodajem povratne informacije na stranicu...",
+       "feedback-back": "Nazad",
        "feedback-bugcheck": "Izvrsno! Molimo provjerite da se ne radi o nekom [$1 poznatom \"bugu\"].",
        "feedback-bugnew": "Provereno. Prijavi novu grešku",
        "feedback-bugornote": "Ako ste spremni da detaljno opišete tehnički problem, onda [$1 prijavite grešku].\nU suprotnom, poslužite se jednostavnim obrascem ispod. Vaš komentar će stajati na stranici „[$3 $2]“, zajedno s korisničkim imenom i pregledačem koji koristite.",
        "feedback-cancel": "Otkaži",
        "feedback-close": "Gotovo",
+       "feedback-external-bug-report-button": "Podnesi tehnički zadatak",
+       "feedback-dialog-title": "Podnesi povratne informacije",
+       "feedback-dialog-intro": "Poslužite se s jednostavnim obrazcom ispod da biste poslali svoje mišljenje. Komentar će biti dodan na stranicu \"$1\", zajedno s vašim korisničkim imenom.",
        "feedback-error1": "Greška: neprepoznat rezultat od API-ja",
        "feedback-error2": "Greška: Uređivanje nije uspjelo",
        "feedback-error3": "Greška: nema odgovora od API-ja",
+       "feedback-error4": "Greška: Nije moguće objaviti na dati naslov",
        "feedback-message": "Poruka:",
        "feedback-subject": "Tema:",
        "feedback-submit": "Unesi",
        "feedback-thanks": "Hvala! Vaša povratna informacija je postavljena na stranicu „[$2 $1]“.",
+       "feedback-thanks-title": "Hvala vam!",
+       "feedback-useragent": "Korisnički vršitelj:",
        "searchsuggest-search": "Traži {{GRAMMAR:akuzativ|{{SITENAME}}}}",
        "searchsuggest-containing": "sadrži...",
        "api-error-badtoken": "Unutrašnja greška: token nije ispravan.",
        "api-error-emptypage": "Stvaranje novih praznih stranica nije dozvoljeno.",
        "api-error-publishfailed": "Unutrašnja greška: server nije mogao da spremi privremenu datoteku.",
        "api-error-stashfailed": "Unutrašnja greška: server nije mogao da spremi privremenu datoteku.",
-       "api-error-unknown-warning": "Nepoznato upozorenje: $1",
+       "api-error-unknown-warning": "Nepoznato upozorenje: \"$1\".",
        "api-error-unknownerror": "Nepoznata greška: \"$1\"",
        "duration-seconds": "$1 {{PLURAL:$1|sekunda|sekunde}}",
        "duration-minutes": "$1 {{PLURAL:$1|minuta|minuta}}",
        "duration-centuries": "$1 {{PLURAL:$1|vijek|vijekova}}",
        "duration-millennia": "$1 {{PLURAL:$1|milenijum|milenijuma}}",
        "rotate-comment": "Slika rotirana za $1 {{PLURAL:$1|stepeni}} u smjeru kazaljke na satu",
-       "expand_templates_input": "Unos - Унос",
+       "limitreport-title": "Profilni raščlanjivački podaci:",
+       "limitreport-cputime": "Uporaba procesorskog vremena",
+       "limitreport-cputime-value": "{{PLURAL:$1|jedan sekund|$1 sekunde|$1 sekundi}}",
+       "limitreport-walltime": "Uporaba u realnom vremenu",
+       "limitreport-walltime-value": "{{PLURAL:$1|jedan sekund|$1 sekunde|$1 sekundi}}",
+       "limitreport-ppvisitednodes": "Br. posjećenih čvorova iz pretprocesora",
+       "limitreport-ppgeneratednodes": "Br. stvorenih čvorova iz pretprocesora",
+       "limitreport-postexpandincludesize": "Veličina uključenoga nakon proširenja",
+       "limitreport-postexpandincludesize-value": "$1/$2 {{PLURAL:$2|bajt|bajta|bajtova}}",
+       "limitreport-templateargumentsize": "Veličina argumenta u šablonu",
+       "limitreport-templateargumentsize-value": "$1/$2 {{PLURAL:$2|bajt|bajta|bajtova}}",
+       "limitreport-expansiondepth": "Najveća dubina proširenja",
+       "limitreport-expensivefunctioncount": "Br. složenih raščlanjivačkih funkcija",
+       "limitreport-unstrip-depth": "Unstrip dubina povratljivosti",
+       "limitreport-unstrip-size": "Unstrip veličina nakon proširenja",
+       "limitreport-unstrip-size-value": "$1/$2 {{PLURAL:$2|bajt|bajta|bajtova}}",
+       "expandtemplates": "Proširi šablone",
+       "expand_templates_title": "Naslov konteksta, za {{FULLPAGENAME}} itd.:",
+       "expand_templates_input": "Ulazni wikitekst:",
+       "expand_templates_output": "Izvod",
+       "expand_templates_xml_output": "XML izlaz",
+       "expand_templates_html_output": "Sirov HTML-izlaz",
+       "expand_templates_ok": "U redu",
+       "expand_templates_remove_comments": "Ukloni komentare",
+       "expand_templates_remove_nowiki": "Pritaji <nowiki> oznake u ishodu",
+       "expand_templates_generate_xml": "Prikaži XML stablo za raščlanjivanje",
+       "expand_templates_generate_rawhtml": "Prikazivaj neobrađeni HTML",
        "expand_templates_preview": "Pregled",
-       "mw-widgets-abandonedit": "Da li ste sigurni da želite napustiti mod uređivanja prije nego što snimite?",
-       "mw-widgets-abandonedit-discard": "Odbaci izmjene",
+       "expand_templates_input_missing": "Morate unjeti neki wikitekst.",
+       "pagelanguage": "Promena jezika stranice",
+       "pagelang-name": "Stranica",
+       "pagelang-language": "Jezik",
+       "pagelang-use-default": "Koristi podrazumijevani jezik",
+       "pagelang-select-lang": "Odaberite jezik",
+       "pagelang-reason": "Razlog",
+       "pagelang-submit": "Pošalji",
+       "pagelang-nonexistent-page": "Stranica $1 ne postoji.",
+       "pagelang-unchanged-language": "Stranica $1 već je namjestena na jezik $2.",
+       "pagelang-unchanged-language-default": "Stranica $1 već je namjestena na matični sadržajni jezik wikija.",
+       "pagelang-db-failed": "Baza podataka nije uspjela smijeniti sadržajni jezik.",
+       "right-pagelang": "Mijenjanje jezika stranice",
+       "action-pagelang": "mijenjanje jezika stranice",
+       "log-name-pagelang": "Evidencija mijenjanja jezika",
+       "log-description-pagelang": "Ovo je evidencija promjena jezika stranica.",
+       "logentry-pagelang-pagelang": "$1 {{GENDER:$2|smijenio je|smijenila je}} jezik stranice $3 iz $4 u $5.",
+       "default-skin-not-found": "Nažalost, predodređena tema vašeg wikija ddefinirana u <code dir=\"ltr\">$wgDefaultSkin</code> kao <code>$1</code> nije dostupna.\n\nVaša uspostava sadrži {{PLURAL:$4|sljedeću temu|sljedeće teme}}. Pogledajte [https://www.mediawiki.org/wiki/Manual:Skin_configuration Priručnik: Podešavanje tema] da biste saznali kako ih uključiti i kako odabrati osnovnu.\n\n$2\n\n; Ako ste upravo uspostavili MediaWiki:\n: Vjerovatno ste je uspostavili sa gita, ili pak neposredno sa izvornog koda koristeći se nekom drugom metodom. Ovo je za očekivati. Pokušajte uspostaviti neku temu sa [https://www.mediawiki.org/wiki/Category:All_skins kataloga tema] tako što ćete:\n:* Sa preuzimanjem [https://www.mediawiki.org/wiki/Download tarball-uspostavljača], koji sami sadrži nekoliko tema i proširenja. Možete prekopirati folder <code>skins/</code> iz njega.\n:* Preuzimanje tarball-i za teme sa [https://www.mediawiki.org/wiki/Special:SkinDistributor mediawiki.org]. \n:* [https://www.mediawiki.org/wiki/Download_from_Git#Using_Git_to_download_MediaWiki_skins Koristeći Git kako biste preuzeli teme].\n: Ovo ne bi trebalo utjecati na vaše git skladište ako ste MediaWiki razvijatelj.\n\n; Ako ste upravo nadogradili MediaWiki:\n: MediaWiki 1.24 i više verzije više ne automatski uključuju uspostavljene teme (pogl. [https://www.mediawiki.org/wiki/Manual:Skin_autodiscovery Priručni: Samoistraživanje tema]). Možete prekopirati {{PLURAL:$5|sljedeći red kǒda|sljedeće redove kǒda}} u <code>LocalSettings.php</code> kako biste uključili {{PLURAL:$5|uspostavljenu temu|sve uspostavljene teme}}:\n\n<pre dir=\"ltr\">$3</pre>\n\n; Ako ste upravo izmijenili datoteku <code>LocalSettings.php</code>:\n: Provjerite je li ispravno napisani nazivi tema.",
+       "default-skin-not-found-row-enabled": "* <code>$1</code> / $2 (uključena)",
+       "default-skin-not-found-row-disabled": "* <code>$1</code> / $2 (<strong>isključena</strong>)",
+       "mediastatistics": "Statistike za slike i snimke",
+       "mediastatistics-summary": "Statistike o poslanih tipovima datoteka. Ovdje su uračunate samo najnovije verzije datoteka. Stare i obrisane verzije nisu uračunate.",
+       "mediastatistics-nbytes": "{{PLURAL:$1|Jedan bajt|$1 bajta|$1 bajtova}} ($2; $3%)",
+       "mediastatistics-bytespertype": "Ukupni obuhvat pasusa: {{PLURAL:$1|$1 bajt|$1 bajta|$1 bajtova}} ($2; $3%).",
+       "mediastatistics-allbytes": "Ukupni obuhvat svih datoteka: {{PLURAL:$1|$1 bajt|$1 bajta|$1 bajtova}} ($2).",
+       "mediastatistics-table-mimetype": "MIME tip",
+       "mediastatistics-table-extensions": "Mogući dodaci",
+       "mediastatistics-table-count": "Broj datoteka",
+       "mediastatistics-table-totalbytes": "Ukupna veličina",
+       "mediastatistics-header-unknown": "Nepoznato",
+       "mediastatistics-header-bitmap": "Bitmap-slika",
+       "mediastatistics-header-drawing": "Crteži (vektorske slike)",
+       "mediastatistics-header-audio": "Zvuk",
+       "mediastatistics-header-video": "Videa",
+       "mediastatistics-header-multimedia": "Obogaćeni snimci",
+       "mediastatistics-header-office": "Birotehničke",
+       "mediastatistics-header-text": "Tekstualne",
+       "mediastatistics-header-executable": "Izvršne",
+       "mediastatistics-header-archive": "Zbijeni formati",
+       "mediastatistics-header-total": "Sve datoteke",
+       "json-warn-trailing-comma": "{{PLURAL:$1|Uklonjena je jedna prateća tačka|Uklonjene su $1 prateća tačka|Uklonjeno je $1 pratećih tački}} iz JSON-a",
+       "json-error-unknown": "Dogodio se problem s JSON-om. Greška: $1",
+       "json-error-depth": "Prekoračena je najveća dozvoljena dubina plasta",
+       "json-error-state-mismatch": "Nevažeći ili pokvareni JSON",
+       "json-error-ctrl-char": "Greška u kontrolnom simbolu. Moguće je da je neispravno enkodiran",
+       "json-error-syntax": "Sintaksna greška",
+       "json-error-utf8": "Pokvareni UTF-8 znaci. Moguće je da su neispravno enkodirani",
+       "json-error-recursion": "Postoji jedna ili više povtorljivih referenci u vrijednosti koju treba enkodirati",
+       "json-error-inf-or-nan": "Postoji jedna ili više NAN- ili INF-vrijednosti što treba enkodirati",
+       "json-error-unsupported-type": "Data je vrijednost tipa što se ne može enkodirati",
+       "headline-anchor-title": "Veza do ovog podnaslova",
+       "special-characters-group-latin": "Latinica",
+       "special-characters-group-latinextended": "Proširena latinica",
+       "special-characters-group-ipa": "IPA",
+       "special-characters-group-symbols": "Simboli",
+       "special-characters-group-greek": "Grčki",
+       "special-characters-group-greekextended": "Prošireni grčki",
+       "special-characters-group-cyrillic": "Ćirilica",
+       "special-characters-group-arabic": "Arapski",
+       "special-characters-group-arabicextended": "Prošireni arapski",
+       "special-characters-group-persian": "Perzijski",
+       "special-characters-group-hebrew": "Hebrejski",
+       "special-characters-group-bangla": "Bengalski",
+       "special-characters-group-tamil": "Tamilski",
+       "special-characters-group-telugu": "Telugu",
+       "special-characters-group-sinhala": "Sinhalski",
+       "special-characters-group-gujarati": "Gudžarati",
+       "special-characters-group-devanagari": "Devanagari",
+       "special-characters-group-thai": "Tajlandski",
+       "special-characters-group-lao": "Laoski",
+       "special-characters-group-khmer": "Kmerski",
+       "special-characters-group-canadianaboriginal": "Kanadski domorodni",
+       "special-characters-title-endash": "crtica",
+       "special-characters-title-emdash": "duga crta",
+       "special-characters-title-minus": "minus",
+       "mw-widgets-abandonedit": "Da li ste sigurni da želite napustiti mod uređivanja bez snimanja izmjena?",
+       "mw-widgets-abandonedit-discard": "Odbaci uređivanja",
        "mw-widgets-abandonedit-keep": "Nastavi s uređivanjem",
-       "mw-widgets-abandonedit-title": "Da li ste sigurni?"
+       "mw-widgets-abandonedit-title": "Da li ste sigurni?",
+       "mw-widgets-dateinput-no-date": "Datum nije izabran",
+       "mw-widgets-mediasearch-input-placeholder": "Pretražite slike/snimke",
+       "mw-widgets-mediasearch-noresults": "Nisam pronašao ništa.",
+       "mw-widgets-titleinput-description-new-page": "stranica još ne postoji",
+       "mw-widgets-titleinput-description-redirect": "preusmjerava na $1",
+       "mw-widgets-categoryselector-add-category-placeholder": "Dodaj kategoriju...",
+       "mw-widgets-usersmultiselect-placeholder": "Dodaj još...",
+       "mw-widgets-titlesmultiselect-placeholder": "Dodaj još...",
+       "date-range-from": "Od datuma:",
+       "date-range-to": "Do datuma:",
+       "sessionmanager-tie": "Ne možete istovremeno koristiti nekoliko vrsta provjera autentičnosti: $1.",
+       "sessionprovider-generic": "$1 sesije",
+       "sessionprovider-mediawiki-session-cookiesessionprovider": "sesije s kolačićima",
+       "sessionprovider-nocookies": "Kolačići su možda onemogućeni. Ako je tako, uključite ih, i počnite ponovo.",
+       "randomrootpage": "Slučajna korijenska stranica",
+       "log-action-filter-block": "Tip bloka:",
+       "log-action-filter-contentmodel": "Tip promjene sadržajnog modela:",
+       "log-action-filter-delete": "Tip brisanja:",
+       "log-action-filter-import": "Tip uvoza:",
+       "log-action-filter-managetags": "Tip radnje upravljanja oznakama:",
+       "log-action-filter-move": "Tip premještanja:",
+       "log-action-filter-newusers": "Tip stvaranja računa:",
+       "log-action-filter-patrol": "Tip patroliranja:",
+       "log-action-filter-protect": "Tip zaštite:",
+       "log-action-filter-rights": "Tip promjene u pravima:",
+       "log-action-filter-suppress": "Tip skrivanja:",
+       "log-action-filter-upload": "Tip postavljanja:",
+       "log-action-filter-all": "Sve",
+       "log-action-filter-block-block": "blokiranje",
+       "log-action-filter-block-reblock": "Izmjena bloka",
+       "log-action-filter-block-unblock": "Deblokiranje",
+       "log-action-filter-contentmodel-change": "Promjena sadržajnog modela",
+       "log-action-filter-contentmodel-new": "Pravljenje stranice s nestandardnim sadržajnim modelom",
+       "log-action-filter-delete-delete": "Brisanje stranice",
+       "log-action-filter-delete-delete_redir": "Presnimavanje preusmjerenja",
+       "log-action-filter-delete-restore": "Povratak stranice",
+       "log-action-filter-delete-event": "Brisanje evidencije",
+       "log-action-filter-delete-revision": "Brisanje izmjene",
+       "log-action-filter-import-interwiki": "Prekowiki-uvoz",
+       "log-action-filter-import-upload": "Uvoz postavljanjem XML-a",
+       "log-action-filter-managetags-create": "Stvaranje oznake",
+       "log-action-filter-managetags-delete": "Brisanje oznake",
+       "log-action-filter-managetags-activate": "Aktiviranje oznake",
+       "log-action-filter-managetags-deactivate": "Deaktiviranje oznake",
+       "log-action-filter-move-move": "Premještanje bez presnimavanja preusmjerenja",
+       "log-action-filter-move-move_redir": "Premještanje s presnimavanjem preusmjerenja",
+       "log-action-filter-newusers-create": "Stvorio anonimni korisnik",
+       "log-action-filter-newusers-create2": "Stvorio registrirani korisnik",
+       "log-action-filter-newusers-autocreate": "Automatski stvoren",
+       "log-action-filter-newusers-byemail": "Stvoren lozinkom poslanom na adresu e-pošte",
+       "log-action-filter-patrol-patrol": "Ručno patrolirano",
+       "log-action-filter-patrol-autopatrol": "Automatski patrolirano",
+       "log-action-filter-protect-protect": "Zaštita",
+       "log-action-filter-protect-modify": "Izmjena zaštite",
+       "log-action-filter-protect-unprotect": "Odzaštita",
+       "log-action-filter-protect-move_prot": "Premještanje zaštite",
+       "log-action-filter-rights-rights": "Ručna promjena",
+       "log-action-filter-rights-autopromote": "Automatska promjena",
+       "log-action-filter-suppress-event": "Skrivanje zapisa u evidenciji",
+       "log-action-filter-suppress-revision": "Skrivanje izmjene",
+       "log-action-filter-suppress-delete": "Skrivanje stranice",
+       "log-action-filter-suppress-block": "Skrivanje korisnikota preko blokiranja",
+       "log-action-filter-suppress-reblock": "Skrivanje korisnikota preko preblokiranja",
+       "log-action-filter-upload-upload": "Novo postavljanje",
+       "log-action-filter-upload-overwrite": "Prepostavljanje",
+       "log-action-filter-upload-revert": "Vrati",
+       "authmanager-authn-not-in-progress": "Verifikacija nije u toku, ili ima gubitak podataka o sesiji. Počnite ispočetka.",
+       "authmanager-authn-no-primary": "Pruženi akreditivi ne mogu se verificirati.",
+       "authmanager-authn-no-local-user": "Pruženi akreditivi nisu povezani ni s jednim korisnikom na ovom wikiju.",
+       "authmanager-authn-no-local-user-link": "Pruženi akreditivi su važeći, ali nisu povezani ni s jednim korisnikom na ovom wikiju. Prijavite se na drugačiji način, ili napravite novi korisnički račun, što će vam dati mogućnost da svežete prethodne akreditive na novi račun.",
+       "authmanager-authn-autocreate-failed": "Automatsko stvaranje mjesnog računa nije uspjelo: $1",
+       "authmanager-change-not-supported": "Pružene akreditive ne mogu se mijenjati, jer ih ništa ne bi koristilo.",
+       "authmanager-create-disabled": "Onemogućeno pravljenje računa.",
+       "authmanager-create-from-login": "Popunite polja da biste napravili račun.",
+       "authmanager-create-not-in-progress": "Pravljenje računa nije u toku, ili ima gubitak podataka o sesiji. Počnite ispočetka.",
+       "authmanager-create-no-primary": "Pružene akreditive ne mogu se uporabiti za otvaranje naloga.",
+       "authmanager-link-no-primary": "Pružene akreditive ne mogu se uporabiti u povezivanju naloga.",
+       "authmanager-link-not-in-progress": "Spajanje naloga nije u toku, ili ima gubitak podataka o sesiji. Počnite ispočetka.",
+       "authmanager-autocreate-noperm": "Automatsko pravljenje računa nije dozvoljeno.",
+       "authmanager-autocreate-exception": "Automatsko pravljenje računa privremeno je onemogućeno zbog prijašnjih greški.",
+       "authmanager-userdoesnotexist": "Korisnički račun \"$1\" nije registrovan.",
+       "userjsispublic": "Napomena: podstranice s JavaScriptom ne bi trebale sadržavati povjerljive podatke budući da ih drugi korisnici mogu vidjeti.",
+       "userjsonispublic": "Imajte na umu: Podstranice s JSONom ne bi trebale sadržavati povjerljive podatke budući da su vidljive drugim korisnicima.",
+       "usercssispublic": "Napomena: podstranice s CSS-om ne bi trebale sadržavati povjerljive podatke budući da ih drugi korisnici mogu vidjeti.",
+       "restrictionsfield-badip": "Nevažeća IP adresa ili opseg: $1",
+       "restrictionsfield-label": "Dozvoljeni IP-opsezi:",
+       "restrictionsfield-help": "Jedna IP-adresa ili CIDR-opseg po redu. Da omogućite sve, koristite<br /><code>0.0.0.0/0</code><br /><code>::/0</code>",
+       "edit-error-short": "Greška: $1",
+       "edit-error-long": "Greške:\n\n$1",
+       "revid": "izmjena $1",
+       "pageid": "ID stranice $1"
 }
index aca767d..eeab21e 100644 (file)
        "tog-norollbackdiff": "Visa inte diff efter tillbakarullning",
        "tog-useeditwarning": "Varna mig om jag lämnar en redigeringssida med osparade ändringar",
        "tog-prefershttps": "Använd alltid en säker anslutning medan jag är inloggad",
+       "tog-showrollbackconfirmation": "Visa en bekräftelsedialog när man klickar på en tillbakarullningslänk",
        "underline-always": "Alltid",
        "underline-never": "Aldrig",
        "underline-default": "Webbläsarens eller utseendets standardinställning",
index 07860da..2ad4915 100644 (file)
        "ipb-blocklist-contribs": "{{GENDER:$1|$1}} için katkılar",
        "ipb-blocklist-duration-left": "$1 ayrıldı",
        "block-expiry": "Bitiş süresi",
+       "block-target": "Kullanıcı adı veya IP adresi:",
        "unblockip": "Kullanıcının engellemesini kaldır",
        "unblockiptext": "Daha önceden engellenmiş bir IP adresine ya da kullanıcı adına yazma erişimini geri vermek için aşağıdaki formu kullanın.",
        "ipusubmit": "Bu engellemeyi kaldır",
        "emailblock": "e-posta engellendi",
        "blocklist-nousertalk": "kendi mesaj sayfasını değiştiremez",
        "blocklist-editing-sitewide": "düzenleme (site geneli)",
+       "blocklist-editing-page": "sayfalar",
+       "blocklist-editing-ns": "ad alanı",
        "ipblocklist-empty": "Engelleme listesi boş.",
        "ipblocklist-no-results": "İstenen IP adresi ya da kullanıcı adı engellenmedi.",
        "blocklink": "engelle",
index b638b42..ad748f3 100644 (file)
@@ -1281,27 +1281,45 @@ abstract class Maintenance {
         * @author Rob Church <robchur@gmail.com>
         */
        public function purgeRedundantText( $delete = true ) {
+               global $wgMultiContentRevisionSchemaMigrationStage;
+
                # Data should come off the master, wrapped in a transaction
                $dbw = $this->getDB( DB_MASTER );
                $this->beginTransaction( $dbw, __METHOD__ );
 
-               # Get "active" text records from the revisions table
-               $cur = [];
-               $this->output( 'Searching for active text records in revisions table...' );
-               $res = $dbw->select( 'revision', 'rev_text_id', [], __METHOD__, [ 'DISTINCT' ] );
-               foreach ( $res as $row ) {
-                       $cur[] = $row->rev_text_id;
-               }
-               $this->output( "done.\n" );
+               if ( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_READ_OLD ) {
+                       # Get "active" text records from the revisions table
+                       $cur = [];
+                       $this->output( 'Searching for active text records in revisions table...' );
+                       $res = $dbw->select( 'revision', 'rev_text_id', [], __METHOD__, [ 'DISTINCT' ] );
+                       foreach ( $res as $row ) {
+                               $cur[] = $row->rev_text_id;
+                       }
+                       $this->output( "done.\n" );
 
-               # Get "active" text records from the archive table
-               $this->output( 'Searching for active text records in archive table...' );
-               $res = $dbw->select( 'archive', 'ar_text_id', [], __METHOD__, [ 'DISTINCT' ] );
-               foreach ( $res as $row ) {
-                       # old pre-MW 1.5 records can have null ar_text_id's.
-                       if ( $row->ar_text_id !== null ) {
-                               $cur[] = $row->ar_text_id;
+                       # Get "active" text records from the archive table
+                       $this->output( 'Searching for active text records in archive table...' );
+                       $res = $dbw->select( 'archive', 'ar_text_id', [], __METHOD__, [ 'DISTINCT' ] );
+                       foreach ( $res as $row ) {
+                               # old pre-MW 1.5 records can have null ar_text_id's.
+                               if ( $row->ar_text_id !== null ) {
+                                       $cur[] = $row->ar_text_id;
+                               }
+                       }
+                       $this->output( "done.\n" );
+               } else {
+                       # Get "active" text records via the content table
+                       $cur = [];
+                       $this->output( 'Searching for active text records via contents table...' );
+                       $res = $dbw->select( 'content', 'content_address', [], __METHOD__, [ 'DISTINCT' ] );
+                       $blobStore = MediaWikiServices::getInstance()->getBlobStore();
+                       foreach ( $res as $row ) {
+                               $textId = $blobStore->getTextIdFromAddress( $row->content_address );
+                               if ( $textId ) {
+                                       $cur[] = $textId;
+                               }
                        }
+                       $this->output( "done.\n" );
                }
                $this->output( "done.\n" );
 
index 512910c..0479a91 100644 (file)
@@ -29,6 +29,9 @@ require_once __DIR__ . '/7zip.inc';
 require_once __DIR__ . '/../includes/export/WikiExporter.php';
 
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\BlobAccessException;
+use MediaWiki\Storage\BlobStore;
+use MediaWiki\Storage\SqlBlobStore;
 use Wikimedia\Rdbms\IMaintainableDatabase;
 
 /**
@@ -139,6 +142,13 @@ TEXT
                }
        }
 
+       /**
+        * @return BlobStore
+        */
+       private function getBlobStore() {
+               return MediaWikiServices::getInstance()->getBlobStore();
+       }
+
        function execute() {
                $this->processOptions();
                $this->dump( true );
@@ -520,17 +530,17 @@ TEXT
        }
 
        /**
-        * Tries to get the revision text for a revision id.
-        * Export transformations are applied if the content model can is given or can be
+        * Tries to load revision text.
+        * Export transformations are applied if the content model is given or can be
         * determined from the database.
         *
         * Upon errors, retries (Up to $this->maxFailures tries each call).
-        * If still no good revision get could be found even after this retrying, "" is returned.
+        * If still no good revision could be found even after this retrying, "" is returned.
         * If no good revision text could be returned for
         * $this->maxConsecutiveFailedTextRetrievals consecutive calls to getText, MWException
         * is thrown.
         *
-        * @param string $id The revision id to get the text for
+        * @param int|string $id Content address, or text row ID.
         * @param string|bool|null $model The content model used to determine
         *  applicable export transformations.
         *  If $model is null, it will be determined from the database.
@@ -558,6 +568,7 @@ TEXT
                $consecutiveFailedTextRetrievals = 0;
 
                if ( $model === null && $wgContentHandlerUseDB ) {
+                       // TODO: MCR: use content table
                        $row = $this->db->selectRow(
                                'revision',
                                [ 'rev_content_model', 'rev_content_format' ],
@@ -700,30 +711,35 @@ TEXT
        }
 
        /**
-        * May throw a database error if, say, the server dies during query.
-        * @param int $id
+        * Loads the serialized content from storage.
+        *
+        * @param int|string $id Content address, or text row ID.
         * @return bool|string
-        * @throws MWException
         */
        private function getTextDb( $id ) {
-               if ( !isset( $this->db ) ) {
-                       throw new MWException( __METHOD__ . "No database available" );
-               }
-               $row = $this->db->selectRow( 'text',
-                       [ 'old_text', 'old_flags' ],
-                       [ 'old_id' => $id ],
-                       __METHOD__ );
-               $text = Revision::getRevisionText( $row );
-               if ( $text === false ) {
+               $store = $this->getBlobStore();
+               $address = ( is_int( $id ) || strpos( $id, ':' ) === false )
+                       ? SqlBlobStore::makeAddressFromTextId( (int)$id )
+                       : $id;
+
+               try {
+                       $text = $store->getBlob( $address );
+
+                       $stripped = str_replace( "\r", "", $text );
+                       $normalized = MediaWikiServices::getInstance()->getContentLanguage()
+                               ->normalize( $stripped );
+
+                       return $normalized;
+               } catch ( BlobAccessException $ex ) {
+                       // XXX: log a warning?
                        return false;
                }
-               $stripped = str_replace( "\r", "", $text );
-               $normalized = MediaWikiServices::getInstance()->getContentLanguage()->
-                       normalize( $stripped );
-
-               return $normalized;
        }
 
+       /**
+        * @param int|string $id Content address, or text row ID.
+        * @return bool|string
+        */
        private function getTextSpawned( $id ) {
                Wikimedia\suppressWarnings();
                if ( !$this->spawnProc ) {
@@ -797,6 +813,10 @@ TEXT
                Wikimedia\restoreWarnings();
        }
 
+       /**
+        * @param int|string $id Content address, or text row ID.
+        * @return bool|string
+        */
        private function getTextSpawnedOnce( $id ) {
                $ok = fwrite( $this->spawnWrite, "$id\n" );
                // $this->progress( ">> $id" );
@@ -812,10 +832,23 @@ TEXT
 
                // check that the text id they are sending is the one we asked for
                // this avoids out of sync revision text errors we have encountered in the past
-               $newId = fgets( $this->spawnRead );
-               if ( $newId === false ) {
+               $newAddress = fgets( $this->spawnRead );
+               if ( $newAddress === false ) {
                        return false;
                }
+               if ( strpos( $newAddress, ':' ) === false ) {
+                       $newId = intval( $newAddress );
+                       if ( $newId === false ) {
+                               return false;
+                       }
+               } else {
+                       try {
+                               $newAddressFields = SqlBlobStore::splitBlobAddress( $newAddress );
+                               $newId = $newAddressFields[ 1 ];
+                       } catch ( InvalidArgumentException $ex ) {
+                               return false;
+                       }
+               }
                if ( $id != intval( $newId ) ) {
                        return false;
                }
index bc4fa31..8d04adc 100644 (file)
@@ -24,7 +24,9 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
-use Wikimedia\Rdbms\IDatabase;
+use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\BlobAccessException;
+use MediaWiki\Storage\SqlBlobStore;
 
 /**
  * Maintenance script used to fetch page text in a subprocess.
@@ -32,14 +34,24 @@ use Wikimedia\Rdbms\IDatabase;
  * @ingroup Maintenance
  */
 class FetchText extends Maintenance {
+
        public function __construct() {
                parent::__construct();
-               $this->addDescription( "Fetch the raw revision blob from an old_id.\n" .
+
+               $this->addDescription( "Fetch the raw revision blob from a blob address.\n" .
+                       "Integer IDs are interpreted as referring to text.old_id for backwards compatibility.\n" .
                        "NOTE: Export transformations are NOT applied. " .
-                       "This is left to backupTextPass.php"
+                       "This is left to dumpTextPass.php"
                );
        }
 
+       /**
+        * @return SqlBlobStore
+        */
+       private function getBlobStore() {
+               return MediaWikiServices::getInstance()->getBlobStore();
+       }
+
        /**
         * returns a string containing the following in order:
         *   textid
@@ -51,7 +63,6 @@ class FetchText extends Maintenance {
         * note that the text string itself is *not* followed by newline
         */
        public function execute() {
-               $db = $this->getDB( DB_REPLICA );
                $stdin = $this->getStdin();
                while ( !feof( $stdin ) ) {
                        $line = fgets( $stdin );
@@ -59,37 +70,30 @@ class FetchText extends Maintenance {
                                // We appear to have lost contact...
                                break;
                        }
-                       $textId = intval( $line );
-                       $text = $this->doGetText( $db, $textId );
-                       if ( $text === false ) {
-                               # actual error, not zero-length text
-                               $textLen = "-1";
-                       } else {
+                       $blobAddress = trim( $line );
+
+                       // Plain integers are supported for backwards compatibility with pre-MCR dumps.
+                       if ( strpos( $blobAddress, ':' ) === false && is_numeric( $blobAddress ) ) {
+                               $blobAddress = SqlBlobStore::makeAddressFromTextId( intval( $blobAddress ) );
+                       }
+
+                       try {
+                               $text = $this->getBlobStore()->getBlob( $blobAddress );
                                $textLen = strlen( $text );
+                       } catch ( BlobAccessException $ex ) {
+                               // XXX: log $ex to stderr?
+                               $textLen = '-1';
+                               $text = '';
+                       } catch ( InvalidArgumentException $ex ) {
+                               // XXX: log $ex to stderr?
+                               $textLen = '-1';
+                               $text = '';
                        }
-                       $this->output( $textId . "\n" . $textLen . "\n" . $text );
-               }
-       }
 
-       /**
-        * May throw a database error if, say, the server dies during query.
-        * @param IDatabase $db
-        * @param int $id The old_id
-        * @return string
-        */
-       private function doGetText( $db, $id ) {
-               $id = intval( $id );
-               $row = $db->selectRow( 'text',
-                       [ 'old_text', 'old_flags' ],
-                       [ 'old_id' => $id ],
-                       __METHOD__ );
-               $text = Revision::getRevisionText( $row );
-               if ( $text === false ) {
-                       return false;
+                       $this->output( $blobAddress . "\n" . $textLen . "\n" . $text );
                }
-
-               return $text;
        }
+
 }
 
 $maintClass = FetchText::class;
index f07bc55..ce1506c 100644 (file)
@@ -93,9 +93,9 @@ TEXT
 
                $throttle = intval( $throttle );
                if ( $begin !== '' ) {
-                       $where = 'cl_to > ' . $dbw->addQuotes( $begin );
+                       $where = [ 'cl_to > ' . $dbw->addQuotes( $begin ) ];
                } else {
-                       $where = null;
+                       $where = [ '1 = 1' ];
                }
                $i = 0;
 
index 644ff87..a264545 100644 (file)
@@ -188,6 +188,11 @@ class PopulateContentTables extends Maintenance {
                        $startOption = 'start-archive';
                }
 
+               if ( !$this->dbw->fieldExists( $table, $fields['text_id'], __METHOD__ ) ) {
+                       $this->writeln( "No need to populate, $table.{$fields['text_id']} field does not exist" );
+                       return;
+               }
+
                $minmax = $this->dbw->selectRow(
                        $table,
                        [ 'min' => "MIN( $idField )", 'max' => "MAX( $idField )" ],
index 900a52a..2e4cc88 100644 (file)
@@ -93,7 +93,7 @@ class RebuildTextIndex extends Maintenance {
                $this->output( "Rebuilding index fields for {$count} pages...\n" );
                $n = 0;
 
-               $revQuery = Revision::getQueryInfo( [ 'page', 'text' ] );
+               $revQuery = Revision::getQueryInfo( [ 'page' ] );
 
                while ( $n < $count ) {
                        if ( $n ) {
@@ -104,7 +104,7 @@ class RebuildTextIndex extends Maintenance {
                        $res = $this->db->select(
                                $revQuery['tables'],
                                $revQuery['fields'],
-                               [ "page_id BETWEEN $n AND $end", 'page_latest = rev_id', 'rev_text_id = old_id' ],
+                               [ "page_id BETWEEN $n AND $end", 'page_latest = rev_id' ],
                                __METHOD__,
                                [],
                                $revQuery['joins']
index 37768cc..3ecd12e 100644 (file)
@@ -90,6 +90,36 @@ jquery.cookie:
       src: https://raw.githubusercontent.com/carhartl/jquery-cookie/v1.3.1/CHANGELOG.md
       integrity: sha384-SQOHhLc7PHxHDQpGE/zv9XfXKL0A7OBu8kuyVDnHVp+zSoWyRw4xUJ+LSm5ql4kS
 
+jquery.form:
+  type: file
+  src: https://raw.githubusercontent.com/jquery-form/form/ff80d9ddf4/jquery.form.js
+  integrity: sha384-h4G2CrcSbixzMvrrK259cNBYaL/vS1D4+KdUN9NJDzQnTU1bQ6Avluget+Id13M7
+  dest: jquery.form.js
+
+jquery.fullscreen:
+  type: file
+  src: https://raw.githubusercontent.com/theopolisme/jquery-fullscreen/v2.1.0/jquery.fullscreen.js
+  integrity: sha384-G4KPs2d99tgcsyUnJ3eeZ1r2hEKDwZfc4+/xowL/LIemq2VVwEE8HpVAWt4WYNLR
+  dest: jquery.fullscreen.js
+
+jquery.hoverIntent:
+  type: file
+  src: https://raw.githubusercontent.com/briancherne/jquery-hoverIntent/823603fdac/jquery.hoverIntent.js
+  integrity: sha384-lca0haN0hqFGGh2aYUhtAgX9dhVHfQnTADH4svDeM6gcXnL7aFGeAi1NYwipDMyS
+  dest: jquery.hoverIntent.js
+
+jquery.jStorage:
+  type: file
+  src: https://raw.githubusercontent.com/andris9/jStorage/v0.4.12/jstorage.js
+  integrity: sha384-geMeN8k803kPp6cqRL4VNfuSM1L8DcbKRk0St/KHJzxgpX9S0y9FA6HxA/JgucrJ
+  dest: jstorage.js
+
+jquery.throttle-debounce:
+  type: file
+  src: https://raw.githubusercontent.com/cowboy/jquery-throttle-debounce/v1.1/jquery.ba-throttle-debounce.js
+  integrity: sha384-ULOy4DbAghrCqRcrTJLXOY9e4gDpWh0BeEf6xMSL0VtNudXWggcb6AmrVrl4KDAP
+  dest: jquery.ba-throttle-debounce.js
+
 moment:
   type: tar
   src: https://codeload.github.com/moment/moment/tar.gz/2.24.0
index 86bca6c..5e5f308 100644 (file)
@@ -223,10 +223,10 @@ return [
                'targets' => [ 'desktop', 'mobile' ],
        ],
        'jquery.form' => [
-               'scripts' => 'resources/lib/jquery.form.js',
+               'scripts' => 'resources/lib/jquery.form/jquery.form.js',
        ],
        'jquery.fullscreen' => [
-               'scripts' => 'resources/lib/jquery.fullscreen.js',
+               'scripts' => 'resources/lib/jquery.fullscreen/jquery.fullscreen.js',
        ],
        'jquery.getAttrs' => [
                'scripts' => 'resources/src/jquery/jquery.getAttrs.js',
@@ -240,7 +240,7 @@ return [
                'targets' => [ 'desktop', 'mobile' ],
        ],
        'jquery.hoverIntent' => [
-               'scripts' => 'resources/lib/jquery.hoverIntent.js',
+               'scripts' => 'resources/lib/jquery.hoverIntent/jquery.hoverIntent.js',
        ],
        'jquery.i18n' => [
                'scripts' => [
@@ -299,7 +299,7 @@ return [
        ],
        'jquery.jStorage' => [
                'deprecated' => 'Please use "mediawiki.storage" instead.',
-               'scripts' => 'resources/lib/jquery.jStorage.js',
+               'scripts' => 'resources/lib/jquery.jStorage/jstorage.js',
        ],
        'jquery.suggestions' => [
                'targets' => [ 'desktop', 'mobile' ],
@@ -332,7 +332,7 @@ return [
        'jquery.throttle-debounce' => [
                'deprecated' => 'Please use OO.ui.throttle/debounce instead. See '
                        . 'https://phabricator.wikimedia.org/T213426',
-               'scripts' => 'resources/lib/jquery.ba-throttle-debounce.js',
+               'scripts' => 'resources/lib/jquery.throttle-debounce/jquery.ba-throttle-debounce.js',
                'targets' => [ 'desktop', 'mobile' ],
        ],
 
@@ -1776,6 +1776,17 @@ return [
                        'actioncomplete',
                ],
        ],
+       'mediawiki.page.rollback.confirmation' => [
+               'scripts' => 'resources/src/mediawiki.rollback.confirmation.js',
+               'dependencies' => [
+                       'jquery.confirmable'
+               ],
+               'messages' => [
+                       'rollback-confirmation-confirm',
+                       'rollback-confirmation-yes',
+                       'rollback-confirmation-no',
+               ],
+       ],
        'mediawiki.page.image.pagination' => [
                'scripts' => 'resources/src/mediawiki.page.image.pagination.js',
                'dependencies' => [
diff --git a/resources/lib/jquery.ba-throttle-debounce.js b/resources/lib/jquery.ba-throttle-debounce.js
deleted file mode 100644 (file)
index fa30bdf..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-/*!
- * jQuery throttle / debounce - v1.1 - 3/7/2010
- * http://benalman.com/projects/jquery-throttle-debounce-plugin/
- * 
- * Copyright (c) 2010 "Cowboy" Ben Alman
- * Dual licensed under the MIT and GPL licenses.
- * http://benalman.com/about/license/
- */
-
-// Script: jQuery throttle / debounce: Sometimes, less is more!
-//
-// *Version: 1.1, Last updated: 3/7/2010*
-// 
-// Project Home - http://benalman.com/projects/jquery-throttle-debounce-plugin/
-// GitHub       - http://github.com/cowboy/jquery-throttle-debounce/
-// Source       - http://github.com/cowboy/jquery-throttle-debounce/raw/master/jquery.ba-throttle-debounce.js
-// (Minified)   - http://github.com/cowboy/jquery-throttle-debounce/raw/master/jquery.ba-throttle-debounce.min.js (0.7kb)
-// 
-// About: License
-// 
-// Copyright (c) 2010 "Cowboy" Ben Alman,
-// Dual licensed under the MIT and GPL licenses.
-// http://benalman.com/about/license/
-// 
-// About: Examples
-// 
-// These working examples, complete with fully commented code, illustrate a few
-// ways in which this plugin can be used.
-// 
-// Throttle - http://benalman.com/code/projects/jquery-throttle-debounce/examples/throttle/
-// Debounce - http://benalman.com/code/projects/jquery-throttle-debounce/examples/debounce/
-// 
-// About: Support and Testing
-// 
-// Information about what version or versions of jQuery this plugin has been
-// tested with, what browsers it has been tested in, and where the unit tests
-// reside (so you can test it yourself).
-// 
-// jQuery Versions - none, 1.3.2, 1.4.2
-// Browsers Tested - Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome 4-5, Opera 9.6-10.1.
-// Unit Tests      - http://benalman.com/code/projects/jquery-throttle-debounce/unit/
-// 
-// About: Release History
-// 
-// 1.1 - (3/7/2010) Fixed a bug in <jQuery.throttle> where trailing callbacks
-//       executed later than they should. Reworked a fair amount of internal
-//       logic as well.
-// 1.0 - (3/6/2010) Initial release as a stand-alone project. Migrated over
-//       from jquery-misc repo v0.4 to jquery-throttle repo v1.0, added the
-//       no_trailing throttle parameter and debounce functionality.
-// 
-// Topic: Note for non-jQuery users
-// 
-// jQuery isn't actually required for this plugin, because nothing internal
-// uses any jQuery methods or properties. jQuery is just used as a namespace
-// under which these methods can exist.
-// 
-// Since jQuery isn't actually required for this plugin, if jQuery doesn't exist
-// when this plugin is loaded, the method described below will be created in
-// the `Cowboy` namespace. Usage will be exactly the same, but instead of
-// $.method() or jQuery.method(), you'll need to use Cowboy.method().
-
-(function(window,undefined){
-  '$:nomunge'; // Used by YUI compressor.
-  
-  // Since jQuery really isn't required for this plugin, use `jQuery` as the
-  // namespace only if it already exists, otherwise use the `Cowboy` namespace,
-  // creating it if necessary.
-  var $ = window.jQuery || window.Cowboy || ( window.Cowboy = {} ),
-    
-    // Internal method reference.
-    jq_throttle;
-  
-  // Method: jQuery.throttle
-  // 
-  // Throttle execution of a function. Especially useful for rate limiting
-  // execution of handlers on events like resize and scroll. If you want to
-  // rate-limit execution of a function to a single time, see the
-  // <jQuery.debounce> method.
-  // 
-  // In this visualization, | is a throttled-function call and X is the actual
-  // callback execution:
-  // 
-  // > Throttled with `no_trailing` specified as false or unspecified:
-  // > ||||||||||||||||||||||||| (pause) |||||||||||||||||||||||||
-  // > X    X    X    X    X    X        X    X    X    X    X    X
-  // > 
-  // > Throttled with `no_trailing` specified as true:
-  // > ||||||||||||||||||||||||| (pause) |||||||||||||||||||||||||
-  // > X    X    X    X    X             X    X    X    X    X
-  // 
-  // Usage:
-  // 
-  // > var throttled = jQuery.throttle( delay, [ no_trailing, ] callback );
-  // > 
-  // > jQuery('selector').bind( 'someevent', throttled );
-  // > jQuery('selector').unbind( 'someevent', throttled );
-  // 
-  // This also works in jQuery 1.4+:
-  // 
-  // > jQuery('selector').bind( 'someevent', jQuery.throttle( delay, [ no_trailing, ] callback ) );
-  // > jQuery('selector').unbind( 'someevent', callback );
-  // 
-  // Arguments:
-  // 
-  //  delay - (Number) A zero-or-greater delay in milliseconds. For event
-  //    callbacks, values around 100 or 250 (or even higher) are most useful.
-  //  no_trailing - (Boolean) Optional, defaults to false. If no_trailing is
-  //    true, callback will only execute every `delay` milliseconds while the
-  //    throttled-function is being called. If no_trailing is false or
-  //    unspecified, callback will be executed one final time after the last
-  //    throttled-function call. (After the throttled-function has not been
-  //    called for `delay` milliseconds, the internal counter is reset)
-  //  callback - (Function) A function to be executed after delay milliseconds.
-  //    The `this` context and all arguments are passed through, as-is, to
-  //    `callback` when the throttled-function is executed.
-  // 
-  // Returns:
-  // 
-  //  (Function) A new, throttled, function.
-  
-  $.throttle = jq_throttle = function( delay, no_trailing, callback, debounce_mode ) {
-    // After wrapper has stopped being called, this timeout ensures that
-    // `callback` is executed at the proper times in `throttle` and `end`
-    // debounce modes.
-    var timeout_id,
-      
-      // Keep track of the last time `callback` was executed.
-      last_exec = 0;
-    
-    // `no_trailing` defaults to falsy.
-    if ( typeof no_trailing !== 'boolean' ) {
-      debounce_mode = callback;
-      callback = no_trailing;
-      no_trailing = undefined;
-    }
-    
-    // The `wrapper` function encapsulates all of the throttling / debouncing
-    // functionality and when executed will limit the rate at which `callback`
-    // is executed.
-    function wrapper() {
-      var that = this,
-        elapsed = +new Date() - last_exec,
-        args = arguments;
-      
-      // Execute `callback` and update the `last_exec` timestamp.
-      function exec() {
-        last_exec = +new Date();
-        callback.apply( that, args );
-      };
-      
-      // If `debounce_mode` is true (at_begin) this is used to clear the flag
-      // to allow future `callback` executions.
-      function clear() {
-        timeout_id = undefined;
-      };
-      
-      if ( debounce_mode && !timeout_id ) {
-        // Since `wrapper` is being called for the first time and
-        // `debounce_mode` is true (at_begin), execute `callback`.
-        exec();
-      }
-      
-      // Clear any existing timeout.
-      timeout_id && clearTimeout( timeout_id );
-      
-      if ( debounce_mode === undefined && elapsed > delay ) {
-        // In throttle mode, if `delay` time has been exceeded, execute
-        // `callback`.
-        exec();
-        
-      } else if ( no_trailing !== true ) {
-        // In trailing throttle mode, since `delay` time has not been
-        // exceeded, schedule `callback` to execute `delay` ms after most
-        // recent execution.
-        // 
-        // If `debounce_mode` is true (at_begin), schedule `clear` to execute
-        // after `delay` ms.
-        // 
-        // If `debounce_mode` is false (at end), schedule `callback` to
-        // execute after `delay` ms.
-        timeout_id = setTimeout( debounce_mode ? clear : exec, debounce_mode === undefined ? delay - elapsed : delay );
-      }
-    };
-    
-    // Set the guid of `wrapper` function to the same of original callback, so
-    // it can be removed in jQuery 1.4+ .unbind or .die by using the original
-    // callback as a reference.
-    if ( $.guid ) {
-      wrapper.guid = callback.guid = callback.guid || $.guid++;
-    }
-    
-    // Return the wrapper function.
-    return wrapper;
-  };
-  
-  // Method: jQuery.debounce
-  // 
-  // Debounce execution of a function. Debouncing, unlike throttling,
-  // guarantees that a function is only executed a single time, either at the
-  // very beginning of a series of calls, or at the very end. If you want to
-  // simply rate-limit execution of a function, see the <jQuery.throttle>
-  // method.
-  // 
-  // In this visualization, | is a debounced-function call and X is the actual
-  // callback execution:
-  // 
-  // > Debounced with `at_begin` specified as false or unspecified:
-  // > ||||||||||||||||||||||||| (pause) |||||||||||||||||||||||||
-  // >                          X                                 X
-  // > 
-  // > Debounced with `at_begin` specified as true:
-  // > ||||||||||||||||||||||||| (pause) |||||||||||||||||||||||||
-  // > X                                 X
-  // 
-  // Usage:
-  // 
-  // > var debounced = jQuery.debounce( delay, [ at_begin, ] callback );
-  // > 
-  // > jQuery('selector').bind( 'someevent', debounced );
-  // > jQuery('selector').unbind( 'someevent', debounced );
-  // 
-  // This also works in jQuery 1.4+:
-  // 
-  // > jQuery('selector').bind( 'someevent', jQuery.debounce( delay, [ at_begin, ] callback ) );
-  // > jQuery('selector').unbind( 'someevent', callback );
-  // 
-  // Arguments:
-  // 
-  //  delay - (Number) A zero-or-greater delay in milliseconds. For event
-  //    callbacks, values around 100 or 250 (or even higher) are most useful.
-  //  at_begin - (Boolean) Optional, defaults to false. If at_begin is false or
-  //    unspecified, callback will only be executed `delay` milliseconds after
-  //    the last debounced-function call. If at_begin is true, callback will be
-  //    executed only at the first debounced-function call. (After the
-  //    throttled-function has not been called for `delay` milliseconds, the
-  //    internal counter is reset)
-  //  callback - (Function) A function to be executed after delay milliseconds.
-  //    The `this` context and all arguments are passed through, as-is, to
-  //    `callback` when the debounced-function is executed.
-  // 
-  // Returns:
-  // 
-  //  (Function) A new, debounced, function.
-  
-  $.debounce = function( delay, at_begin, callback ) {
-    return callback === undefined
-      ? jq_throttle( delay, at_begin, false )
-      : jq_throttle( delay, callback, at_begin !== false );
-  };
-  
-})(this);
diff --git a/resources/lib/jquery.form.js b/resources/lib/jquery.form.js
deleted file mode 100644 (file)
index 13e9a55..0000000
+++ /dev/null
@@ -1,1089 +0,0 @@
-/*!
- * jQuery Form Plugin
- * version: 3.14 (30-JUL-2012)
- * @requires jQuery v1.3.2 or later
- *
- * Examples and documentation at: http://malsup.com/jquery/form/
- * Project repository: https://github.com/malsup/form
- * Dual licensed under the MIT and GPL licenses:
- *    http://malsup.github.com/mit-license.txt
- *    http://malsup.github.com/gpl-license-v2.txt
- */
-/*global ActiveXObject alert */
-;(function($) {
-"use strict";
-
-/*
-    Usage Note:
-    -----------
-    Do not use both ajaxSubmit and ajaxForm on the same form.  These
-    functions are mutually exclusive.  Use ajaxSubmit if you want
-    to bind your own submit handler to the form.  For example,
-
-    $(document).ready(function() {
-        $('#myForm').on('submit', function(e) {
-            e.preventDefault(); // <-- important
-            $(this).ajaxSubmit({
-                target: '#output'
-            });
-        });
-    });
-
-    Use ajaxForm when you want the plugin to manage all the event binding
-    for you.  For example,
-
-    $(document).ready(function() {
-        $('#myForm').ajaxForm({
-            target: '#output'
-        });
-    });
-    
-    You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
-    form does not have to exist when you invoke ajaxForm:
-
-    $('#myForm').ajaxForm({
-        delegation: true,
-        target: '#output'
-    });
-    
-    When using ajaxForm, the ajaxSubmit function will be invoked for you
-    at the appropriate time.
-*/
-
-/**
- * Feature detection
- */
-var feature = {};
-feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
-feature.formdata = window.FormData !== undefined;
-
-/**
- * ajaxSubmit() provides a mechanism for immediately submitting
- * an HTML form using AJAX.
- */
-$.fn.ajaxSubmit = function(options) {
-    /*jshint scripturl:true */
-
-    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
-    if (!this.length) {
-        log('ajaxSubmit: skipping submit process - no element selected');
-        return this;
-    }
-    
-    var method, action, url, $form = this;
-
-    if (typeof options == 'function') {
-        options = { success: options };
-    }
-
-    method = this.attr('method');
-    action = this.attr('action');
-    url = (typeof action === 'string') ? $.trim(action) : '';
-    url = url || window.location.href || '';
-    if (url) {
-        // clean url (don't include hash vaue)
-        url = (url.match(/^([^#]+)/)||[])[1];
-    }
-
-    options = $.extend(true, {
-        url:  url,
-        success: $.ajaxSettings.success,
-        type: method || 'GET',
-        iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
-    }, options);
-
-    // hook for manipulating the form data before it is extracted;
-    // convenient for use with rich editors like tinyMCE or FCKEditor
-    var veto = {};
-    this.trigger('form-pre-serialize', [this, options, veto]);
-    if (veto.veto) {
-        log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
-        return this;
-    }
-
-    // provide opportunity to alter form data before it is serialized
-    if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
-        log('ajaxSubmit: submit aborted via beforeSerialize callback');
-        return this;
-    }
-
-    var traditional = options.traditional;
-    if ( traditional === undefined ) {
-        traditional = $.ajaxSettings.traditional;
-    }
-    
-    var elements = [];
-    var qx, a = this.formToArray(options.semantic, elements);
-    if (options.data) {
-        options.extraData = options.data;
-        qx = $.param(options.data, traditional);
-    }
-
-    // give pre-submit callback an opportunity to abort the submit
-    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
-        log('ajaxSubmit: submit aborted via beforeSubmit callback');
-        return this;
-    }
-
-    // fire vetoable 'validate' event
-    this.trigger('form-submit-validate', [a, this, options, veto]);
-    if (veto.veto) {
-        log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
-        return this;
-    }
-
-    var q = $.param(a, traditional);
-    if (qx) {
-        q = ( q ? (q + '&' + qx) : qx );
-    }    
-    if (options.type.toUpperCase() == 'GET') {
-        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
-        options.data = null;  // data is null for 'get'
-    }
-    else {
-        options.data = q; // data is the query string for 'post'
-    }
-
-    var callbacks = [];
-    if (options.resetForm) {
-        callbacks.push(function() { $form.resetForm(); });
-    }
-    if (options.clearForm) {
-        callbacks.push(function() { $form.clearForm(options.includeHidden); });
-    }
-
-    // perform a load on the target only if dataType is not provided
-    if (!options.dataType && options.target) {
-        var oldSuccess = options.success || function(){};
-        callbacks.push(function(data) {
-            var fn = options.replaceTarget ? 'replaceWith' : 'html';
-            $(options.target)[fn](data).each(oldSuccess, arguments);
-        });
-    }
-    else if (options.success) {
-        callbacks.push(options.success);
-    }
-
-    options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
-        var context = options.context || this ;    // jQuery 1.4+ supports scope context 
-        for (var i=0, max=callbacks.length; i < max; i++) {
-            callbacks[i].apply(context, [data, status, xhr || $form, $form]);
-        }
-    };
-
-    // are there files to upload?
-    var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113)
-    var hasFileInputs = fileInputs.length > 0;
-    var mp = 'multipart/form-data';
-    var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
-
-    var fileAPI = feature.fileapi && feature.formdata;
-    log("fileAPI :" + fileAPI);
-    var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
-
-    // options.iframe allows user to force iframe mode
-    // 06-NOV-09: now defaulting to iframe mode if file input is detected
-    if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
-        // hack to fix Safari hang (thanks to Tim Molendijk for this)
-        // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
-        if (options.closeKeepAlive) {
-            $.get(options.closeKeepAlive, function() {
-                fileUploadIframe(a);
-            });
-        }
-          else {
-            fileUploadIframe(a);
-          }
-    }
-    else if ((hasFileInputs || multipart) && fileAPI) {
-        fileUploadXhr(a);
-    }
-    else {
-        $.ajax(options);
-    }
-
-    // clear element array
-    for (var k=0; k < elements.length; k++)
-        elements[k] = null;
-
-    // fire 'notify' event
-    this.trigger('form-submit-notify', [this, options]);
-    return this;
-
-     // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
-    function fileUploadXhr(a) {
-        var formdata = new FormData();
-
-        for (var i=0; i < a.length; i++) {
-            formdata.append(a[i].name, a[i].value);
-        }
-
-        if (options.extraData) {
-            for (var p in options.extraData)
-                if (options.extraData.hasOwnProperty(p))
-                    formdata.append(p, options.extraData[p]);
-        }
-
-        options.data = null;
-
-        var s = $.extend(true, {}, $.ajaxSettings, options, {
-            contentType: false,
-            processData: false,
-            cache: false,
-            type: 'POST'
-        });
-        
-        if (options.uploadProgress) {
-            // workaround because jqXHR does not expose upload property
-            s.xhr = function() {
-                var xhr = jQuery.ajaxSettings.xhr();
-                if (xhr.upload) {
-                    xhr.upload.onprogress = function(event) {
-                        var percent = 0;
-                        var position = event.loaded || event.position; /*event.position is deprecated*/
-                        var total = event.total;
-                        if (event.lengthComputable) {
-                            percent = Math.ceil(position / total * 100);
-                        }
-                        options.uploadProgress(event, position, total, percent);
-                    };
-                }
-                return xhr;
-            };
-        }
-
-        s.data = null;
-            var beforeSend = s.beforeSend;
-            s.beforeSend = function(xhr, o) {
-                o.data = formdata;
-                if(beforeSend)
-                    beforeSend.call(this, xhr, o);
-        };
-        $.ajax(s);
-    }
-
-    // private function for handling file uploads (hat tip to YAHOO!)
-    function fileUploadIframe(a) {
-        var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
-        var useProp = !!$.fn.prop;
-
-        if ($(':input[name=submit],:input[id=submit]', form).length) {
-            // if there is an input with a name or id of 'submit' then we won't be
-            // able to invoke the submit fn on the form (at least not x-browser)
-            alert('Error: Form elements must not have name or id of "submit".');
-            return;
-        }
-        
-        if (a) {
-            // ensure that every serialized input is still enabled
-            for (i=0; i < elements.length; i++) {
-                el = $(elements[i]);
-                if ( useProp )
-                    el.prop('disabled', false);
-                else
-                    el.removeAttr('disabled');
-            }
-        }
-
-        s = $.extend(true, {}, $.ajaxSettings, options);
-        s.context = s.context || s;
-        id = 'jqFormIO' + (new Date().getTime());
-        if (s.iframeTarget) {
-            $io = $(s.iframeTarget);
-            n = $io.attr('name');
-            if (!n)
-                 $io.attr('name', id);
-            else
-                id = n;
-        }
-        else {
-            $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
-            $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-        }
-        io = $io[0];
-
-
-        xhr = { // mock object
-            aborted: 0,
-            responseText: null,
-            responseXML: null,
-            status: 0,
-            statusText: 'n/a',
-            getAllResponseHeaders: function() {},
-            getResponseHeader: function() {},
-            setRequestHeader: function() {},
-            abort: function(status) {
-                var e = (status === 'timeout' ? 'timeout' : 'aborted');
-                log('aborting upload... ' + e);
-                this.aborted = 1;
-                // #214
-                if (io.contentWindow.document.execCommand) {
-                    try { // #214
-                        io.contentWindow.document.execCommand('Stop');
-                    } catch(ignore) {}
-                }
-                $io.attr('src', s.iframeSrc); // abort op in progress
-                xhr.error = e;
-                if (s.error)
-                    s.error.call(s.context, xhr, e, status);
-                if (g)
-                    $.event.trigger("ajaxError", [xhr, s, e]);
-                if (s.complete)
-                    s.complete.call(s.context, xhr, e);
-            }
-        };
-
-        g = s.global;
-        // trigger ajax global events so that activity/block indicators work like normal
-        if (g && 0 === $.active++) {
-            $.event.trigger("ajaxStart");
-        }
-        if (g) {
-            $.event.trigger("ajaxSend", [xhr, s]);
-        }
-
-        if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
-            if (s.global) {
-                $.active--;
-            }
-            return;
-        }
-        if (xhr.aborted) {
-            return;
-        }
-
-        // add submitting element to data if we know it
-        sub = form.clk;
-        if (sub) {
-            n = sub.name;
-            if (n && !sub.disabled) {
-                s.extraData = s.extraData || {};
-                s.extraData[n] = sub.value;
-                if (sub.type == "image") {
-                    s.extraData[n+'.x'] = form.clk_x;
-                    s.extraData[n+'.y'] = form.clk_y;
-                }
-            }
-        }
-        
-        var CLIENT_TIMEOUT_ABORT = 1;
-        var SERVER_ABORT = 2;
-
-        function getDoc(frame) {
-            var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;
-            return doc;
-        }
-        
-        // Rails CSRF hack (thanks to Yvan Barthelemy)
-        var csrf_token = $('meta[name=csrf-token]').attr('content');
-        var csrf_param = $('meta[name=csrf-param]').attr('content');
-        if (csrf_param && csrf_token) {
-            s.extraData = s.extraData || {};
-            s.extraData[csrf_param] = csrf_token;
-        }
-
-        // take a breath so that pending repaints get some cpu time before the upload starts
-        function doSubmit() {
-            // make sure form attrs are set
-            var t = $form.attr('target'), a = $form.attr('action');
-
-            // update form attrs in IE friendly way
-            form.setAttribute('target',id);
-            if (!method) {
-                form.setAttribute('method', 'POST');
-            }
-            if (a != s.url) {
-                form.setAttribute('action', s.url);
-            }
-
-            // ie borks in some cases when setting encoding
-            if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
-                $form.attr({
-                    encoding: 'multipart/form-data',
-                    enctype:  'multipart/form-data'
-                });
-            }
-
-            // support timout
-            if (s.timeout) {
-                timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
-            }
-            
-            // look for server aborts
-            function checkState() {
-                try {
-                    var state = getDoc(io).readyState;
-                    log('state = ' + state);
-                    if (state && state.toLowerCase() == 'uninitialized')
-                        setTimeout(checkState,50);
-                }
-                catch(e) {
-                    log('Server abort: ' , e, ' (', e.name, ')');
-                    cb(SERVER_ABORT);
-                    if (timeoutHandle)
-                        clearTimeout(timeoutHandle);
-                    timeoutHandle = undefined;
-                }
-            }
-
-            // add "extra" data to form if provided in options
-            var extraInputs = [];
-            try {
-                if (s.extraData) {
-                    for (var n in s.extraData) {
-                        if (s.extraData.hasOwnProperty(n)) {
-                           // if using the $.param format that allows for multiple values with the same name
-                           if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
-                               extraInputs.push(
-                               $('<input type="hidden" name="'+s.extraData[n].name+'">').attr('value',s.extraData[n].value)
-                                   .appendTo(form)[0]);
-                           } else {
-                               extraInputs.push(
-                               $('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n])
-                                   .appendTo(form)[0]);
-                           }
-                        }
-                    }
-                }
-
-                if (!s.iframeTarget) {
-                    // add iframe to doc and submit the form
-                    $io.appendTo('body');
-                    if (io.attachEvent)
-                        io.attachEvent('onload', cb);
-                    else
-                        io.addEventListener('load', cb, false);
-                }
-                setTimeout(checkState,15);
-                form.submit();
-            }
-            finally {
-                // reset attrs and remove "extra" input elements
-                form.setAttribute('action',a);
-                if(t) {
-                    form.setAttribute('target', t);
-                } else {
-                    $form.removeAttr('target');
-                }
-                $(extraInputs).remove();
-            }
-        }
-
-        if (s.forceSync) {
-            doSubmit();
-        }
-        else {
-            setTimeout(doSubmit, 10); // this lets dom updates render
-        }
-
-        var data, doc, domCheckCount = 50, callbackProcessed;
-
-        function cb(e) {
-            if (xhr.aborted || callbackProcessed) {
-                return;
-            }
-            try {
-                doc = getDoc(io);
-            }
-            catch(ex) {
-                log('cannot access response document: ', ex);
-                e = SERVER_ABORT;
-            }
-            if (e === CLIENT_TIMEOUT_ABORT && xhr) {
-                xhr.abort('timeout');
-                return;
-            }
-            else if (e == SERVER_ABORT && xhr) {
-                xhr.abort('server abort');
-                return;
-            }
-
-            if (!doc || doc.location.href == s.iframeSrc) {
-                // response not received yet
-                if (!timedOut)
-                    return;
-            }
-            if (io.detachEvent)
-                io.detachEvent('onload', cb);
-            else    
-                io.removeEventListener('load', cb, false);
-
-            var status = 'success', errMsg;
-            try {
-                if (timedOut) {
-                    throw 'timeout';
-                }
-
-                var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
-                log('isXml='+isXml);
-                if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
-                    if (--domCheckCount) {
-                        // in some browsers (Opera) the iframe DOM is not always traversable when
-                        // the onload callback fires, so we loop a bit to accommodate
-                        log('requeing onLoad callback, DOM not available');
-                        setTimeout(cb, 250);
-                        return;
-                    }
-                    // let this fall through because server response could be an empty document
-                    //log('Could not access iframe DOM after mutiple tries.');
-                    //throw 'DOMException: not available';
-                }
-
-                //log('response detected');
-                var docRoot = doc.body ? doc.body : doc.documentElement;
-                xhr.responseText = docRoot ? docRoot.innerHTML : null;
-                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
-                if (isXml)
-                    s.dataType = 'xml';
-                xhr.getResponseHeader = function(header){
-                    var headers = {'content-type': s.dataType};
-                    return headers[header];
-                };
-                // support for XHR 'status' & 'statusText' emulation :
-                if (docRoot) {
-                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
-                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
-                }
-
-                var dt = (s.dataType || '').toLowerCase();
-                var scr = /(json|script|text)/.test(dt);
-                if (scr || s.textarea) {
-                    // see if user embedded response in textarea
-                    var ta = doc.getElementsByTagName('textarea')[0];
-                    if (ta) {
-                        xhr.responseText = ta.value;
-                        // support for XHR 'status' & 'statusText' emulation :
-                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
-                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
-                    }
-                    else if (scr) {
-                        // account for browsers injecting pre around json response
-                        var pre = doc.getElementsByTagName('pre')[0];
-                        var b = doc.getElementsByTagName('body')[0];
-                        if (pre) {
-                            xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
-                        }
-                        else if (b) {
-                            xhr.responseText = b.textContent ? b.textContent : b.innerText;
-                        }
-                    }
-                }
-                else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
-                    xhr.responseXML = toXml(xhr.responseText);
-                }
-
-                try {
-                    data = httpData(xhr, dt, s);
-                }
-                catch (e) {
-                    status = 'parsererror';
-                    xhr.error = errMsg = (e || status);
-                }
-            }
-            catch (e) {
-                log('error caught: ',e);
-                status = 'error';
-                xhr.error = errMsg = (e || status);
-            }
-
-            if (xhr.aborted) {
-                log('upload aborted');
-                status = null;
-            }
-
-            if (xhr.status) { // we've set xhr.status
-                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
-            }
-
-            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
-            if (status === 'success') {
-                if (s.success)
-                    s.success.call(s.context, data, 'success', xhr);
-                if (g)
-                    $.event.trigger("ajaxSuccess", [xhr, s]);
-            }
-            else if (status) {
-                if (errMsg === undefined)
-                    errMsg = xhr.statusText;
-                if (s.error)
-                    s.error.call(s.context, xhr, status, errMsg);
-                if (g)
-                    $.event.trigger("ajaxError", [xhr, s, errMsg]);
-            }
-
-            if (g)
-                $.event.trigger("ajaxComplete", [xhr, s]);
-
-            if (g && ! --$.active) {
-                $.event.trigger("ajaxStop");
-            }
-
-            if (s.complete)
-                s.complete.call(s.context, xhr, status);
-
-            callbackProcessed = true;
-            if (s.timeout)
-                clearTimeout(timeoutHandle);
-
-            // clean up
-            setTimeout(function() {
-                if (!s.iframeTarget)
-                    $io.remove();
-                xhr.responseXML = null;
-            }, 100);
-        }
-
-        var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
-            if (window.ActiveXObject) {
-                doc = new ActiveXObject('Microsoft.XMLDOM');
-                doc.async = 'false';
-                doc.loadXML(s);
-            }
-            else {
-                doc = (new DOMParser()).parseFromString(s, 'text/xml');
-            }
-            return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
-        };
-        var parseJSON = $.parseJSON || function(s) {
-            /*jslint evil:true */
-            return window['eval']('(' + s + ')');
-        };
-
-        var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
-
-            var ct = xhr.getResponseHeader('content-type') || '',
-                xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
-                data = xml ? xhr.responseXML : xhr.responseText;
-
-            if (xml && data.documentElement.nodeName === 'parsererror') {
-                if ($.error)
-                    $.error('parsererror');
-            }
-            if (s && s.dataFilter) {
-                data = s.dataFilter(data, type);
-            }
-            if (typeof data === 'string') {
-                if (type === 'json' || !type && ct.indexOf('json') >= 0) {
-                    data = parseJSON(data);
-                } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
-                    $.globalEval(data);
-                }
-            }
-            return data;
-        };
-    }
-};
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- *    is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- *    used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself.
- */
-$.fn.ajaxForm = function(options) {
-    options = options || {};
-    options.delegation = options.delegation && $.isFunction($.fn.on);
-    
-    // in jQuery 1.3+ we can fix mistakes with the ready state
-    if (!options.delegation && this.length === 0) {
-        var o = { s: this.selector, c: this.context };
-        if (!$.isReady && o.s) {
-            log('DOM not ready, queuing ajaxForm');
-            $(function() {
-                $(o.s,o.c).ajaxForm(options);
-            });
-            return this;
-        }
-        // is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
-        log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
-        return this;
-    }
-
-    if ( options.delegation ) {
-        $(document)
-            .off('submit.form-plugin', this.selector, doAjaxSubmit)
-            .off('click.form-plugin', this.selector, captureSubmittingElement)
-            .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
-            .on('click.form-plugin', this.selector, options, captureSubmittingElement);
-        return this;
-    }
-
-    return this.ajaxFormUnbind()
-        .bind('submit.form-plugin', options, doAjaxSubmit)
-        .bind('click.form-plugin', options, captureSubmittingElement);
-};
-
-// private event handlers    
-function doAjaxSubmit(e) {
-    /*jshint validthis:true */
-    var options = e.data;
-    if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
-        e.preventDefault();
-        $(this).ajaxSubmit(options);
-    }
-}
-    
-function captureSubmittingElement(e) {
-    /*jshint validthis:true */
-    var target = e.target;
-    var $el = $(target);
-    if (!($el.is(":submit,input:image"))) {
-        // is this a child element of the submit el?  (ex: a span within a button)
-        var t = $el.closest(':submit');
-        if (t.length === 0) {
-            return;
-        }
-        target = t[0];
-    }
-    var form = this;
-    form.clk = target;
-    if (target.type == 'image') {
-        if (e.offsetX !== undefined) {
-            form.clk_x = e.offsetX;
-            form.clk_y = e.offsetY;
-        } else if (typeof $.fn.offset == 'function') {
-            var offset = $el.offset();
-            form.clk_x = e.pageX - offset.left;
-            form.clk_y = e.pageY - offset.top;
-        } else {
-            form.clk_x = e.pageX - target.offsetLeft;
-            form.clk_y = e.pageY - target.offsetTop;
-        }
-    }
-    // clear form vars
-    setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
-}
-
-
-// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
-$.fn.ajaxFormUnbind = function() {
-    return this.unbind('submit.form-plugin click.form-plugin');
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property.  An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- */
-$.fn.formToArray = function(semantic, elements) {
-    var a = [];
-    if (this.length === 0) {
-        return a;
-    }
-
-    var form = this[0];
-    var els = semantic ? form.getElementsByTagName('*') : form.elements;
-    if (!els) {
-        return a;
-    }
-
-    var i,j,n,v,el,max,jmax;
-    for(i=0, max=els.length; i < max; i++) {
-        el = els[i];
-        n = el.name;
-        if (!n) {
-            continue;
-        }
-
-        if (semantic && form.clk && el.type == "image") {
-            // handle image inputs on the fly when semantic == true
-            if(!el.disabled && form.clk == el) {
-                a.push({name: n, value: $(el).val(), type: el.type });
-                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-            }
-            continue;
-        }
-
-        v = $.fieldValue(el, true);
-        if (v && v.constructor == Array) {
-            if (elements) 
-                elements.push(el);
-            for(j=0, jmax=v.length; j < jmax; j++) {
-                a.push({name: n, value: v[j]});
-            }
-        }
-        else if (feature.fileapi && el.type == 'file' && !el.disabled) {
-            if (elements) 
-                elements.push(el);
-            var files = el.files;
-            if (files.length) {
-                for (j=0; j < files.length; j++) {
-                    a.push({name: n, value: files[j], type: el.type});
-                }
-            }
-            else {
-                // #180
-                a.push({ name: n, value: '', type: el.type });
-            }
-        }
-        else if (v !== null && typeof v != 'undefined') {
-            if (elements) 
-                elements.push(el);
-            a.push({name: n, value: v, type: el.type, required: el.required});
-        }
-    }
-
-    if (!semantic && form.clk) {
-        // input type=='image' are not found in elements array! handle it here
-        var $input = $(form.clk), input = $input[0];
-        n = input.name;
-        if (n && !input.disabled && input.type == 'image') {
-            a.push({name: n, value: $input.val()});
-            a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
-        }
-    }
-    return a;
-};
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&amp;name2=value2
- */
-$.fn.formSerialize = function(semantic) {
-    //hand off to jQuery.param for proper encoding
-    return $.param(this.formToArray(semantic));
-};
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&amp;name2=value2
- */
-$.fn.fieldSerialize = function(successful) {
-    var a = [];
-    this.each(function() {
-        var n = this.name;
-        if (!n) {
-            return;
-        }
-        var v = $.fieldValue(this, successful);
-        if (v && v.constructor == Array) {
-            for (var i=0,max=v.length; i < max; i++) {
-                a.push({name: n, value: v[i]});
-            }
-        }
-        else if (v !== null && typeof v != 'undefined') {
-            a.push({name: this.name, value: v});
-        }
-    });
-    //hand off to jQuery.param for proper encoding
-    return $.param(a);
-};
-
-/**
- * Returns the value(s) of the element in the matched set.  For example, consider the following form:
- *
- *  <form><fieldset>
- *      <input name="A" type="text" />
- *      <input name="A" type="text" />
- *      <input name="B" type="checkbox" value="B1" />
- *      <input name="B" type="checkbox" value="B2"/>
- *      <input name="C" type="radio" value="C1" />
- *      <input name="C" type="radio" value="C2" />
- *  </fieldset></form>
- *
- *  var v = $(':text').fieldValue();
- *  // if no values are entered into the text inputs
- *  v == ['','']
- *  // if values entered into the text inputs are 'foo' and 'bar'
- *  v == ['foo','bar']
- *
- *  var v = $(':checkbox').fieldValue();
- *  // if neither checkbox is checked
- *  v === undefined
- *  // if both checkboxes are checked
- *  v == ['B1', 'B2']
- *
- *  var v = $(':radio').fieldValue();
- *  // if neither radio is checked
- *  v === undefined
- *  // if first radio is checked
- *  v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true.  If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array.  If no valid value can be determined the
- *    array will be empty, otherwise it will contain one or more values.
- */
-$.fn.fieldValue = function(successful) {
-    for (var val=[], i=0, max=this.length; i < max; i++) {
-        var el = this[i];
-        var v = $.fieldValue(el, successful);
-        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
-            continue;
-        }
-        if (v.constructor == Array)
-            $.merge(val, v);
-        else
-            val.push(v);
-    }
-    return val;
-};
-
-/**
- * Returns the value of the field element.
- */
-$.fieldValue = function(el, successful) {
-    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
-    if (successful === undefined) {
-        successful = true;
-    }
-
-    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
-        (t == 'checkbox' || t == 'radio') && !el.checked ||
-        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
-        tag == 'select' && el.selectedIndex == -1)) {
-            return null;
-    }
-
-    if (tag == 'select') {
-        var index = el.selectedIndex;
-        if (index < 0) {
-            return null;
-        }
-        var a = [], ops = el.options;
-        var one = (t == 'select-one');
-        var max = (one ? index+1 : ops.length);
-        for(var i=(one ? index : 0); i < max; i++) {
-            var op = ops[i];
-            if (op.selected) {
-                var v = op.value;
-                if (!v) { // extra pain for IE...
-                    v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
-                }
-                if (one) {
-                    return v;
-                }
-                a.push(v);
-            }
-        }
-        return a;
-    }
-    return $(el).val();
-};
-
-/**
- * Clears the form data.  Takes the following actions on the form's input fields:
- *  - input text fields will have their 'value' property set to the empty string
- *  - select elements will have their 'selectedIndex' property set to -1
- *  - checkbox and radio inputs will have their 'checked' property set to false
- *  - inputs of type submit, button, reset, and hidden will *not* be effected
- *  - button elements will *not* be effected
- */
-$.fn.clearForm = function(includeHidden) {
-    return this.each(function() {
-        $('input,select,textarea', this).clearFields(includeHidden);
-    });
-};
-
-/**
- * Clears the selected form elements.
- */
-$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
-    var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
-    return this.each(function() {
-        var t = this.type, tag = this.tagName.toLowerCase();
-        if (re.test(t) || tag == 'textarea') {
-            this.value = '';
-        }
-        else if (t == 'checkbox' || t == 'radio') {
-            this.checked = false;
-        }
-        else if (tag == 'select') {
-            this.selectedIndex = -1;
-        }
-        else if (includeHidden) {
-            // includeHidden can be the value true, or it can be a selector string
-            // indicating a special test; for example:
-            //  $('#myForm').clearForm('.special:hidden')
-            // the above would clean hidden inputs that have the class of 'special'
-            if ( (includeHidden === true && /hidden/.test(t)) ||
-                 (typeof includeHidden == 'string' && $(this).is(includeHidden)) )
-                this.value = '';
-        }
-    });
-};
-
-/**
- * Resets the form data.  Causes all form elements to be reset to their original value.
- */
-$.fn.resetForm = function() {
-    return this.each(function() {
-        // guard against an input with the name of 'reset'
-        // note that IE reports the reset function as an 'object'
-        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
-            this.reset();
-        }
-    });
-};
-
-/**
- * Enables or disables any matching elements.
- */
-$.fn.enable = function(b) {
-    if (b === undefined) {
-        b = true;
-    }
-    return this.each(function() {
-        this.disabled = !b;
-    });
-};
-
-/**
- * Checks/unchecks any matching checkboxes or radio buttons and
- * selects/deselects and matching option elements.
- */
-$.fn.selected = function(select) {
-    if (select === undefined) {
-        select = true;
-    }
-    return this.each(function() {
-        var t = this.type;
-        if (t == 'checkbox' || t == 'radio') {
-            this.checked = select;
-        }
-        else if (this.tagName.toLowerCase() == 'option') {
-            var $sel = $(this).parent('select');
-            if (select && $sel[0] && $sel[0].type == 'select-one') {
-                // deselect all other options
-                $sel.find('option').selected(false);
-            }
-            this.selected = select;
-        }
-    });
-};
-
-// expose debug var
-$.fn.ajaxSubmit.debug = false;
-
-// helper fn for console logging
-function log() {
-    if (!$.fn.ajaxSubmit.debug) 
-        return;
-    var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
-    if (window.console && window.console.log) {
-        window.console.log(msg);
-    }
-    else if (window.opera && window.opera.postError) {
-        window.opera.postError(msg);
-    }
-}
-
-})(jQuery);
diff --git a/resources/lib/jquery.form/jquery.form.js b/resources/lib/jquery.form/jquery.form.js
new file mode 100644 (file)
index 0000000..13e9a55
--- /dev/null
@@ -0,0 +1,1089 @@
+/*!
+ * jQuery Form Plugin
+ * version: 3.14 (30-JUL-2012)
+ * @requires jQuery v1.3.2 or later
+ *
+ * Examples and documentation at: http://malsup.com/jquery/form/
+ * Project repository: https://github.com/malsup/form
+ * Dual licensed under the MIT and GPL licenses:
+ *    http://malsup.github.com/mit-license.txt
+ *    http://malsup.github.com/gpl-license-v2.txt
+ */
+/*global ActiveXObject alert */
+;(function($) {
+"use strict";
+
+/*
+    Usage Note:
+    -----------
+    Do not use both ajaxSubmit and ajaxForm on the same form.  These
+    functions are mutually exclusive.  Use ajaxSubmit if you want
+    to bind your own submit handler to the form.  For example,
+
+    $(document).ready(function() {
+        $('#myForm').on('submit', function(e) {
+            e.preventDefault(); // <-- important
+            $(this).ajaxSubmit({
+                target: '#output'
+            });
+        });
+    });
+
+    Use ajaxForm when you want the plugin to manage all the event binding
+    for you.  For example,
+
+    $(document).ready(function() {
+        $('#myForm').ajaxForm({
+            target: '#output'
+        });
+    });
+    
+    You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
+    form does not have to exist when you invoke ajaxForm:
+
+    $('#myForm').ajaxForm({
+        delegation: true,
+        target: '#output'
+    });
+    
+    When using ajaxForm, the ajaxSubmit function will be invoked for you
+    at the appropriate time.
+*/
+
+/**
+ * Feature detection
+ */
+var feature = {};
+feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
+feature.formdata = window.FormData !== undefined;
+
+/**
+ * ajaxSubmit() provides a mechanism for immediately submitting
+ * an HTML form using AJAX.
+ */
+$.fn.ajaxSubmit = function(options) {
+    /*jshint scripturl:true */
+
+    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
+    if (!this.length) {
+        log('ajaxSubmit: skipping submit process - no element selected');
+        return this;
+    }
+    
+    var method, action, url, $form = this;
+
+    if (typeof options == 'function') {
+        options = { success: options };
+    }
+
+    method = this.attr('method');
+    action = this.attr('action');
+    url = (typeof action === 'string') ? $.trim(action) : '';
+    url = url || window.location.href || '';
+    if (url) {
+        // clean url (don't include hash vaue)
+        url = (url.match(/^([^#]+)/)||[])[1];
+    }
+
+    options = $.extend(true, {
+        url:  url,
+        success: $.ajaxSettings.success,
+        type: method || 'GET',
+        iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
+    }, options);
+
+    // hook for manipulating the form data before it is extracted;
+    // convenient for use with rich editors like tinyMCE or FCKEditor
+    var veto = {};
+    this.trigger('form-pre-serialize', [this, options, veto]);
+    if (veto.veto) {
+        log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
+        return this;
+    }
+
+    // provide opportunity to alter form data before it is serialized
+    if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
+        log('ajaxSubmit: submit aborted via beforeSerialize callback');
+        return this;
+    }
+
+    var traditional = options.traditional;
+    if ( traditional === undefined ) {
+        traditional = $.ajaxSettings.traditional;
+    }
+    
+    var elements = [];
+    var qx, a = this.formToArray(options.semantic, elements);
+    if (options.data) {
+        options.extraData = options.data;
+        qx = $.param(options.data, traditional);
+    }
+
+    // give pre-submit callback an opportunity to abort the submit
+    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
+        log('ajaxSubmit: submit aborted via beforeSubmit callback');
+        return this;
+    }
+
+    // fire vetoable 'validate' event
+    this.trigger('form-submit-validate', [a, this, options, veto]);
+    if (veto.veto) {
+        log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
+        return this;
+    }
+
+    var q = $.param(a, traditional);
+    if (qx) {
+        q = ( q ? (q + '&' + qx) : qx );
+    }    
+    if (options.type.toUpperCase() == 'GET') {
+        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
+        options.data = null;  // data is null for 'get'
+    }
+    else {
+        options.data = q; // data is the query string for 'post'
+    }
+
+    var callbacks = [];
+    if (options.resetForm) {
+        callbacks.push(function() { $form.resetForm(); });
+    }
+    if (options.clearForm) {
+        callbacks.push(function() { $form.clearForm(options.includeHidden); });
+    }
+
+    // perform a load on the target only if dataType is not provided
+    if (!options.dataType && options.target) {
+        var oldSuccess = options.success || function(){};
+        callbacks.push(function(data) {
+            var fn = options.replaceTarget ? 'replaceWith' : 'html';
+            $(options.target)[fn](data).each(oldSuccess, arguments);
+        });
+    }
+    else if (options.success) {
+        callbacks.push(options.success);
+    }
+
+    options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
+        var context = options.context || this ;    // jQuery 1.4+ supports scope context 
+        for (var i=0, max=callbacks.length; i < max; i++) {
+            callbacks[i].apply(context, [data, status, xhr || $form, $form]);
+        }
+    };
+
+    // are there files to upload?
+    var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113)
+    var hasFileInputs = fileInputs.length > 0;
+    var mp = 'multipart/form-data';
+    var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
+
+    var fileAPI = feature.fileapi && feature.formdata;
+    log("fileAPI :" + fileAPI);
+    var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
+
+    // options.iframe allows user to force iframe mode
+    // 06-NOV-09: now defaulting to iframe mode if file input is detected
+    if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
+        // hack to fix Safari hang (thanks to Tim Molendijk for this)
+        // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
+        if (options.closeKeepAlive) {
+            $.get(options.closeKeepAlive, function() {
+                fileUploadIframe(a);
+            });
+        }
+          else {
+            fileUploadIframe(a);
+          }
+    }
+    else if ((hasFileInputs || multipart) && fileAPI) {
+        fileUploadXhr(a);
+    }
+    else {
+        $.ajax(options);
+    }
+
+    // clear element array
+    for (var k=0; k < elements.length; k++)
+        elements[k] = null;
+
+    // fire 'notify' event
+    this.trigger('form-submit-notify', [this, options]);
+    return this;
+
+     // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
+    function fileUploadXhr(a) {
+        var formdata = new FormData();
+
+        for (var i=0; i < a.length; i++) {
+            formdata.append(a[i].name, a[i].value);
+        }
+
+        if (options.extraData) {
+            for (var p in options.extraData)
+                if (options.extraData.hasOwnProperty(p))
+                    formdata.append(p, options.extraData[p]);
+        }
+
+        options.data = null;
+
+        var s = $.extend(true, {}, $.ajaxSettings, options, {
+            contentType: false,
+            processData: false,
+            cache: false,
+            type: 'POST'
+        });
+        
+        if (options.uploadProgress) {
+            // workaround because jqXHR does not expose upload property
+            s.xhr = function() {
+                var xhr = jQuery.ajaxSettings.xhr();
+                if (xhr.upload) {
+                    xhr.upload.onprogress = function(event) {
+                        var percent = 0;
+                        var position = event.loaded || event.position; /*event.position is deprecated*/
+                        var total = event.total;
+                        if (event.lengthComputable) {
+                            percent = Math.ceil(position / total * 100);
+                        }
+                        options.uploadProgress(event, position, total, percent);
+                    };
+                }
+                return xhr;
+            };
+        }
+
+        s.data = null;
+            var beforeSend = s.beforeSend;
+            s.beforeSend = function(xhr, o) {
+                o.data = formdata;
+                if(beforeSend)
+                    beforeSend.call(this, xhr, o);
+        };
+        $.ajax(s);
+    }
+
+    // private function for handling file uploads (hat tip to YAHOO!)
+    function fileUploadIframe(a) {
+        var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
+        var useProp = !!$.fn.prop;
+
+        if ($(':input[name=submit],:input[id=submit]', form).length) {
+            // if there is an input with a name or id of 'submit' then we won't be
+            // able to invoke the submit fn on the form (at least not x-browser)
+            alert('Error: Form elements must not have name or id of "submit".');
+            return;
+        }
+        
+        if (a) {
+            // ensure that every serialized input is still enabled
+            for (i=0; i < elements.length; i++) {
+                el = $(elements[i]);
+                if ( useProp )
+                    el.prop('disabled', false);
+                else
+                    el.removeAttr('disabled');
+            }
+        }
+
+        s = $.extend(true, {}, $.ajaxSettings, options);
+        s.context = s.context || s;
+        id = 'jqFormIO' + (new Date().getTime());
+        if (s.iframeTarget) {
+            $io = $(s.iframeTarget);
+            n = $io.attr('name');
+            if (!n)
+                 $io.attr('name', id);
+            else
+                id = n;
+        }
+        else {
+            $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
+            $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+        }
+        io = $io[0];
+
+
+        xhr = { // mock object
+            aborted: 0,
+            responseText: null,
+            responseXML: null,
+            status: 0,
+            statusText: 'n/a',
+            getAllResponseHeaders: function() {},
+            getResponseHeader: function() {},
+            setRequestHeader: function() {},
+            abort: function(status) {
+                var e = (status === 'timeout' ? 'timeout' : 'aborted');
+                log('aborting upload... ' + e);
+                this.aborted = 1;
+                // #214
+                if (io.contentWindow.document.execCommand) {
+                    try { // #214
+                        io.contentWindow.document.execCommand('Stop');
+                    } catch(ignore) {}
+                }
+                $io.attr('src', s.iframeSrc); // abort op in progress
+                xhr.error = e;
+                if (s.error)
+                    s.error.call(s.context, xhr, e, status);
+                if (g)
+                    $.event.trigger("ajaxError", [xhr, s, e]);
+                if (s.complete)
+                    s.complete.call(s.context, xhr, e);
+            }
+        };
+
+        g = s.global;
+        // trigger ajax global events so that activity/block indicators work like normal
+        if (g && 0 === $.active++) {
+            $.event.trigger("ajaxStart");
+        }
+        if (g) {
+            $.event.trigger("ajaxSend", [xhr, s]);
+        }
+
+        if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
+            if (s.global) {
+                $.active--;
+            }
+            return;
+        }
+        if (xhr.aborted) {
+            return;
+        }
+
+        // add submitting element to data if we know it
+        sub = form.clk;
+        if (sub) {
+            n = sub.name;
+            if (n && !sub.disabled) {
+                s.extraData = s.extraData || {};
+                s.extraData[n] = sub.value;
+                if (sub.type == "image") {
+                    s.extraData[n+'.x'] = form.clk_x;
+                    s.extraData[n+'.y'] = form.clk_y;
+                }
+            }
+        }
+        
+        var CLIENT_TIMEOUT_ABORT = 1;
+        var SERVER_ABORT = 2;
+
+        function getDoc(frame) {
+            var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;
+            return doc;
+        }
+        
+        // Rails CSRF hack (thanks to Yvan Barthelemy)
+        var csrf_token = $('meta[name=csrf-token]').attr('content');
+        var csrf_param = $('meta[name=csrf-param]').attr('content');
+        if (csrf_param && csrf_token) {
+            s.extraData = s.extraData || {};
+            s.extraData[csrf_param] = csrf_token;
+        }
+
+        // take a breath so that pending repaints get some cpu time before the upload starts
+        function doSubmit() {
+            // make sure form attrs are set
+            var t = $form.attr('target'), a = $form.attr('action');
+
+            // update form attrs in IE friendly way
+            form.setAttribute('target',id);
+            if (!method) {
+                form.setAttribute('method', 'POST');
+            }
+            if (a != s.url) {
+                form.setAttribute('action', s.url);
+            }
+
+            // ie borks in some cases when setting encoding
+            if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
+                $form.attr({
+                    encoding: 'multipart/form-data',
+                    enctype:  'multipart/form-data'
+                });
+            }
+
+            // support timout
+            if (s.timeout) {
+                timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
+            }
+            
+            // look for server aborts
+            function checkState() {
+                try {
+                    var state = getDoc(io).readyState;
+                    log('state = ' + state);
+                    if (state && state.toLowerCase() == 'uninitialized')
+                        setTimeout(checkState,50);
+                }
+                catch(e) {
+                    log('Server abort: ' , e, ' (', e.name, ')');
+                    cb(SERVER_ABORT);
+                    if (timeoutHandle)
+                        clearTimeout(timeoutHandle);
+                    timeoutHandle = undefined;
+                }
+            }
+
+            // add "extra" data to form if provided in options
+            var extraInputs = [];
+            try {
+                if (s.extraData) {
+                    for (var n in s.extraData) {
+                        if (s.extraData.hasOwnProperty(n)) {
+                           // if using the $.param format that allows for multiple values with the same name
+                           if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
+                               extraInputs.push(
+                               $('<input type="hidden" name="'+s.extraData[n].name+'">').attr('value',s.extraData[n].value)
+                                   .appendTo(form)[0]);
+                           } else {
+                               extraInputs.push(
+                               $('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n])
+                                   .appendTo(form)[0]);
+                           }
+                        }
+                    }
+                }
+
+                if (!s.iframeTarget) {
+                    // add iframe to doc and submit the form
+                    $io.appendTo('body');
+                    if (io.attachEvent)
+                        io.attachEvent('onload', cb);
+                    else
+                        io.addEventListener('load', cb, false);
+                }
+                setTimeout(checkState,15);
+                form.submit();
+            }
+            finally {
+                // reset attrs and remove "extra" input elements
+                form.setAttribute('action',a);
+                if(t) {
+                    form.setAttribute('target', t);
+                } else {
+                    $form.removeAttr('target');
+                }
+                $(extraInputs).remove();
+            }
+        }
+
+        if (s.forceSync) {
+            doSubmit();
+        }
+        else {
+            setTimeout(doSubmit, 10); // this lets dom updates render
+        }
+
+        var data, doc, domCheckCount = 50, callbackProcessed;
+
+        function cb(e) {
+            if (xhr.aborted || callbackProcessed) {
+                return;
+            }
+            try {
+                doc = getDoc(io);
+            }
+            catch(ex) {
+                log('cannot access response document: ', ex);
+                e = SERVER_ABORT;
+            }
+            if (e === CLIENT_TIMEOUT_ABORT && xhr) {
+                xhr.abort('timeout');
+                return;
+            }
+            else if (e == SERVER_ABORT && xhr) {
+                xhr.abort('server abort');
+                return;
+            }
+
+            if (!doc || doc.location.href == s.iframeSrc) {
+                // response not received yet
+                if (!timedOut)
+                    return;
+            }
+            if (io.detachEvent)
+                io.detachEvent('onload', cb);
+            else    
+                io.removeEventListener('load', cb, false);
+
+            var status = 'success', errMsg;
+            try {
+                if (timedOut) {
+                    throw 'timeout';
+                }
+
+                var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
+                log('isXml='+isXml);
+                if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
+                    if (--domCheckCount) {
+                        // in some browsers (Opera) the iframe DOM is not always traversable when
+                        // the onload callback fires, so we loop a bit to accommodate
+                        log('requeing onLoad callback, DOM not available');
+                        setTimeout(cb, 250);
+                        return;
+                    }
+                    // let this fall through because server response could be an empty document
+                    //log('Could not access iframe DOM after mutiple tries.');
+                    //throw 'DOMException: not available';
+                }
+
+                //log('response detected');
+                var docRoot = doc.body ? doc.body : doc.documentElement;
+                xhr.responseText = docRoot ? docRoot.innerHTML : null;
+                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+                if (isXml)
+                    s.dataType = 'xml';
+                xhr.getResponseHeader = function(header){
+                    var headers = {'content-type': s.dataType};
+                    return headers[header];
+                };
+                // support for XHR 'status' & 'statusText' emulation :
+                if (docRoot) {
+                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
+                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
+                }
+
+                var dt = (s.dataType || '').toLowerCase();
+                var scr = /(json|script|text)/.test(dt);
+                if (scr || s.textarea) {
+                    // see if user embedded response in textarea
+                    var ta = doc.getElementsByTagName('textarea')[0];
+                    if (ta) {
+                        xhr.responseText = ta.value;
+                        // support for XHR 'status' & 'statusText' emulation :
+                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
+                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
+                    }
+                    else if (scr) {
+                        // account for browsers injecting pre around json response
+                        var pre = doc.getElementsByTagName('pre')[0];
+                        var b = doc.getElementsByTagName('body')[0];
+                        if (pre) {
+                            xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
+                        }
+                        else if (b) {
+                            xhr.responseText = b.textContent ? b.textContent : b.innerText;
+                        }
+                    }
+                }
+                else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
+                    xhr.responseXML = toXml(xhr.responseText);
+                }
+
+                try {
+                    data = httpData(xhr, dt, s);
+                }
+                catch (e) {
+                    status = 'parsererror';
+                    xhr.error = errMsg = (e || status);
+                }
+            }
+            catch (e) {
+                log('error caught: ',e);
+                status = 'error';
+                xhr.error = errMsg = (e || status);
+            }
+
+            if (xhr.aborted) {
+                log('upload aborted');
+                status = null;
+            }
+
+            if (xhr.status) { // we've set xhr.status
+                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
+            }
+
+            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+            if (status === 'success') {
+                if (s.success)
+                    s.success.call(s.context, data, 'success', xhr);
+                if (g)
+                    $.event.trigger("ajaxSuccess", [xhr, s]);
+            }
+            else if (status) {
+                if (errMsg === undefined)
+                    errMsg = xhr.statusText;
+                if (s.error)
+                    s.error.call(s.context, xhr, status, errMsg);
+                if (g)
+                    $.event.trigger("ajaxError", [xhr, s, errMsg]);
+            }
+
+            if (g)
+                $.event.trigger("ajaxComplete", [xhr, s]);
+
+            if (g && ! --$.active) {
+                $.event.trigger("ajaxStop");
+            }
+
+            if (s.complete)
+                s.complete.call(s.context, xhr, status);
+
+            callbackProcessed = true;
+            if (s.timeout)
+                clearTimeout(timeoutHandle);
+
+            // clean up
+            setTimeout(function() {
+                if (!s.iframeTarget)
+                    $io.remove();
+                xhr.responseXML = null;
+            }, 100);
+        }
+
+        var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
+            if (window.ActiveXObject) {
+                doc = new ActiveXObject('Microsoft.XMLDOM');
+                doc.async = 'false';
+                doc.loadXML(s);
+            }
+            else {
+                doc = (new DOMParser()).parseFromString(s, 'text/xml');
+            }
+            return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
+        };
+        var parseJSON = $.parseJSON || function(s) {
+            /*jslint evil:true */
+            return window['eval']('(' + s + ')');
+        };
+
+        var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
+
+            var ct = xhr.getResponseHeader('content-type') || '',
+                xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
+                data = xml ? xhr.responseXML : xhr.responseText;
+
+            if (xml && data.documentElement.nodeName === 'parsererror') {
+                if ($.error)
+                    $.error('parsererror');
+            }
+            if (s && s.dataFilter) {
+                data = s.dataFilter(data, type);
+            }
+            if (typeof data === 'string') {
+                if (type === 'json' || !type && ct.indexOf('json') >= 0) {
+                    data = parseJSON(data);
+                } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
+                    $.globalEval(data);
+                }
+            }
+            return data;
+        };
+    }
+};
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for <input type="image" /> elements (if the element
+ *    is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ *    used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself.
+ */
+$.fn.ajaxForm = function(options) {
+    options = options || {};
+    options.delegation = options.delegation && $.isFunction($.fn.on);
+    
+    // in jQuery 1.3+ we can fix mistakes with the ready state
+    if (!options.delegation && this.length === 0) {
+        var o = { s: this.selector, c: this.context };
+        if (!$.isReady && o.s) {
+            log('DOM not ready, queuing ajaxForm');
+            $(function() {
+                $(o.s,o.c).ajaxForm(options);
+            });
+            return this;
+        }
+        // is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
+        log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
+        return this;
+    }
+
+    if ( options.delegation ) {
+        $(document)
+            .off('submit.form-plugin', this.selector, doAjaxSubmit)
+            .off('click.form-plugin', this.selector, captureSubmittingElement)
+            .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
+            .on('click.form-plugin', this.selector, options, captureSubmittingElement);
+        return this;
+    }
+
+    return this.ajaxFormUnbind()
+        .bind('submit.form-plugin', options, doAjaxSubmit)
+        .bind('click.form-plugin', options, captureSubmittingElement);
+};
+
+// private event handlers    
+function doAjaxSubmit(e) {
+    /*jshint validthis:true */
+    var options = e.data;
+    if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
+        e.preventDefault();
+        $(this).ajaxSubmit(options);
+    }
+}
+    
+function captureSubmittingElement(e) {
+    /*jshint validthis:true */
+    var target = e.target;
+    var $el = $(target);
+    if (!($el.is(":submit,input:image"))) {
+        // is this a child element of the submit el?  (ex: a span within a button)
+        var t = $el.closest(':submit');
+        if (t.length === 0) {
+            return;
+        }
+        target = t[0];
+    }
+    var form = this;
+    form.clk = target;
+    if (target.type == 'image') {
+        if (e.offsetX !== undefined) {
+            form.clk_x = e.offsetX;
+            form.clk_y = e.offsetY;
+        } else if (typeof $.fn.offset == 'function') {
+            var offset = $el.offset();
+            form.clk_x = e.pageX - offset.left;
+            form.clk_y = e.pageY - offset.top;
+        } else {
+            form.clk_x = e.pageX - target.offsetLeft;
+            form.clk_y = e.pageY - target.offsetTop;
+        }
+    }
+    // clear form vars
+    setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
+}
+
+
+// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+$.fn.ajaxFormUnbind = function() {
+    return this.unbind('submit.form-plugin click.form-plugin');
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property.  An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ */
+$.fn.formToArray = function(semantic, elements) {
+    var a = [];
+    if (this.length === 0) {
+        return a;
+    }
+
+    var form = this[0];
+    var els = semantic ? form.getElementsByTagName('*') : form.elements;
+    if (!els) {
+        return a;
+    }
+
+    var i,j,n,v,el,max,jmax;
+    for(i=0, max=els.length; i < max; i++) {
+        el = els[i];
+        n = el.name;
+        if (!n) {
+            continue;
+        }
+
+        if (semantic && form.clk && el.type == "image") {
+            // handle image inputs on the fly when semantic == true
+            if(!el.disabled && form.clk == el) {
+                a.push({name: n, value: $(el).val(), type: el.type });
+                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+            }
+            continue;
+        }
+
+        v = $.fieldValue(el, true);
+        if (v && v.constructor == Array) {
+            if (elements) 
+                elements.push(el);
+            for(j=0, jmax=v.length; j < jmax; j++) {
+                a.push({name: n, value: v[j]});
+            }
+        }
+        else if (feature.fileapi && el.type == 'file' && !el.disabled) {
+            if (elements) 
+                elements.push(el);
+            var files = el.files;
+            if (files.length) {
+                for (j=0; j < files.length; j++) {
+                    a.push({name: n, value: files[j], type: el.type});
+                }
+            }
+            else {
+                // #180
+                a.push({ name: n, value: '', type: el.type });
+            }
+        }
+        else if (v !== null && typeof v != 'undefined') {
+            if (elements) 
+                elements.push(el);
+            a.push({name: n, value: v, type: el.type, required: el.required});
+        }
+    }
+
+    if (!semantic && form.clk) {
+        // input type=='image' are not found in elements array! handle it here
+        var $input = $(form.clk), input = $input[0];
+        n = input.name;
+        if (n && !input.disabled && input.type == 'image') {
+            a.push({name: n, value: $input.val()});
+            a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+        }
+    }
+    return a;
+};
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&amp;name2=value2
+ */
+$.fn.formSerialize = function(semantic) {
+    //hand off to jQuery.param for proper encoding
+    return $.param(this.formToArray(semantic));
+};
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&amp;name2=value2
+ */
+$.fn.fieldSerialize = function(successful) {
+    var a = [];
+    this.each(function() {
+        var n = this.name;
+        if (!n) {
+            return;
+        }
+        var v = $.fieldValue(this, successful);
+        if (v && v.constructor == Array) {
+            for (var i=0,max=v.length; i < max; i++) {
+                a.push({name: n, value: v[i]});
+            }
+        }
+        else if (v !== null && typeof v != 'undefined') {
+            a.push({name: this.name, value: v});
+        }
+    });
+    //hand off to jQuery.param for proper encoding
+    return $.param(a);
+};
+
+/**
+ * Returns the value(s) of the element in the matched set.  For example, consider the following form:
+ *
+ *  <form><fieldset>
+ *      <input name="A" type="text" />
+ *      <input name="A" type="text" />
+ *      <input name="B" type="checkbox" value="B1" />
+ *      <input name="B" type="checkbox" value="B2"/>
+ *      <input name="C" type="radio" value="C1" />
+ *      <input name="C" type="radio" value="C2" />
+ *  </fieldset></form>
+ *
+ *  var v = $(':text').fieldValue();
+ *  // if no values are entered into the text inputs
+ *  v == ['','']
+ *  // if values entered into the text inputs are 'foo' and 'bar'
+ *  v == ['foo','bar']
+ *
+ *  var v = $(':checkbox').fieldValue();
+ *  // if neither checkbox is checked
+ *  v === undefined
+ *  // if both checkboxes are checked
+ *  v == ['B1', 'B2']
+ *
+ *  var v = $(':radio').fieldValue();
+ *  // if neither radio is checked
+ *  v === undefined
+ *  // if first radio is checked
+ *  v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true.  If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array.  If no valid value can be determined the
+ *    array will be empty, otherwise it will contain one or more values.
+ */
+$.fn.fieldValue = function(successful) {
+    for (var val=[], i=0, max=this.length; i < max; i++) {
+        var el = this[i];
+        var v = $.fieldValue(el, successful);
+        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
+            continue;
+        }
+        if (v.constructor == Array)
+            $.merge(val, v);
+        else
+            val.push(v);
+    }
+    return val;
+};
+
+/**
+ * Returns the value of the field element.
+ */
+$.fieldValue = function(el, successful) {
+    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+    if (successful === undefined) {
+        successful = true;
+    }
+
+    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+        (t == 'checkbox' || t == 'radio') && !el.checked ||
+        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+        tag == 'select' && el.selectedIndex == -1)) {
+            return null;
+    }
+
+    if (tag == 'select') {
+        var index = el.selectedIndex;
+        if (index < 0) {
+            return null;
+        }
+        var a = [], ops = el.options;
+        var one = (t == 'select-one');
+        var max = (one ? index+1 : ops.length);
+        for(var i=(one ? index : 0); i < max; i++) {
+            var op = ops[i];
+            if (op.selected) {
+                var v = op.value;
+                if (!v) { // extra pain for IE...
+                    v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
+                }
+                if (one) {
+                    return v;
+                }
+                a.push(v);
+            }
+        }
+        return a;
+    }
+    return $(el).val();
+};
+
+/**
+ * Clears the form data.  Takes the following actions on the form's input fields:
+ *  - input text fields will have their 'value' property set to the empty string
+ *  - select elements will have their 'selectedIndex' property set to -1
+ *  - checkbox and radio inputs will have their 'checked' property set to false
+ *  - inputs of type submit, button, reset, and hidden will *not* be effected
+ *  - button elements will *not* be effected
+ */
+$.fn.clearForm = function(includeHidden) {
+    return this.each(function() {
+        $('input,select,textarea', this).clearFields(includeHidden);
+    });
+};
+
+/**
+ * Clears the selected form elements.
+ */
+$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
+    var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
+    return this.each(function() {
+        var t = this.type, tag = this.tagName.toLowerCase();
+        if (re.test(t) || tag == 'textarea') {
+            this.value = '';
+        }
+        else if (t == 'checkbox' || t == 'radio') {
+            this.checked = false;
+        }
+        else if (tag == 'select') {
+            this.selectedIndex = -1;
+        }
+        else if (includeHidden) {
+            // includeHidden can be the value true, or it can be a selector string
+            // indicating a special test; for example:
+            //  $('#myForm').clearForm('.special:hidden')
+            // the above would clean hidden inputs that have the class of 'special'
+            if ( (includeHidden === true && /hidden/.test(t)) ||
+                 (typeof includeHidden == 'string' && $(this).is(includeHidden)) )
+                this.value = '';
+        }
+    });
+};
+
+/**
+ * Resets the form data.  Causes all form elements to be reset to their original value.
+ */
+$.fn.resetForm = function() {
+    return this.each(function() {
+        // guard against an input with the name of 'reset'
+        // note that IE reports the reset function as an 'object'
+        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
+            this.reset();
+        }
+    });
+};
+
+/**
+ * Enables or disables any matching elements.
+ */
+$.fn.enable = function(b) {
+    if (b === undefined) {
+        b = true;
+    }
+    return this.each(function() {
+        this.disabled = !b;
+    });
+};
+
+/**
+ * Checks/unchecks any matching checkboxes or radio buttons and
+ * selects/deselects and matching option elements.
+ */
+$.fn.selected = function(select) {
+    if (select === undefined) {
+        select = true;
+    }
+    return this.each(function() {
+        var t = this.type;
+        if (t == 'checkbox' || t == 'radio') {
+            this.checked = select;
+        }
+        else if (this.tagName.toLowerCase() == 'option') {
+            var $sel = $(this).parent('select');
+            if (select && $sel[0] && $sel[0].type == 'select-one') {
+                // deselect all other options
+                $sel.find('option').selected(false);
+            }
+            this.selected = select;
+        }
+    });
+};
+
+// expose debug var
+$.fn.ajaxSubmit.debug = false;
+
+// helper fn for console logging
+function log() {
+    if (!$.fn.ajaxSubmit.debug) 
+        return;
+    var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
+    if (window.console && window.console.log) {
+        window.console.log(msg);
+    }
+    else if (window.opera && window.opera.postError) {
+        window.opera.postError(msg);
+    }
+}
+
+})(jQuery);
diff --git a/resources/lib/jquery.fullscreen.js b/resources/lib/jquery.fullscreen.js
deleted file mode 100644 (file)
index 30e4484..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * jQuery fullscreen plugin v2.0.0-git (9f8f97d127)
- * https://github.com/theopolisme/jquery-fullscreen
- *
- * Copyright (c) 2013 Theopolisme <theopolismewiki@gmail.com>
- *
- * 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.
- */
-( function ( $ ) {
-       var setupFullscreen,
-               fsClass = 'jq-fullscreened';
-
-       /**
-        * On fullscreenchange, trigger a jq-fullscreen-change event
-        * The event is given an object, which contains the fullscreened DOM element (element), if any
-        * and a boolean value (fullscreen) indicating if we've entered or exited fullscreen mode
-        * Also remove the 'fullscreened' class from elements that are no longer fullscreen
-        */
-       function handleFullscreenChange () {
-               var fullscreenElement = document.fullscreenElement ||
-                       document.mozFullScreenElement ||
-                       document.webkitFullscreenElement ||
-                       document.msFullscreenElement;
-
-               if ( !fullscreenElement ) {
-                       $( '.' + fsClass ).data( 'isFullscreened', false ).removeClass( fsClass );
-               }
-
-               $( document ).trigger( $.Event( 'jq-fullscreen-change', { element: fullscreenElement, fullscreen: !!fullscreenElement } ) );
-       }
-
-       /**
-        * Enters full screen with the "this" element in focus.
-        * Check the .data( 'isFullscreened' ) of the return value to check
-        * success or failure, if you're into that sort of thing.
-        * @chainable
-        * @return {jQuery}
-        */
-       function enterFullscreen () {
-               var element = this.get(0),
-                       $element = this.first();
-               if ( element ) {
-                       if ( element.requestFullscreen ) {
-                               element.requestFullscreen();
-                       } else if ( element.mozRequestFullScreen ) {
-                               element.mozRequestFullScreen();
-                       } else if ( element.webkitRequestFullscreen ) {
-                               element.webkitRequestFullscreen();
-                       } else if ( element.msRequestFullscreen ) {
-                               element.msRequestFullscreen();
-                       } else {
-                               // Unable to make fullscreen
-                               $element.data( 'isFullscreened', false );
-                               return this;
-                       }
-                       // Add the fullscreen class and data attribute to `element`
-                       $element.addClass( fsClass ).data( 'isFullscreened', true );
-                       return this;
-               } else {
-                       $element.data( 'isFullscreened', false );
-                       return this;
-               }
-       }
-
-       /**
-        * Brings the "this" element out of fullscreen.
-        * Check the .data( 'isFullscreened' ) of the return value to check
-        * success or failure, if you're into that sort of thing.
-        * @chainable
-        * @return {jQuery}
-        */
-       function exitFullscreen () {
-               var fullscreenElement = ( document.fullscreenElement ||
-                               document.mozFullScreenElement ||
-                               document.webkitFullscreenElement ||
-                               document.msFullscreenElement );
-
-               // Ensure that we only exit fullscreen if exitFullscreen() is being called on the same element that is currently fullscreen
-               if ( fullscreenElement && this.get(0) === fullscreenElement ) {
-                       if ( document.exitFullscreen ) {
-                               document.exitFullscreen();
-                       } else if ( document.mozCancelFullScreen ) {
-                               document.mozCancelFullScreen();
-                       } else if ( document.webkitCancelFullScreen ) {
-                               document.webkitCancelFullScreen();
-                       } else if ( document.msExitFullscreen ) {
-                               document.msExitFullscreen();
-                       } else {
-                               // Unable to cancel fullscreen mode
-                               return this;
-                       }
-                       // We don't need to remove the fullscreen class here,
-                       // because it will be removed in handleFullscreenChange.
-                       // But we should change the data on the element so the
-                       // caller can check for success.
-                       this.first().data( 'isFullscreened', false );
-               }
-
-               return this;
-       }
-
-       /**
-        * Set up fullscreen handling and install necessary event handlers.
-        * Return false if fullscreen is not supported.
-        */
-       setupFullscreen = function () {
-               if ( $.support.fullscreen ) {
-                       // When the fullscreen mode is changed, trigger the
-                       // fullscreen events (and when exiting,
-                       // also remove the fullscreen class)
-                       $( document ).on( 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', handleFullscreenChange);
-                       // Convenience wrapper so that one only needs to listen for
-                       // 'fullscreenerror', not all of the prefixed versions
-                       $( document ).on( 'webkitfullscreenerror mozfullscreenerror MSFullscreenError', function () {
-                               $( document ).trigger( $.Event( 'fullscreenerror' ) );
-                       } );
-                       // Fullscreen has been set up, so always return true
-                       setupFullscreen = function () { return true; };
-                       return true;
-               } else {
-                       // Always return false from now on, since fullscreen is not supported
-                       setupFullscreen = function () { return false; };
-                       return false;
-               }
-       };
-
-       /**
-        * Set up fullscreen handling if necessary, then make the first element
-        * matching the given selector fullscreen
-        * @chainable
-        * @return {jQuery}
-        */
-       $.fn.enterFullscreen = function () {
-               if ( setupFullscreen() ) {
-                       $.fn.enterFullscreen = enterFullscreen;
-                       return this.enterFullscreen();
-               } else {
-                       $.fn.enterFullscreen = function () { return this; };
-                       return this;
-               }
-       };
-
-       /**
-        * Set up fullscreen handling if necessary, then cancel fullscreen mode
-        * for the first element matching the given selector.
-        * @chainable
-        * @return {jQuery}
-        */
-       $.fn.exitFullscreen = function () {
-               if ( setupFullscreen() ) {
-                       $.fn.exitFullscreen = exitFullscreen;
-                       return this.exitFullscreen();
-               } else {
-                       $.fn.exitFullscreen = function () { return this; };
-                       return this;
-               }
-       };
-
-       $.support.fullscreen = document.fullscreenEnabled ||
-               document.webkitFullscreenEnabled ||
-               document.mozFullScreenEnabled ||
-               document.msFullscreenEnabled;
-}( jQuery ) );
diff --git a/resources/lib/jquery.fullscreen/jquery.fullscreen.js b/resources/lib/jquery.fullscreen/jquery.fullscreen.js
new file mode 100644 (file)
index 0000000..2702cee
--- /dev/null
@@ -0,0 +1,175 @@
+/**
+ * jQuery fullscreen plugin
+ * https://github.com/theopolisme/jquery-fullscreen
+ *
+ * Copyright (c) 2013 Theopolisme <theopolismewiki@gmail.com>
+ *
+ * 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.
+ */
+( function ( $ ) {
+       var setupFullscreen,
+               fsClass = 'jq-fullscreened';
+
+       /**
+        * On fullscreenchange, trigger a jq-fullscreen-change event
+        * The event is given an object, which contains the fullscreened DOM element (element), if any
+        * and a boolean value (fullscreen) indicating if we've entered or exited fullscreen mode
+        * Also remove the 'fullscreened' class from elements that are no longer fullscreen
+        */
+       function handleFullscreenChange () {
+               var fullscreenElement = document.fullscreenElement ||
+                       document.mozFullScreenElement ||
+                       document.webkitFullscreenElement ||
+                       document.msFullscreenElement;
+
+               if ( !fullscreenElement ) {
+                       $( '.' + fsClass ).data( 'isFullscreened', false ).removeClass( fsClass );
+               }
+
+               $( document ).trigger( $.Event( 'jq-fullscreen-change', { element: fullscreenElement, fullscreen: !!fullscreenElement } ) );
+       }
+
+       /**
+        * Enters full screen with the "this" element in focus.
+        * Check the .data( 'isFullscreened' ) of the return value to check
+        * success or failure, if you're into that sort of thing.
+        * @chainable
+        * @return {jQuery}
+        */
+       function enterFullscreen () {
+               var element = this.get(0),
+                       $element = this.first();
+               if ( element ) {
+                       if ( element.requestFullscreen ) {
+                               element.requestFullscreen();
+                       } else if ( element.mozRequestFullScreen ) {
+                               element.mozRequestFullScreen();
+                       } else if ( element.webkitRequestFullscreen ) {
+                               element.webkitRequestFullscreen();
+                       } else if ( element.msRequestFullscreen ) {
+                               element.msRequestFullscreen();
+                       } else {
+                               // Unable to make fullscreen
+                               $element.data( 'isFullscreened', false );
+                               return this;
+                       }
+                       // Add the fullscreen class and data attribute to `element`
+                       $element.addClass( fsClass ).data( 'isFullscreened', true );
+                       return this;
+               } else {
+                       $element.data( 'isFullscreened', false );
+                       return this;
+               }
+       }
+
+       /**
+        * Brings the "this" element out of fullscreen.
+        * Check the .data( 'isFullscreened' ) of the return value to check
+        * success or failure, if you're into that sort of thing.
+        * @chainable
+        * @return {jQuery}
+        */
+       function exitFullscreen () {
+               var fullscreenElement = ( document.fullscreenElement ||
+                               document.mozFullScreenElement ||
+                               document.webkitFullscreenElement ||
+                               document.msFullscreenElement );
+
+               // Ensure that we only exit fullscreen if exitFullscreen() is being called on the same element that is currently fullscreen
+               if ( fullscreenElement && this.get(0) === fullscreenElement ) {
+                       if ( document.exitFullscreen ) {
+                               document.exitFullscreen();
+                       } else if ( document.mozCancelFullScreen ) {
+                               document.mozCancelFullScreen();
+                       } else if ( document.webkitCancelFullScreen ) {
+                               document.webkitCancelFullScreen();
+                       } else if ( document.msExitFullscreen ) {
+                               document.msExitFullscreen();
+                       } else {
+                               // Unable to cancel fullscreen mode
+                               return this;
+                       }
+                       // We don't need to remove the fullscreen class here,
+                       // because it will be removed in handleFullscreenChange.
+                       // But we should change the data on the element so the
+                       // caller can check for success.
+                       this.first().data( 'isFullscreened', false );
+               }
+
+               return this;
+       }
+
+       /**
+        * Set up fullscreen handling and install necessary event handlers.
+        * Return false if fullscreen is not supported.
+        */
+       setupFullscreen = function () {
+               if ( $.support.fullscreen ) {
+                       // When the fullscreen mode is changed, trigger the
+                       // fullscreen events (and when exiting,
+                       // also remove the fullscreen class)
+                       $( document ).on( 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', handleFullscreenChange);
+                       // Convenience wrapper so that one only needs to listen for
+                       // 'fullscreenerror', not all of the prefixed versions
+                       $( document ).on( 'webkitfullscreenerror mozfullscreenerror MSFullscreenError', function () {
+                               $( document ).trigger( $.Event( 'fullscreenerror' ) );
+                       } );
+                       // Fullscreen has been set up, so always return true
+                       setupFullscreen = function () { return true; };
+                       return true;
+               } else {
+                       // Always return false from now on, since fullscreen is not supported
+                       setupFullscreen = function () { return false; };
+                       return false;
+               }
+       };
+
+       /**
+        * Set up fullscreen handling if necessary, then make the first element
+        * matching the given selector fullscreen
+        * @chainable
+        * @return {jQuery}
+        */
+       $.fn.enterFullscreen = function () {
+               if ( setupFullscreen() ) {
+                       $.fn.enterFullscreen = enterFullscreen;
+                       return this.enterFullscreen();
+               } else {
+                       $.fn.enterFullscreen = function () { return this; };
+                       return this;
+               }
+       };
+
+       /**
+        * Set up fullscreen handling if necessary, then cancel fullscreen mode
+        * for the first element matching the given selector.
+        * @chainable
+        * @return {jQuery}
+        */
+       $.fn.exitFullscreen = function () {
+               if ( setupFullscreen() ) {
+                       $.fn.exitFullscreen = exitFullscreen;
+                       return this.exitFullscreen();
+               } else {
+                       $.fn.exitFullscreen = function () { return this; };
+                       return this;
+               }
+       };
+
+       $.support.fullscreen = document.fullscreenEnabled ||
+               document.webkitFullscreenEnabled ||
+               document.mozFullScreenEnabled ||
+               document.msFullscreenEnabled;
+}( jQuery ) );
diff --git a/resources/lib/jquery.hoverIntent.js b/resources/lib/jquery.hoverIntent.js
deleted file mode 100644 (file)
index adf948d..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
-* hoverIntent is similar to jQuery's built-in "hover" function except that
-* instead of firing the onMouseOver event immediately, hoverIntent checks
-* to see if the user's mouse has slowed down (beneath the sensitivity
-* threshold) before firing the onMouseOver event.
-* 
-* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
-* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
-* 
-* hoverIntent is currently available for use in all personal or commercial 
-* projects under both MIT and GPL licenses. This means that you can choose 
-* the license that best suits your project, and use it accordingly.
-* 
-* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
-* $("ul li").hoverIntent( showNav , hideNav );
-* 
-* // advanced usage receives configuration object only
-* $("ul li").hoverIntent({
-*      sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)
-*      interval: 100,   // number = milliseconds of polling interval
-*      over: showNav,  // function = onMouseOver callback (required)
-*      timeout: 0,   // number = milliseconds delay before onMouseOut function call
-*      out: hideNav    // function = onMouseOut callback (required)
-* });
-* 
-* @param  f  onMouseOver function || An object with configuration options
-* @param  g  onMouseOut function  || Nothing (use configuration options object)
-* @author    Brian Cherne <brian@cherne.net>
-*/
-(function($) {
-       $.fn.hoverIntent = function(f,g) {
-               // default configuration options
-               var cfg = {
-                       sensitivity: 7,
-                       interval: 100,
-                       timeout: 0
-               };
-               // override configuration options with user supplied object
-               cfg = $.extend(cfg, g ? { over: f, out: g } : f );
-
-               // instantiate variables
-               // cX, cY = current X and Y position of mouse, updated by mousemove event
-               // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
-               var cX, cY, pX, pY;
-
-               // A private function for getting mouse position
-               var track = function(ev) {
-                       cX = ev.pageX;
-                       cY = ev.pageY;
-               };
-
-               // A private function for comparing current and previous mouse position
-               var compare = function(ev,ob) {
-                       ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
-                       // compare mouse positions to see if they've crossed the threshold
-                       if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
-                               $(ob).unbind("mousemove",track);
-                               // set hoverIntent state to true (so mouseOut can be called)
-                               ob.hoverIntent_s = 1;
-                               return cfg.over.apply(ob,[ev]);
-                       } else {
-                               // set previous coordinates for next time
-                               pX = cX; pY = cY;
-                               // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
-                               ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
-                       }
-               };
-
-               // A private function for delaying the mouseOut function
-               var delay = function(ev,ob) {
-                       ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
-                       ob.hoverIntent_s = 0;
-                       return cfg.out.apply(ob,[ev]);
-               };
-
-               // A private function for handling mouse 'hovering'
-               var handleHover = function(e) {
-                       // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
-                       var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
-                       while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
-                       if ( p == this ) { return false; }
-
-                       // copy objects to be passed into t (required for event object to be passed in IE)
-                       var ev = $.extend({},e);
-                       var ob = this;
-
-                       // cancel hoverIntent timer if it exists
-                       if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
-
-                       // else e.type == "onmouseover"
-                       if (e.type == "mouseover") {
-                               // set "previous" X and Y position based on initial entry point
-                               pX = ev.pageX; pY = ev.pageY;
-                               // update "current" X and Y position based on mousemove
-                               $(ob).bind("mousemove",track);
-                               // start polling interval (self-calling timeout) to compare mouse coordinates over time
-                               if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
-
-                       // else e.type == "onmouseout"
-                       } else {
-                               // unbind expensive mousemove event
-                               $(ob).unbind("mousemove",track);
-                               // if hoverIntent state is true, then call the mouseOut function after the specified delay
-                               if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
-                       }
-               };
-
-               // bind the function to the two event listeners
-               return this.mouseover(handleHover).mouseout(handleHover);
-       };
-})(jQuery);
\ No newline at end of file
diff --git a/resources/lib/jquery.hoverIntent/jquery.hoverIntent.js b/resources/lib/jquery.hoverIntent/jquery.hoverIntent.js
new file mode 100644 (file)
index 0000000..bd11442
--- /dev/null
@@ -0,0 +1,111 @@
+/**
+* hoverIntent is similar to jQuery's built-in "hover" function except that
+* instead of firing the onMouseOver event immediately, hoverIntent checks
+* to see if the user's mouse has slowed down (beneath the sensitivity
+* threshold) before firing the onMouseOver event.
+* 
+* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
+* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
+* 
+* hoverIntent is currently available for use in all personal or commercial 
+* projects under both MIT and GPL licenses. This means that you can choose 
+* the license that best suits your project, and use it accordingly.
+* 
+* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
+* $("ul li").hoverIntent( showNav , hideNav );
+* 
+* // advanced usage receives configuration object only
+* $("ul li").hoverIntent({
+*      sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)
+*      interval: 100,   // number = milliseconds of polling interval
+*      over: showNav,  // function = onMouseOver callback (required)
+*      timeout: 0,   // number = milliseconds delay before onMouseOut function call
+*      out: hideNav    // function = onMouseOut callback (required)
+* });
+* 
+* @param  f  onMouseOver function || An object with configuration options
+* @param  g  onMouseOut function  || Nothing (use configuration options object)
+* @author    Brian Cherne <brian@cherne.net>
+*/
+(function($) {
+       $.fn.hoverIntent = function(f,g) {
+               // default configuration options
+               var cfg = {
+                       sensitivity: 7,
+                       interval: 100,
+                       timeout: 0
+               };
+               // override configuration options with user supplied object
+               cfg = $.extend(cfg, g ? { over: f, out: g } : f );
+
+               // instantiate variables
+               // cX, cY = current X and Y position of mouse, updated by mousemove event
+               // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
+               var cX, cY, pX, pY;
+
+               // A private function for getting mouse position
+               var track = function(ev) {
+                       cX = ev.pageX;
+                       cY = ev.pageY;
+               };
+
+               // A private function for comparing current and previous mouse position
+               var compare = function(ev,ob) {
+                       ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
+                       // compare mouse positions to see if they've crossed the threshold
+                       if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
+                               $(ob).unbind("mousemove",track);
+                               // set hoverIntent state to true (so mouseOut can be called)
+                               ob.hoverIntent_s = 1;
+                               return cfg.over.apply(ob,[ev]);
+                       } else {
+                               // set previous coordinates for next time
+                               pX = cX; pY = cY;
+                               // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
+                               ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
+                       }
+               };
+
+               // A private function for delaying the mouseOut function
+               var delay = function(ev,ob) {
+                       ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
+                       ob.hoverIntent_s = 0;
+                       return cfg.out.apply(ob,[ev]);
+               };
+
+               // A private function for handling mouse 'hovering'
+               var handleHover = function(e) {
+                       // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
+                       var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
+                       while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
+                       if ( p == this ) { return false; }
+
+                       // copy objects to be passed into t (required for event object to be passed in IE)
+                       var ev = jQuery.extend({},e);
+                       var ob = this;
+
+                       // cancel hoverIntent timer if it exists
+                       if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
+
+                       // else e.type == "onmouseover"
+                       if (e.type == "mouseover") {
+                               // set "previous" X and Y position based on initial entry point
+                               pX = ev.pageX; pY = ev.pageY;
+                               // update "current" X and Y position based on mousemove
+                               $(ob).bind("mousemove",track);
+                               // start polling interval (self-calling timeout) to compare mouse coordinates over time
+                               if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
+
+                       // else e.type == "onmouseout"
+                       } else {
+                               // unbind expensive mousemove event
+                               $(ob).unbind("mousemove",track);
+                               // if hoverIntent state is true, then call the mouseOut function after the specified delay
+                               if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
+                       }
+               };
+
+               // bind the function to the two event listeners
+               return this.mouseover(handleHover).mouseout(handleHover);
+       };
+})(jQuery);
\ No newline at end of file
diff --git a/resources/lib/jquery.jStorage.js b/resources/lib/jquery.jStorage.js
deleted file mode 100644 (file)
index 45e19ac..0000000
+++ /dev/null
@@ -1,996 +0,0 @@
-/*
- * ----------------------------- JSTORAGE -------------------------------------
- * Simple local storage wrapper to save data on the browser side, supporting
- * all major browsers - IE6+, Firefox2+, Safari4+, Chrome4+ and Opera 10.5+
- *
- * Author: Andris Reinman, andris.reinman@gmail.com
- * Project homepage: www.jstorage.info
- *
- * Licensed under Unlicense:
- *
- * This is free and unencumbered software released into the public domain.
- *
- * Anyone is free to copy, modify, publish, use, compile, sell, or
- * distribute this software, either in source code form or as a compiled
- * binary, for any purpose, commercial or non-commercial, and by any
- * means.
- *
- * In jurisdictions that recognize copyright laws, the author or authors
- * of this software dedicate any and all copyright interest in the
- * software to the public domain. We make this dedication for the benefit
- * of the public at large and to the detriment of our heirs and
- * successors. We intend this dedication to be an overt act of
- * relinquishment in perpetuity of all present and future rights to this
- * software under copyright law.
- *
- * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * For more information, please refer to <http://unlicense.org/>
- */
-
-/* global ActiveXObject: false */
-/* jshint browser: true */
-
-(function() {
-    'use strict';
-
-    var
-    /* jStorage version */
-        JSTORAGE_VERSION = '0.4.12',
-
-        /* detect a dollar object or create one if not found */
-        $ = window.jQuery || window.$ || (window.$ = {}),
-
-        /* check for a JSON handling support */
-        JSON = {
-            parse: window.JSON && (window.JSON.parse || window.JSON.decode) ||
-                String.prototype.evalJSON && function(str) {
-                    return String(str).evalJSON();
-            } ||
-                $.parseJSON ||
-                $.evalJSON,
-            stringify: Object.toJSON ||
-                window.JSON && (window.JSON.stringify || window.JSON.encode) ||
-                $.toJSON
-        };
-
-    // Break if no JSON support was found
-    if (typeof JSON.parse !== 'function' || typeof JSON.stringify !== 'function') {
-        throw new Error('No JSON support found, include //cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js to page');
-    }
-
-    var
-    /* This is the object, that holds the cached values */
-        _storage = {
-            __jstorage_meta: {
-                CRC32: {}
-            }
-        },
-
-        /* Actual browser storage (localStorage or globalStorage['domain']) */
-        _storage_service = {
-            jStorage: '{}'
-        },
-
-        /* DOM element for older IE versions, holds userData behavior */
-        _storage_elm = null,
-
-        /* How much space does the storage take */
-        _storage_size = 0,
-
-        /* which backend is currently used */
-        _backend = false,
-
-        /* onchange observers */
-        _observers = {},
-
-        /* timeout to wait after onchange event */
-        _observer_timeout = false,
-
-        /* last update time */
-        _observer_update = 0,
-
-        /* pubsub observers */
-        _pubsub_observers = {},
-
-        /* skip published items older than current timestamp */
-        _pubsub_last = +new Date(),
-
-        /* Next check for TTL */
-        _ttl_timeout,
-
-        /**
-         * XML encoding and decoding as XML nodes can't be JSON'ized
-         * XML nodes are encoded and decoded if the node is the value to be saved
-         * but not if it's as a property of another object
-         * Eg. -
-         *   $.jStorage.set('key', xmlNode);        // IS OK
-         *   $.jStorage.set('key', {xml: xmlNode}); // NOT OK
-         */
-        _XMLService = {
-
-            /**
-             * Validates a XML node to be XML
-             * based on jQuery.isXML function
-             */
-            isXML: function(elm) {
-                var documentElement = (elm ? elm.ownerDocument || elm : 0).documentElement;
-                return documentElement ? documentElement.nodeName !== 'HTML' : false;
-            },
-
-            /**
-             * Encodes a XML node to string
-             * based on http://www.mercurytide.co.uk/news/article/issues-when-working-ajax/
-             */
-            encode: function(xmlNode) {
-                if (!this.isXML(xmlNode)) {
-                    return false;
-                }
-                try { // Mozilla, Webkit, Opera
-                    return new XMLSerializer().serializeToString(xmlNode);
-                } catch (E1) {
-                    try { // IE
-                        return xmlNode.xml;
-                    } catch (E2) {}
-                }
-                return false;
-            },
-
-            /**
-             * Decodes a XML node from string
-             * loosely based on http://outwestmedia.com/jquery-plugins/xmldom/
-             */
-            decode: function(xmlString) {
-                var dom_parser = ('DOMParser' in window && (new DOMParser()).parseFromString) ||
-                    (window.ActiveXObject && function(_xmlString) {
-                        var xml_doc = new ActiveXObject('Microsoft.XMLDOM');
-                        xml_doc.async = 'false';
-                        xml_doc.loadXML(_xmlString);
-                        return xml_doc;
-                    }),
-                    resultXML;
-                if (!dom_parser) {
-                    return false;
-                }
-                resultXML = dom_parser.call('DOMParser' in window && (new DOMParser()) || window, xmlString, 'text/xml');
-                return this.isXML(resultXML) ? resultXML : false;
-            }
-        };
-
-
-    ////////////////////////// PRIVATE METHODS ////////////////////////
-
-    /**
-     * Initialization function. Detects if the browser supports DOM Storage
-     * or userData behavior and behaves accordingly.
-     */
-    function _init() {
-        /* Check if browser supports localStorage */
-        var localStorageReallyWorks = false;
-        if ('localStorage' in window) {
-            try {
-                window.localStorage.setItem('_tmptest', 'tmpval');
-                localStorageReallyWorks = true;
-                window.localStorage.removeItem('_tmptest');
-            } catch (BogusQuotaExceededErrorOnIos5) {
-                // Thanks be to iOS5 Private Browsing mode which throws
-                // QUOTA_EXCEEDED_ERRROR DOM Exception 22.
-            }
-        }
-
-        if (localStorageReallyWorks) {
-            try {
-                if (window.localStorage) {
-                    _storage_service = window.localStorage;
-                    _backend = 'localStorage';
-                    _observer_update = _storage_service.jStorage_update;
-                }
-            } catch (E3) { /* Firefox fails when touching localStorage and cookies are disabled */ }
-        }
-        /* Check if browser supports globalStorage */
-        else if ('globalStorage' in window) {
-            try {
-                if (window.globalStorage) {
-                    if (window.location.hostname == 'localhost') {
-                        _storage_service = window.globalStorage['localhost.localdomain'];
-                    } else {
-                        _storage_service = window.globalStorage[window.location.hostname];
-                    }
-                    _backend = 'globalStorage';
-                    _observer_update = _storage_service.jStorage_update;
-                }
-            } catch (E4) { /* Firefox fails when touching localStorage and cookies are disabled */ }
-        }
-        /* Check if browser supports userData behavior */
-        else {
-            _storage_elm = document.createElement('link');
-            if (_storage_elm.addBehavior) {
-
-                /* Use a DOM element to act as userData storage */
-                _storage_elm.style.behavior = 'url(#default#userData)';
-
-                /* userData element needs to be inserted into the DOM! */
-                document.getElementsByTagName('head')[0].appendChild(_storage_elm);
-
-                try {
-                    _storage_elm.load('jStorage');
-                } catch (E) {
-                    // try to reset cache
-                    _storage_elm.setAttribute('jStorage', '{}');
-                    _storage_elm.save('jStorage');
-                    _storage_elm.load('jStorage');
-                }
-
-                var data = '{}';
-                try {
-                    data = _storage_elm.getAttribute('jStorage');
-                } catch (E5) {}
-
-                try {
-                    _observer_update = _storage_elm.getAttribute('jStorage_update');
-                } catch (E6) {}
-
-                _storage_service.jStorage = data;
-                _backend = 'userDataBehavior';
-            } else {
-                _storage_elm = null;
-                return;
-            }
-        }
-
-        // Load data from storage
-        _load_storage();
-
-        // remove dead keys
-        _handleTTL();
-
-        // start listening for changes
-        _setupObserver();
-
-        // initialize publish-subscribe service
-        _handlePubSub();
-
-        // handle cached navigation
-        if ('addEventListener' in window) {
-            window.addEventListener('pageshow', function(event) {
-                if (event.persisted) {
-                    _storageObserver();
-                }
-            }, false);
-        }
-    }
-
-    /**
-     * Reload data from storage when needed
-     */
-    function _reloadData() {
-        var data = '{}';
-
-        if (_backend == 'userDataBehavior') {
-            _storage_elm.load('jStorage');
-
-            try {
-                data = _storage_elm.getAttribute('jStorage');
-            } catch (E5) {}
-
-            try {
-                _observer_update = _storage_elm.getAttribute('jStorage_update');
-            } catch (E6) {}
-
-            _storage_service.jStorage = data;
-        }
-
-        _load_storage();
-
-        // remove dead keys
-        _handleTTL();
-
-        _handlePubSub();
-    }
-
-    /**
-     * Sets up a storage change observer
-     */
-    function _setupObserver() {
-        if (_backend == 'localStorage' || _backend == 'globalStorage') {
-            if ('addEventListener' in window) {
-                window.addEventListener('storage', _storageObserver, false);
-            } else {
-                document.attachEvent('onstorage', _storageObserver);
-            }
-        } else if (_backend == 'userDataBehavior') {
-            setInterval(_storageObserver, 1000);
-        }
-    }
-
-    /**
-     * Fired on any kind of data change, needs to check if anything has
-     * really been changed
-     */
-    function _storageObserver() {
-        var updateTime;
-        // cumulate change notifications with timeout
-        clearTimeout(_observer_timeout);
-        _observer_timeout = setTimeout(function() {
-
-            if (_backend == 'localStorage' || _backend == 'globalStorage') {
-                updateTime = _storage_service.jStorage_update;
-            } else if (_backend == 'userDataBehavior') {
-                _storage_elm.load('jStorage');
-                try {
-                    updateTime = _storage_elm.getAttribute('jStorage_update');
-                } catch (E5) {}
-            }
-
-            if (updateTime && updateTime != _observer_update) {
-                _observer_update = updateTime;
-                _checkUpdatedKeys();
-            }
-
-        }, 25);
-    }
-
-    /**
-     * Reloads the data and checks if any keys are changed
-     */
-    function _checkUpdatedKeys() {
-        var oldCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32)),
-            newCrc32List;
-
-        _reloadData();
-        newCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32));
-
-        var key,
-            updated = [],
-            removed = [];
-
-        for (key in oldCrc32List) {
-            if (oldCrc32List.hasOwnProperty(key)) {
-                if (!newCrc32List[key]) {
-                    removed.push(key);
-                    continue;
-                }
-                if (oldCrc32List[key] != newCrc32List[key] && String(oldCrc32List[key]).substr(0, 2) == '2.') {
-                    updated.push(key);
-                }
-            }
-        }
-
-        for (key in newCrc32List) {
-            if (newCrc32List.hasOwnProperty(key)) {
-                if (!oldCrc32List[key]) {
-                    updated.push(key);
-                }
-            }
-        }
-
-        _fireObservers(updated, 'updated');
-        _fireObservers(removed, 'deleted');
-    }
-
-    /**
-     * Fires observers for updated keys
-     *
-     * @param {Array|String} keys Array of key names or a key
-     * @param {String} action What happened with the value (updated, deleted, flushed)
-     */
-    function _fireObservers(keys, action) {
-        keys = [].concat(keys || []);
-
-        var i, j, len, jlen;
-
-        if (action == 'flushed') {
-            keys = [];
-            for (var key in _observers) {
-                if (_observers.hasOwnProperty(key)) {
-                    keys.push(key);
-                }
-            }
-            action = 'deleted';
-        }
-        for (i = 0, len = keys.length; i < len; i++) {
-            if (_observers[keys[i]]) {
-                for (j = 0, jlen = _observers[keys[i]].length; j < jlen; j++) {
-                    _observers[keys[i]][j](keys[i], action);
-                }
-            }
-            if (_observers['*']) {
-                for (j = 0, jlen = _observers['*'].length; j < jlen; j++) {
-                    _observers['*'][j](keys[i], action);
-                }
-            }
-        }
-    }
-
-    /**
-     * Publishes key change to listeners
-     */
-    function _publishChange() {
-        var updateTime = (+new Date()).toString();
-
-        if (_backend == 'localStorage' || _backend == 'globalStorage') {
-            try {
-                _storage_service.jStorage_update = updateTime;
-            } catch (E8) {
-                // safari private mode has been enabled after the jStorage initialization
-                _backend = false;
-            }
-        } else if (_backend == 'userDataBehavior') {
-            _storage_elm.setAttribute('jStorage_update', updateTime);
-            _storage_elm.save('jStorage');
-        }
-
-        _storageObserver();
-    }
-
-    /**
-     * Loads the data from the storage based on the supported mechanism
-     */
-    function _load_storage() {
-        /* if jStorage string is retrieved, then decode it */
-        if (_storage_service.jStorage) {
-            try {
-                _storage = JSON.parse(String(_storage_service.jStorage));
-            } catch (E6) {
-                _storage_service.jStorage = '{}';
-            }
-        } else {
-            _storage_service.jStorage = '{}';
-        }
-        _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
-
-        if (!_storage.__jstorage_meta) {
-            _storage.__jstorage_meta = {};
-        }
-        if (!_storage.__jstorage_meta.CRC32) {
-            _storage.__jstorage_meta.CRC32 = {};
-        }
-    }
-
-    /**
-     * This functions provides the 'save' mechanism to store the jStorage object
-     */
-    function _save() {
-        _dropOldEvents(); // remove expired events
-        try {
-            _storage_service.jStorage = JSON.stringify(_storage);
-            // If userData is used as the storage engine, additional
-            if (_storage_elm) {
-                _storage_elm.setAttribute('jStorage', _storage_service.jStorage);
-                _storage_elm.save('jStorage');
-            }
-            _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
-        } catch (E7) { /* probably cache is full, nothing is saved this way*/ }
-    }
-
-    /**
-     * Function checks if a key is set and is string or numberic
-     *
-     * @param {String} key Key name
-     */
-    function _checkKey(key) {
-        if (typeof key != 'string' && typeof key != 'number') {
-            throw new TypeError('Key name must be string or numeric');
-        }
-        if (key == '__jstorage_meta') {
-            throw new TypeError('Reserved key name');
-        }
-        return true;
-    }
-
-    /**
-     * Removes expired keys
-     */
-    function _handleTTL() {
-        var curtime, i, TTL, CRC32, nextExpire = Infinity,
-            changed = false,
-            deleted = [];
-
-        clearTimeout(_ttl_timeout);
-
-        if (!_storage.__jstorage_meta || typeof _storage.__jstorage_meta.TTL != 'object') {
-            // nothing to do here
-            return;
-        }
-
-        curtime = +new Date();
-        TTL = _storage.__jstorage_meta.TTL;
-
-        CRC32 = _storage.__jstorage_meta.CRC32;
-        for (i in TTL) {
-            if (TTL.hasOwnProperty(i)) {
-                if (TTL[i] <= curtime) {
-                    delete TTL[i];
-                    delete CRC32[i];
-                    delete _storage[i];
-                    changed = true;
-                    deleted.push(i);
-                } else if (TTL[i] < nextExpire) {
-                    nextExpire = TTL[i];
-                }
-            }
-        }
-
-        // set next check
-        if (nextExpire != Infinity) {
-            _ttl_timeout = setTimeout(_handleTTL, Math.min(nextExpire - curtime, 0x7FFFFFFF));
-        }
-
-        // save changes
-        if (changed) {
-            _save();
-            _publishChange();
-            _fireObservers(deleted, 'deleted');
-        }
-    }
-
-    /**
-     * Checks if there's any events on hold to be fired to listeners
-     */
-    function _handlePubSub() {
-        var i, len;
-        if (!_storage.__jstorage_meta.PubSub) {
-            return;
-        }
-        var pubelm,
-            _pubsubCurrent = _pubsub_last,
-            needFired = [];
-
-        for (i = len = _storage.__jstorage_meta.PubSub.length - 1; i >= 0; i--) {
-            pubelm = _storage.__jstorage_meta.PubSub[i];
-            if (pubelm[0] > _pubsub_last) {
-                _pubsubCurrent = pubelm[0];
-                needFired.unshift(pubelm);
-            }
-        }
-
-        for (i = needFired.length - 1; i >= 0; i--) {
-            _fireSubscribers(needFired[i][1], needFired[i][2]);
-        }
-
-        _pubsub_last = _pubsubCurrent;
-    }
-
-    /**
-     * Fires all subscriber listeners for a pubsub channel
-     *
-     * @param {String} channel Channel name
-     * @param {Mixed} payload Payload data to deliver
-     */
-    function _fireSubscribers(channel, payload) {
-        if (_pubsub_observers[channel]) {
-            for (var i = 0, len = _pubsub_observers[channel].length; i < len; i++) {
-                // send immutable data that can't be modified by listeners
-                try {
-                    _pubsub_observers[channel][i](channel, JSON.parse(JSON.stringify(payload)));
-                } catch (E) {}
-            }
-        }
-    }
-
-    /**
-     * Remove old events from the publish stream (at least 2sec old)
-     */
-    function _dropOldEvents() {
-        if (!_storage.__jstorage_meta.PubSub) {
-            return;
-        }
-
-        var retire = +new Date() - 2000;
-
-        for (var i = 0, len = _storage.__jstorage_meta.PubSub.length; i < len; i++) {
-            if (_storage.__jstorage_meta.PubSub[i][0] <= retire) {
-                // deleteCount is needed for IE6
-                _storage.__jstorage_meta.PubSub.splice(i, _storage.__jstorage_meta.PubSub.length - i);
-                break;
-            }
-        }
-
-        if (!_storage.__jstorage_meta.PubSub.length) {
-            delete _storage.__jstorage_meta.PubSub;
-        }
-
-    }
-
-    /**
-     * Publish payload to a channel
-     *
-     * @param {String} channel Channel name
-     * @param {Mixed} payload Payload to send to the subscribers
-     */
-    function _publish(channel, payload) {
-        if (!_storage.__jstorage_meta) {
-            _storage.__jstorage_meta = {};
-        }
-        if (!_storage.__jstorage_meta.PubSub) {
-            _storage.__jstorage_meta.PubSub = [];
-        }
-
-        _storage.__jstorage_meta.PubSub.unshift([+new Date(), channel, payload]);
-
-        _save();
-        _publishChange();
-    }
-
-
-    /**
-     * JS Implementation of MurmurHash2
-     *
-     *  SOURCE: https://github.com/garycourt/murmurhash-js (MIT licensed)
-     *
-     * @author <a href='mailto:gary.court@gmail.com'>Gary Court</a>
-     * @see http://github.com/garycourt/murmurhash-js
-     * @author <a href='mailto:aappleby@gmail.com'>Austin Appleby</a>
-     * @see http://sites.google.com/site/murmurhash/
-     *
-     * @param {string} str ASCII only
-     * @param {number} seed Positive integer only
-     * @return {number} 32-bit positive integer hash
-     */
-
-    function murmurhash2_32_gc(str, seed) {
-        var
-            l = str.length,
-            h = seed ^ l,
-            i = 0,
-            k;
-
-        while (l >= 4) {
-            k =
-                ((str.charCodeAt(i) & 0xff)) |
-                ((str.charCodeAt(++i) & 0xff) << 8) |
-                ((str.charCodeAt(++i) & 0xff) << 16) |
-                ((str.charCodeAt(++i) & 0xff) << 24);
-
-            k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
-            k ^= k >>> 24;
-            k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
-
-            h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k;
-
-            l -= 4;
-            ++i;
-        }
-
-        switch (l) {
-            case 3:
-                h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
-                /* falls through */
-            case 2:
-                h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
-                /* falls through */
-            case 1:
-                h ^= (str.charCodeAt(i) & 0xff);
-                h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
-        }
-
-        h ^= h >>> 13;
-        h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
-        h ^= h >>> 15;
-
-        return h >>> 0;
-    }
-
-    ////////////////////////// PUBLIC INTERFACE /////////////////////////
-
-    $.jStorage = {
-        /* Version number */
-        version: JSTORAGE_VERSION,
-
-        /**
-         * Sets a key's value.
-         *
-         * @param {String} key Key to set. If this value is not set or not
-         *              a string an exception is raised.
-         * @param {Mixed} value Value to set. This can be any value that is JSON
-         *              compatible (Numbers, Strings, Objects etc.).
-         * @param {Object} [options] - possible options to use
-         * @param {Number} [options.TTL] - optional TTL value, in milliseconds
-         * @return {Mixed} the used value
-         */
-        set: function(key, value, options) {
-            _checkKey(key);
-
-            options = options || {};
-
-            // undefined values are deleted automatically
-            if (typeof value == 'undefined') {
-                this.deleteKey(key);
-                return value;
-            }
-
-            if (_XMLService.isXML(value)) {
-                value = {
-                    _is_xml: true,
-                    xml: _XMLService.encode(value)
-                };
-            } else if (typeof value == 'function') {
-                return undefined; // functions can't be saved!
-            } else if (value && typeof value == 'object') {
-                // clone the object before saving to _storage tree
-                value = JSON.parse(JSON.stringify(value));
-            }
-
-            _storage[key] = value;
-
-            _storage.__jstorage_meta.CRC32[key] = '2.' + murmurhash2_32_gc(JSON.stringify(value), 0x9747b28c);
-
-            this.setTTL(key, options.TTL || 0); // also handles saving and _publishChange
-
-            _fireObservers(key, 'updated');
-            return value;
-        },
-
-        /**
-         * Looks up a key in cache
-         *
-         * @param {String} key - Key to look up.
-         * @param {mixed} def - Default value to return, if key didn't exist.
-         * @return {Mixed} the key value, default value or null
-         */
-        get: function(key, def) {
-            _checkKey(key);
-            if (key in _storage) {
-                if (_storage[key] && typeof _storage[key] == 'object' && _storage[key]._is_xml) {
-                    return _XMLService.decode(_storage[key].xml);
-                } else {
-                    return _storage[key];
-                }
-            }
-            return typeof(def) == 'undefined' ? null : def;
-        },
-
-        /**
-         * Deletes a key from cache.
-         *
-         * @param {String} key - Key to delete.
-         * @return {Boolean} true if key existed or false if it didn't
-         */
-        deleteKey: function(key) {
-            _checkKey(key);
-            if (key in _storage) {
-                delete _storage[key];
-                // remove from TTL list
-                if (typeof _storage.__jstorage_meta.TTL == 'object' &&
-                    key in _storage.__jstorage_meta.TTL) {
-                    delete _storage.__jstorage_meta.TTL[key];
-                }
-
-                delete _storage.__jstorage_meta.CRC32[key];
-
-                _save();
-                _publishChange();
-                _fireObservers(key, 'deleted');
-                return true;
-            }
-            return false;
-        },
-
-        /**
-         * Sets a TTL for a key, or remove it if ttl value is 0 or below
-         *
-         * @param {String} key - key to set the TTL for
-         * @param {Number} ttl - TTL timeout in milliseconds
-         * @return {Boolean} true if key existed or false if it didn't
-         */
-        setTTL: function(key, ttl) {
-            var curtime = +new Date();
-            _checkKey(key);
-            ttl = Number(ttl) || 0;
-            if (key in _storage) {
-
-                if (!_storage.__jstorage_meta.TTL) {
-                    _storage.__jstorage_meta.TTL = {};
-                }
-
-                // Set TTL value for the key
-                if (ttl > 0) {
-                    _storage.__jstorage_meta.TTL[key] = curtime + ttl;
-                } else {
-                    delete _storage.__jstorage_meta.TTL[key];
-                }
-
-                _save();
-
-                _handleTTL();
-
-                _publishChange();
-                return true;
-            }
-            return false;
-        },
-
-        /**
-         * Gets remaining TTL (in milliseconds) for a key or 0 when no TTL has been set
-         *
-         * @param {String} key Key to check
-         * @return {Number} Remaining TTL in milliseconds
-         */
-        getTTL: function(key) {
-            var curtime = +new Date(),
-                ttl;
-            _checkKey(key);
-            if (key in _storage && _storage.__jstorage_meta.TTL && _storage.__jstorage_meta.TTL[key]) {
-                ttl = _storage.__jstorage_meta.TTL[key] - curtime;
-                return ttl || 0;
-            }
-            return 0;
-        },
-
-        /**
-         * Deletes everything in cache.
-         *
-         * @return {Boolean} Always true
-         */
-        flush: function() {
-            _storage = {
-                __jstorage_meta: {
-                    CRC32: {}
-                }
-            };
-            _save();
-            _publishChange();
-            _fireObservers(null, 'flushed');
-            return true;
-        },
-
-        /**
-         * Returns a read-only copy of _storage
-         *
-         * @return {Object} Read-only copy of _storage
-         */
-        storageObj: function() {
-            function F() {}
-            F.prototype = _storage;
-            return new F();
-        },
-
-        /**
-         * Returns an index of all used keys as an array
-         * ['key1', 'key2',..'keyN']
-         *
-         * @return {Array} Used keys
-         */
-        index: function() {
-            var index = [],
-                i;
-            for (i in _storage) {
-                if (_storage.hasOwnProperty(i) && i != '__jstorage_meta') {
-                    index.push(i);
-                }
-            }
-            return index;
-        },
-
-        /**
-         * How much space in bytes does the storage take?
-         *
-         * @return {Number} Storage size in chars (not the same as in bytes,
-         *                  since some chars may take several bytes)
-         */
-        storageSize: function() {
-            return _storage_size;
-        },
-
-        /**
-         * Which backend is currently in use?
-         *
-         * @return {String} Backend name
-         */
-        currentBackend: function() {
-            return _backend;
-        },
-
-        /**
-         * Test if storage is available
-         *
-         * @return {Boolean} True if storage can be used
-         */
-        storageAvailable: function() {
-            return !!_backend;
-        },
-
-        /**
-         * Register change listeners
-         *
-         * @param {String} key Key name
-         * @param {Function} callback Function to run when the key changes
-         */
-        listenKeyChange: function(key, callback) {
-            _checkKey(key);
-            if (!_observers[key]) {
-                _observers[key] = [];
-            }
-            _observers[key].push(callback);
-        },
-
-        /**
-         * Remove change listeners
-         *
-         * @param {String} key Key name to unregister listeners against
-         * @param {Function} [callback] If set, unregister the callback, if not - unregister all
-         */
-        stopListening: function(key, callback) {
-            _checkKey(key);
-
-            if (!_observers[key]) {
-                return;
-            }
-
-            if (!callback) {
-                delete _observers[key];
-                return;
-            }
-
-            for (var i = _observers[key].length - 1; i >= 0; i--) {
-                if (_observers[key][i] == callback) {
-                    _observers[key].splice(i, 1);
-                }
-            }
-        },
-
-        /**
-         * Subscribe to a Publish/Subscribe event stream
-         *
-         * @param {String} channel Channel name
-         * @param {Function} callback Function to run when the something is published to the channel
-         */
-        subscribe: function(channel, callback) {
-            channel = (channel || '').toString();
-            if (!channel) {
-                throw new TypeError('Channel not defined');
-            }
-            if (!_pubsub_observers[channel]) {
-                _pubsub_observers[channel] = [];
-            }
-            _pubsub_observers[channel].push(callback);
-        },
-
-        /**
-         * Publish data to an event stream
-         *
-         * @param {String} channel Channel name
-         * @param {Mixed} payload Payload to deliver
-         */
-        publish: function(channel, payload) {
-            channel = (channel || '').toString();
-            if (!channel) {
-                throw new TypeError('Channel not defined');
-            }
-
-            _publish(channel, payload);
-        },
-
-        /**
-         * Reloads the data from browser storage
-         */
-        reInit: function() {
-            _reloadData();
-        },
-
-        /**
-         * Removes reference from global objects and saves it as jStorage
-         *
-         * @param {Boolean} option if needed to save object as simple 'jStorage' in windows context
-         */
-        noConflict: function(saveInGlobal) {
-            delete window.$.jStorage;
-
-            if (saveInGlobal) {
-                window.jStorage = this;
-            }
-
-            return this;
-        }
-    };
-
-    // Initialize jStorage
-    _init();
-
-})();
diff --git a/resources/lib/jquery.jStorage/jstorage.js b/resources/lib/jquery.jStorage/jstorage.js
new file mode 100644 (file)
index 0000000..1ac8fcc
--- /dev/null
@@ -0,0 +1,996 @@
+/*
+ * ----------------------------- JSTORAGE -------------------------------------
+ * Simple local storage wrapper to save data on the browser side, supporting
+ * all major browsers - IE6+, Firefox2+, Safari4+, Chrome4+ and Opera 10.5+
+ *
+ * Author: Andris Reinman, andris.reinman@gmail.com
+ * Project homepage: www.jstorage.info
+ *
+ * Licensed under Unlicense:
+ *
+ * This is free and unencumbered software released into the public domain.
+ *
+ * Anyone is free to copy, modify, publish, use, compile, sell, or
+ * distribute this software, either in source code form or as a compiled
+ * binary, for any purpose, commercial or non-commercial, and by any
+ * means.
+ *
+ * In jurisdictions that recognize copyright laws, the author or authors
+ * of this software dedicate any and all copyright interest in the
+ * software to the public domain. We make this dedication for the benefit
+ * of the public at large and to the detriment of our heirs and
+ * successors. We intend this dedication to be an overt act of
+ * relinquishment in perpetuity of all present and future rights to this
+ * software under copyright law.
+ *
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * For more information, please refer to <http://unlicense.org/>
+ */
+
+/* global ActiveXObject: false */
+/* jshint browser: true */
+
+(function() {
+    'use strict';
+
+    var
+    /* jStorage version */
+        JSTORAGE_VERSION = '0.4.12',
+
+        /* detect a dollar object or create one if not found */
+        $ = window.jQuery || window.$ || (window.$ = {}),
+
+        /* check for a JSON handling support */
+        JSON = {
+            parse: window.JSON && (window.JSON.parse || window.JSON.decode) ||
+                String.prototype.evalJSON && function(str) {
+                    return String(str).evalJSON();
+            } ||
+                $.parseJSON ||
+                $.evalJSON,
+            stringify: Object.toJSON ||
+                window.JSON && (window.JSON.stringify || window.JSON.encode) ||
+                $.toJSON
+        };
+
+    // Break if no JSON support was found
+    if (typeof JSON.parse !== 'function' || typeof JSON.stringify !== 'function') {
+        throw new Error('No JSON support found, include //cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js to page');
+    }
+
+    var
+    /* This is the object, that holds the cached values */
+        _storage = {
+            __jstorage_meta: {
+                CRC32: {}
+            }
+        },
+
+        /* Actual browser storage (localStorage or globalStorage['domain']) */
+        _storage_service = {
+            jStorage: '{}'
+        },
+
+        /* DOM element for older IE versions, holds userData behavior */
+        _storage_elm = null,
+
+        /* How much space does the storage take */
+        _storage_size = 0,
+
+        /* which backend is currently used */
+        _backend = false,
+
+        /* onchange observers */
+        _observers = {},
+
+        /* timeout to wait after onchange event */
+        _observer_timeout = false,
+
+        /* last update time */
+        _observer_update = 0,
+
+        /* pubsub observers */
+        _pubsub_observers = {},
+
+        /* skip published items older than current timestamp */
+        _pubsub_last = +new Date(),
+
+        /* Next check for TTL */
+        _ttl_timeout,
+
+        /**
+         * XML encoding and decoding as XML nodes can't be JSON'ized
+         * XML nodes are encoded and decoded if the node is the value to be saved
+         * but not if it's as a property of another object
+         * Eg. -
+         *   $.jStorage.set('key', xmlNode);        // IS OK
+         *   $.jStorage.set('key', {xml: xmlNode}); // NOT OK
+         */
+        _XMLService = {
+
+            /**
+             * Validates a XML node to be XML
+             * based on jQuery.isXML function
+             */
+            isXML: function(elm) {
+                var documentElement = (elm ? elm.ownerDocument || elm : 0).documentElement;
+                return documentElement ? documentElement.nodeName !== 'HTML' : false;
+            },
+
+            /**
+             * Encodes a XML node to string
+             * based on http://www.mercurytide.co.uk/news/article/issues-when-working-ajax/
+             */
+            encode: function(xmlNode) {
+                if (!this.isXML(xmlNode)) {
+                    return false;
+                }
+                try { // Mozilla, Webkit, Opera
+                    return new XMLSerializer().serializeToString(xmlNode);
+                } catch (E1) {
+                    try { // IE
+                        return xmlNode.xml;
+                    } catch (E2) {}
+                }
+                return false;
+            },
+
+            /**
+             * Decodes a XML node from string
+             * loosely based on http://outwestmedia.com/jquery-plugins/xmldom/
+             */
+            decode: function(xmlString) {
+                var dom_parser = ('DOMParser' in window && (new DOMParser()).parseFromString) ||
+                    (window.ActiveXObject && function(_xmlString) {
+                        var xml_doc = new ActiveXObject('Microsoft.XMLDOM');
+                        xml_doc.async = 'false';
+                        xml_doc.loadXML(_xmlString);
+                        return xml_doc;
+                    }),
+                    resultXML;
+                if (!dom_parser) {
+                    return false;
+                }
+                resultXML = dom_parser.call('DOMParser' in window && (new DOMParser()) || window, xmlString, 'text/xml');
+                return this.isXML(resultXML) ? resultXML : false;
+            }
+        };
+
+
+    ////////////////////////// PRIVATE METHODS ////////////////////////
+
+    /**
+     * Initialization function. Detects if the browser supports DOM Storage
+     * or userData behavior and behaves accordingly.
+     */
+    function _init() {
+        /* Check if browser supports localStorage */
+        var localStorageReallyWorks = false;
+        if ('localStorage' in window) {
+            try {
+                window.localStorage.setItem('_tmptest', 'tmpval');
+                localStorageReallyWorks = true;
+                window.localStorage.removeItem('_tmptest');
+            } catch (BogusQuotaExceededErrorOnIos5) {
+                // Thanks be to iOS5 Private Browsing mode which throws
+                // QUOTA_EXCEEDED_ERRROR DOM Exception 22.
+            }
+        }
+
+        if (localStorageReallyWorks) {
+            try {
+                if (window.localStorage) {
+                    _storage_service = window.localStorage;
+                    _backend = 'localStorage';
+                    _observer_update = _storage_service.jStorage_update;
+                }
+            } catch (E3) { /* Firefox fails when touching localStorage and cookies are disabled */ }
+        }
+        /* Check if browser supports globalStorage */
+        else if ('globalStorage' in window) {
+            try {
+                if (window.globalStorage) {
+                    if (window.location.hostname == 'localhost') {
+                        _storage_service = window.globalStorage['localhost.localdomain'];
+                    } else {
+                        _storage_service = window.globalStorage[window.location.hostname];
+                    }
+                    _backend = 'globalStorage';
+                    _observer_update = _storage_service.jStorage_update;
+                }
+            } catch (E4) { /* Firefox fails when touching localStorage and cookies are disabled */ }
+        }
+        /* Check if browser supports userData behavior */
+        else {
+            _storage_elm = document.createElement('link');
+            if (_storage_elm.addBehavior) {
+
+                /* Use a DOM element to act as userData storage */
+                _storage_elm.style.behavior = 'url(#default#userData)';
+
+                /* userData element needs to be inserted into the DOM! */
+                document.getElementsByTagName('head')[0].appendChild(_storage_elm);
+
+                try {
+                    _storage_elm.load('jStorage');
+                } catch (E) {
+                    // try to reset cache
+                    _storage_elm.setAttribute('jStorage', '{}');
+                    _storage_elm.save('jStorage');
+                    _storage_elm.load('jStorage');
+                }
+
+                var data = '{}';
+                try {
+                    data = _storage_elm.getAttribute('jStorage');
+                } catch (E5) {}
+
+                try {
+                    _observer_update = _storage_elm.getAttribute('jStorage_update');
+                } catch (E6) {}
+
+                _storage_service.jStorage = data;
+                _backend = 'userDataBehavior';
+            } else {
+                _storage_elm = null;
+                return;
+            }
+        }
+
+        // Load data from storage
+        _load_storage();
+
+        // remove dead keys
+        _handleTTL();
+
+        // start listening for changes
+        _setupObserver();
+
+        // initialize publish-subscribe service
+        _handlePubSub();
+
+        // handle cached navigation
+        if ('addEventListener' in window) {
+            window.addEventListener('pageshow', function(event) {
+                if (event.persisted) {
+                    _storageObserver();
+                }
+            }, false);
+        }
+    }
+
+    /**
+     * Reload data from storage when needed
+     */
+    function _reloadData() {
+        var data = '{}';
+
+        if (_backend == 'userDataBehavior') {
+            _storage_elm.load('jStorage');
+
+            try {
+                data = _storage_elm.getAttribute('jStorage');
+            } catch (E5) {}
+
+            try {
+                _observer_update = _storage_elm.getAttribute('jStorage_update');
+            } catch (E6) {}
+
+            _storage_service.jStorage = data;
+        }
+
+        _load_storage();
+
+        // remove dead keys
+        _handleTTL();
+
+        _handlePubSub();
+    }
+
+    /**
+     * Sets up a storage change observer
+     */
+    function _setupObserver() {
+        if (_backend == 'localStorage' || _backend == 'globalStorage') {
+            if ('addEventListener' in window) {
+                window.addEventListener('storage', _storageObserver, false);
+            } else {
+                document.attachEvent('onstorage', _storageObserver);
+            }
+        } else if (_backend == 'userDataBehavior') {
+            setInterval(_storageObserver, 1000);
+        }
+    }
+
+    /**
+     * Fired on any kind of data change, needs to check if anything has
+     * really been changed
+     */
+    function _storageObserver() {
+        var updateTime;
+        // cumulate change notifications with timeout
+        clearTimeout(_observer_timeout);
+        _observer_timeout = setTimeout(function() {
+
+            if (_backend == 'localStorage' || _backend == 'globalStorage') {
+                updateTime = _storage_service.jStorage_update;
+            } else if (_backend == 'userDataBehavior') {
+                _storage_elm.load('jStorage');
+                try {
+                    updateTime = _storage_elm.getAttribute('jStorage_update');
+                } catch (E5) {}
+            }
+
+            if (updateTime && updateTime != _observer_update) {
+                _observer_update = updateTime;
+                _checkUpdatedKeys();
+            }
+
+        }, 25);
+    }
+
+    /**
+     * Reloads the data and checks if any keys are changed
+     */
+    function _checkUpdatedKeys() {
+        var oldCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32)),
+            newCrc32List;
+
+        _reloadData();
+        newCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32));
+
+        var key,
+            updated = [],
+            removed = [];
+
+        for (key in oldCrc32List) {
+            if (oldCrc32List.hasOwnProperty(key)) {
+                if (!newCrc32List[key]) {
+                    removed.push(key);
+                    continue;
+                }
+                if (oldCrc32List[key] != newCrc32List[key] && String(oldCrc32List[key]).substr(0, 2) == '2.') {
+                    updated.push(key);
+                }
+            }
+        }
+
+        for (key in newCrc32List) {
+            if (newCrc32List.hasOwnProperty(key)) {
+                if (!oldCrc32List[key]) {
+                    updated.push(key);
+                }
+            }
+        }
+
+        _fireObservers(updated, 'updated');
+        _fireObservers(removed, 'deleted');
+    }
+
+    /**
+     * Fires observers for updated keys
+     *
+     * @param {Array|String} keys Array of key names or a key
+     * @param {String} action What happened with the value (updated, deleted, flushed)
+     */
+    function _fireObservers(keys, action) {
+        keys = [].concat(keys || []);
+
+        var i, j, len, jlen;
+
+        if (action == 'flushed') {
+            keys = [];
+            for (var key in _observers) {
+                if (_observers.hasOwnProperty(key)) {
+                    keys.push(key);
+                }
+            }
+            action = 'deleted';
+        }
+        for (i = 0, len = keys.length; i < len; i++) {
+            if (_observers[keys[i]]) {
+                for (j = 0, jlen = _observers[keys[i]].length; j < jlen; j++) {
+                    _observers[keys[i]][j](keys[i], action);
+                }
+            }
+            if (_observers['*']) {
+                for (j = 0, jlen = _observers['*'].length; j < jlen; j++) {
+                    _observers['*'][j](keys[i], action);
+                }
+            }
+        }
+    }
+
+    /**
+     * Publishes key change to listeners
+     */
+    function _publishChange() {
+        var updateTime = (+new Date()).toString();
+
+        if (_backend == 'localStorage' || _backend == 'globalStorage') {
+            try {
+                _storage_service.jStorage_update = updateTime;
+            } catch (E8) {
+                // safari private mode has been enabled after the jStorage initialization
+                _backend = false;
+            }
+        } else if (_backend == 'userDataBehavior') {
+            _storage_elm.setAttribute('jStorage_update', updateTime);
+            _storage_elm.save('jStorage');
+        }
+
+        _storageObserver();
+    }
+
+    /**
+     * Loads the data from the storage based on the supported mechanism
+     */
+    function _load_storage() {
+        /* if jStorage string is retrieved, then decode it */
+        if (_storage_service.jStorage) {
+            try {
+                _storage = JSON.parse(String(_storage_service.jStorage));
+            } catch (E6) {
+                _storage_service.jStorage = '{}';
+            }
+        } else {
+            _storage_service.jStorage = '{}';
+        }
+        _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
+
+        if (!_storage.__jstorage_meta) {
+            _storage.__jstorage_meta = {};
+        }
+        if (!_storage.__jstorage_meta.CRC32) {
+            _storage.__jstorage_meta.CRC32 = {};
+        }
+    }
+
+    /**
+     * This functions provides the 'save' mechanism to store the jStorage object
+     */
+    function _save() {
+        _dropOldEvents(); // remove expired events
+        try {
+            _storage_service.jStorage = JSON.stringify(_storage);
+            // If userData is used as the storage engine, additional
+            if (_storage_elm) {
+                _storage_elm.setAttribute('jStorage', _storage_service.jStorage);
+                _storage_elm.save('jStorage');
+            }
+            _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
+        } catch (E7) { /* probably cache is full, nothing is saved this way*/ }
+    }
+
+    /**
+     * Function checks if a key is set and is string or numberic
+     *
+     * @param {String} key Key name
+     */
+    function _checkKey(key) {
+        if (typeof key != 'string' && typeof key != 'number') {
+            throw new TypeError('Key name must be string or numeric');
+        }
+        if (key == '__jstorage_meta') {
+            throw new TypeError('Reserved key name');
+        }
+        return true;
+    }
+
+    /**
+     * Removes expired keys
+     */
+    function _handleTTL() {
+        var curtime, i, TTL, CRC32, nextExpire = Infinity,
+            changed = false,
+            deleted = [];
+
+        clearTimeout(_ttl_timeout);
+
+        if (!_storage.__jstorage_meta || typeof _storage.__jstorage_meta.TTL != 'object') {
+            // nothing to do here
+            return;
+        }
+
+        curtime = +new Date();
+        TTL = _storage.__jstorage_meta.TTL;
+
+        CRC32 = _storage.__jstorage_meta.CRC32;
+        for (i in TTL) {
+            if (TTL.hasOwnProperty(i)) {
+                if (TTL[i] <= curtime) {
+                    delete TTL[i];
+                    delete CRC32[i];
+                    delete _storage[i];
+                    changed = true;
+                    deleted.push(i);
+                } else if (TTL[i] < nextExpire) {
+                    nextExpire = TTL[i];
+                }
+            }
+        }
+
+        // set next check
+        if (nextExpire != Infinity) {
+            _ttl_timeout = setTimeout(_handleTTL, Math.min(nextExpire - curtime, 0x7FFFFFFF));
+        }
+
+        // save changes
+        if (changed) {
+            _save();
+            _publishChange();
+            _fireObservers(deleted, 'deleted');
+        }
+    }
+
+    /**
+     * Checks if there's any events on hold to be fired to listeners
+     */
+    function _handlePubSub() {
+        var i, len;
+        if (!_storage.__jstorage_meta.PubSub) {
+            return;
+        }
+        var pubelm,
+            _pubsubCurrent = _pubsub_last,
+            needFired = [];
+
+        for (i = len = _storage.__jstorage_meta.PubSub.length - 1; i >= 0; i--) {
+            pubelm = _storage.__jstorage_meta.PubSub[i];
+            if (pubelm[0] > _pubsub_last) {
+                _pubsubCurrent = pubelm[0];
+                needFired.unshift(pubelm);
+            }
+        }
+
+        for (i = needFired.length - 1; i >= 0; i--) {
+            _fireSubscribers(needFired[i][1], needFired[i][2]);
+        }
+
+        _pubsub_last = _pubsubCurrent;
+    }
+
+    /**
+     * Fires all subscriber listeners for a pubsub channel
+     *
+     * @param {String} channel Channel name
+     * @param {Mixed} payload Payload data to deliver
+     */
+    function _fireSubscribers(channel, payload) {
+        if (_pubsub_observers[channel]) {
+            for (var i = 0, len = _pubsub_observers[channel].length; i < len; i++) {
+                // send immutable data that can't be modified by listeners
+                try {
+                    _pubsub_observers[channel][i](channel, JSON.parse(JSON.stringify(payload)));
+                } catch (E) {}
+            }
+        }
+    }
+
+    /**
+     * Remove old events from the publish stream (at least 2sec old)
+     */
+    function _dropOldEvents() {
+        if (!_storage.__jstorage_meta.PubSub) {
+            return;
+        }
+
+        var retire = +new Date() - 2000;
+
+        for (var i = 0, len = _storage.__jstorage_meta.PubSub.length; i < len; i++) {
+            if (_storage.__jstorage_meta.PubSub[i][0] <= retire) {
+                // deleteCount is needed for IE6
+                _storage.__jstorage_meta.PubSub.splice(i, _storage.__jstorage_meta.PubSub.length - i);
+                break;
+            }
+        }
+
+        if (!_storage.__jstorage_meta.PubSub.length) {
+            delete _storage.__jstorage_meta.PubSub;
+        }
+
+    }
+
+    /**
+     * Publish payload to a channel
+     *
+     * @param {String} channel Channel name
+     * @param {Mixed} payload Payload to send to the subscribers
+     */
+    function _publish(channel, payload) {
+        if (!_storage.__jstorage_meta) {
+            _storage.__jstorage_meta = {};
+        }
+        if (!_storage.__jstorage_meta.PubSub) {
+            _storage.__jstorage_meta.PubSub = [];
+        }
+
+        _storage.__jstorage_meta.PubSub.unshift([+new Date(), channel, payload]);
+
+        _save();
+        _publishChange();
+    }
+
+
+    /**
+     * JS Implementation of MurmurHash2
+     *
+     *  SOURCE: https://github.com/garycourt/murmurhash-js (MIT licensed)
+     *
+     * @author <a href='mailto:gary.court@gmail.com'>Gary Court</a>
+     * @see http://github.com/garycourt/murmurhash-js
+     * @author <a href='mailto:aappleby@gmail.com'>Austin Appleby</a>
+     * @see http://sites.google.com/site/murmurhash/
+     *
+     * @param {string} str ASCII only
+     * @param {number} seed Positive integer only
+     * @return {number} 32-bit positive integer hash
+     */
+
+    function murmurhash2_32_gc(str, seed) {
+        var
+            l = str.length,
+            h = seed ^ l,
+            i = 0,
+            k;
+
+        while (l >= 4) {
+            k =
+                ((str.charCodeAt(i) & 0xff)) |
+                ((str.charCodeAt(++i) & 0xff) << 8) |
+                ((str.charCodeAt(++i) & 0xff) << 16) |
+                ((str.charCodeAt(++i) & 0xff) << 24);
+
+            k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
+            k ^= k >>> 24;
+            k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));
+
+            h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k;
+
+            l -= 4;
+            ++i;
+        }
+
+        switch (l) {
+            case 3:
+                h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
+                /* falls through */
+            case 2:
+                h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
+                /* falls through */
+            case 1:
+                h ^= (str.charCodeAt(i) & 0xff);
+                h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
+        }
+
+        h ^= h >>> 13;
+        h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));
+        h ^= h >>> 15;
+
+        return h >>> 0;
+    }
+
+    ////////////////////////// PUBLIC INTERFACE /////////////////////////
+
+    $.jStorage = {
+        /* Version number */
+        version: JSTORAGE_VERSION,
+
+        /**
+         * Sets a key's value.
+         *
+         * @param {String} key Key to set. If this value is not set or not
+         *              a string an exception is raised.
+         * @param {Mixed} value Value to set. This can be any value that is JSON
+         *              compatible (Numbers, Strings, Objects etc.).
+         * @param {Object} [options] - possible options to use
+         * @param {Number} [options.TTL] - optional TTL value, in milliseconds
+         * @return {Mixed} the used value
+         */
+        set: function(key, value, options) {
+            _checkKey(key);
+
+            options = options || {};
+
+            // undefined values are deleted automatically
+            if (typeof value == 'undefined') {
+                this.deleteKey(key);
+                return value;
+            }
+
+            if (_XMLService.isXML(value)) {
+                value = {
+                    _is_xml: true,
+                    xml: _XMLService.encode(value)
+                };
+            } else if (typeof value == 'function') {
+                return undefined; // functions can't be saved!
+            } else if (value && typeof value == 'object') {
+                // clone the object before saving to _storage tree
+                value = JSON.parse(JSON.stringify(value));
+            }
+
+            _storage[key] = value;
+
+            _storage.__jstorage_meta.CRC32[key] = '2.' + murmurhash2_32_gc(JSON.stringify(value), 0x9747b28c);
+
+            this.setTTL(key, options.TTL || 0); // also handles saving and _publishChange
+
+            _fireObservers(key, 'updated');
+            return value;
+        },
+
+        /**
+         * Looks up a key in cache
+         *
+         * @param {String} key - Key to look up.
+         * @param {mixed} def - Default value to return, if key didn't exist.
+         * @return {Mixed} the key value, default value or null
+         */
+        get: function(key, def) {
+            _checkKey(key);
+            if (key in _storage) {
+                if (_storage[key] && typeof _storage[key] == 'object' && _storage[key]._is_xml) {
+                    return _XMLService.decode(_storage[key].xml);
+                } else {
+                    return _storage[key];
+                }
+            }
+            return typeof(def) == 'undefined' ? null : def;
+        },
+
+        /**
+         * Deletes a key from cache.
+         *
+         * @param {String} key - Key to delete.
+         * @return {Boolean} true if key existed or false if it didn't
+         */
+        deleteKey: function(key) {
+            _checkKey(key);
+            if (key in _storage) {
+                delete _storage[key];
+                // remove from TTL list
+                if (typeof _storage.__jstorage_meta.TTL == 'object' &&
+                    key in _storage.__jstorage_meta.TTL) {
+                    delete _storage.__jstorage_meta.TTL[key];
+                }
+
+                delete _storage.__jstorage_meta.CRC32[key];
+
+                _save();
+                _publishChange();
+                _fireObservers(key, 'deleted');
+                return true;
+            }
+            return false;
+        },
+
+        /**
+         * Sets a TTL for a key, or remove it if ttl value is 0 or below
+         *
+         * @param {String} key - key to set the TTL for
+         * @param {Number} ttl - TTL timeout in milliseconds
+         * @return {Boolean} true if key existed or false if it didn't
+         */
+        setTTL: function(key, ttl) {
+            var curtime = +new Date();
+            _checkKey(key);
+            ttl = Number(ttl) || 0;
+            if (key in _storage) {
+
+                if (!_storage.__jstorage_meta.TTL) {
+                    _storage.__jstorage_meta.TTL = {};
+                }
+
+                // Set TTL value for the key
+                if (ttl > 0) {
+                    _storage.__jstorage_meta.TTL[key] = curtime + ttl;
+                } else {
+                    delete _storage.__jstorage_meta.TTL[key];
+                }
+
+                _save();
+
+                _handleTTL();
+
+                _publishChange();
+                return true;
+            }
+            return false;
+        },
+
+        /**
+         * Gets remaining TTL (in milliseconds) for a key or 0 when no TTL has been set
+         *
+         * @param {String} key Key to check
+         * @return {Number} Remaining TTL in milliseconds
+         */
+        getTTL: function(key) {
+            var curtime = +new Date(),
+                ttl;
+            _checkKey(key);
+            if (key in _storage && _storage.__jstorage_meta.TTL && _storage.__jstorage_meta.TTL[key]) {
+                ttl = _storage.__jstorage_meta.TTL[key] - curtime;
+                return ttl || 0;
+            }
+            return 0;
+        },
+
+        /**
+         * Deletes everything in cache.
+         *
+         * @return {Boolean} Always true
+         */
+        flush: function() {
+            _storage = {
+                __jstorage_meta: {
+                    CRC32: {}
+                }
+            };
+            _save();
+            _publishChange();
+            _fireObservers(null, 'flushed');
+            return true;
+        },
+
+        /**
+         * Returns a read-only copy of _storage
+         *
+         * @return {Object} Read-only copy of _storage
+         */
+        storageObj: function() {
+            function F() {}
+            F.prototype = _storage;
+            return new F();
+        },
+
+        /**
+         * Returns an index of all used keys as an array
+         * ['key1', 'key2',..'keyN']
+         *
+         * @return {Array} Used keys
+         */
+        index: function() {
+            var index = [],
+                i;
+            for (i in _storage) {
+                if (_storage.hasOwnProperty(i) && i != '__jstorage_meta') {
+                    index.push(i);
+                }
+            }
+            return index;
+        },
+
+        /**
+         * How much space in bytes does the storage take?
+         *
+         * @return {Number} Storage size in chars (not the same as in bytes,
+         *                  since some chars may take several bytes)
+         */
+        storageSize: function() {
+            return _storage_size;
+        },
+
+        /**
+         * Which backend is currently in use?
+         *
+         * @return {String} Backend name
+         */
+        currentBackend: function() {
+            return _backend;
+        },
+
+        /**
+         * Test if storage is available
+         *
+         * @return {Boolean} True if storage can be used
+         */
+        storageAvailable: function() {
+            return !!_backend;
+        },
+
+        /**
+         * Register change listeners
+         *
+         * @param {String} key Key name
+         * @param {Function} callback Function to run when the key changes
+         */
+        listenKeyChange: function(key, callback) {
+            _checkKey(key);
+            if (!_observers[key]) {
+                _observers[key] = [];
+            }
+            _observers[key].push(callback);
+        },
+
+        /**
+         * Remove change listeners
+         *
+         * @param {String} key Key name to unregister listeners against
+         * @param {Function} [callback] If set, unregister the callback, if not - unregister all
+         */
+        stopListening: function(key, callback) {
+            _checkKey(key);
+
+            if (!_observers[key]) {
+                return;
+            }
+
+            if (!callback) {
+                delete _observers[key];
+                return;
+            }
+
+            for (var i = _observers[key].length - 1; i >= 0; i--) {
+                if (_observers[key][i] == callback) {
+                    _observers[key].splice(i, 1);
+                }
+            }
+        },
+
+        /**
+         * Subscribe to a Publish/Subscribe event stream
+         *
+         * @param {String} channel Channel name
+         * @param {Function} callback Function to run when the something is published to the channel
+         */
+        subscribe: function(channel, callback) {
+            channel = (channel || '').toString();
+            if (!channel) {
+                throw new TypeError('Channel not defined');
+            }
+            if (!_pubsub_observers[channel]) {
+                _pubsub_observers[channel] = [];
+            }
+            _pubsub_observers[channel].push(callback);
+        },
+
+        /**
+         * Publish data to an event stream
+         *
+         * @param {String} channel Channel name
+         * @param {Mixed} payload Payload to deliver
+         */
+        publish: function(channel, payload) {
+            channel = (channel || '').toString();
+            if (!channel) {
+                throw new TypeError('Channel not defined');
+            }
+
+            _publish(channel, payload);
+        },
+
+        /**
+         * Reloads the data from browser storage
+         */
+        reInit: function() {
+            _reloadData();
+        },
+
+        /**
+         * Removes reference from global objects and saves it as jStorage
+         *
+         * @param {Boolean} option if needed to save object as simple 'jStorage' in windows context
+         */
+        noConflict: function(saveInGlobal) {
+            delete window.$.jStorage;
+
+            if (saveInGlobal) {
+                window.jStorage = this;
+            }
+
+            return this;
+        }
+    };
+
+    // Initialize jStorage
+    _init();
+
+})();
\ No newline at end of file
diff --git a/resources/lib/jquery.throttle-debounce/jquery.ba-throttle-debounce.js b/resources/lib/jquery.throttle-debounce/jquery.ba-throttle-debounce.js
new file mode 100644 (file)
index 0000000..fa30bdf
--- /dev/null
@@ -0,0 +1,252 @@
+/*!
+ * jQuery throttle / debounce - v1.1 - 3/7/2010
+ * http://benalman.com/projects/jquery-throttle-debounce-plugin/
+ * 
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+
+// Script: jQuery throttle / debounce: Sometimes, less is more!
+//
+// *Version: 1.1, Last updated: 3/7/2010*
+// 
+// Project Home - http://benalman.com/projects/jquery-throttle-debounce-plugin/
+// GitHub       - http://github.com/cowboy/jquery-throttle-debounce/
+// Source       - http://github.com/cowboy/jquery-throttle-debounce/raw/master/jquery.ba-throttle-debounce.js
+// (Minified)   - http://github.com/cowboy/jquery-throttle-debounce/raw/master/jquery.ba-throttle-debounce.min.js (0.7kb)
+// 
+// About: License
+// 
+// Copyright (c) 2010 "Cowboy" Ben Alman,
+// Dual licensed under the MIT and GPL licenses.
+// http://benalman.com/about/license/
+// 
+// About: Examples
+// 
+// These working examples, complete with fully commented code, illustrate a few
+// ways in which this plugin can be used.
+// 
+// Throttle - http://benalman.com/code/projects/jquery-throttle-debounce/examples/throttle/
+// Debounce - http://benalman.com/code/projects/jquery-throttle-debounce/examples/debounce/
+// 
+// About: Support and Testing
+// 
+// Information about what version or versions of jQuery this plugin has been
+// tested with, what browsers it has been tested in, and where the unit tests
+// reside (so you can test it yourself).
+// 
+// jQuery Versions - none, 1.3.2, 1.4.2
+// Browsers Tested - Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome 4-5, Opera 9.6-10.1.
+// Unit Tests      - http://benalman.com/code/projects/jquery-throttle-debounce/unit/
+// 
+// About: Release History
+// 
+// 1.1 - (3/7/2010) Fixed a bug in <jQuery.throttle> where trailing callbacks
+//       executed later than they should. Reworked a fair amount of internal
+//       logic as well.
+// 1.0 - (3/6/2010) Initial release as a stand-alone project. Migrated over
+//       from jquery-misc repo v0.4 to jquery-throttle repo v1.0, added the
+//       no_trailing throttle parameter and debounce functionality.
+// 
+// Topic: Note for non-jQuery users
+// 
+// jQuery isn't actually required for this plugin, because nothing internal
+// uses any jQuery methods or properties. jQuery is just used as a namespace
+// under which these methods can exist.
+// 
+// Since jQuery isn't actually required for this plugin, if jQuery doesn't exist
+// when this plugin is loaded, the method described below will be created in
+// the `Cowboy` namespace. Usage will be exactly the same, but instead of
+// $.method() or jQuery.method(), you'll need to use Cowboy.method().
+
+(function(window,undefined){
+  '$:nomunge'; // Used by YUI compressor.
+  
+  // Since jQuery really isn't required for this plugin, use `jQuery` as the
+  // namespace only if it already exists, otherwise use the `Cowboy` namespace,
+  // creating it if necessary.
+  var $ = window.jQuery || window.Cowboy || ( window.Cowboy = {} ),
+    
+    // Internal method reference.
+    jq_throttle;
+  
+  // Method: jQuery.throttle
+  // 
+  // Throttle execution of a function. Especially useful for rate limiting
+  // execution of handlers on events like resize and scroll. If you want to
+  // rate-limit execution of a function to a single time, see the
+  // <jQuery.debounce> method.
+  // 
+  // In this visualization, | is a throttled-function call and X is the actual
+  // callback execution:
+  // 
+  // > Throttled with `no_trailing` specified as false or unspecified:
+  // > ||||||||||||||||||||||||| (pause) |||||||||||||||||||||||||
+  // > X    X    X    X    X    X        X    X    X    X    X    X
+  // > 
+  // > Throttled with `no_trailing` specified as true:
+  // > ||||||||||||||||||||||||| (pause) |||||||||||||||||||||||||
+  // > X    X    X    X    X             X    X    X    X    X
+  // 
+  // Usage:
+  // 
+  // > var throttled = jQuery.throttle( delay, [ no_trailing, ] callback );
+  // > 
+  // > jQuery('selector').bind( 'someevent', throttled );
+  // > jQuery('selector').unbind( 'someevent', throttled );
+  // 
+  // This also works in jQuery 1.4+:
+  // 
+  // > jQuery('selector').bind( 'someevent', jQuery.throttle( delay, [ no_trailing, ] callback ) );
+  // > jQuery('selector').unbind( 'someevent', callback );
+  // 
+  // Arguments:
+  // 
+  //  delay - (Number) A zero-or-greater delay in milliseconds. For event
+  //    callbacks, values around 100 or 250 (or even higher) are most useful.
+  //  no_trailing - (Boolean) Optional, defaults to false. If no_trailing is
+  //    true, callback will only execute every `delay` milliseconds while the
+  //    throttled-function is being called. If no_trailing is false or
+  //    unspecified, callback will be executed one final time after the last
+  //    throttled-function call. (After the throttled-function has not been
+  //    called for `delay` milliseconds, the internal counter is reset)
+  //  callback - (Function) A function to be executed after delay milliseconds.
+  //    The `this` context and all arguments are passed through, as-is, to
+  //    `callback` when the throttled-function is executed.
+  // 
+  // Returns:
+  // 
+  //  (Function) A new, throttled, function.
+  
+  $.throttle = jq_throttle = function( delay, no_trailing, callback, debounce_mode ) {
+    // After wrapper has stopped being called, this timeout ensures that
+    // `callback` is executed at the proper times in `throttle` and `end`
+    // debounce modes.
+    var timeout_id,
+      
+      // Keep track of the last time `callback` was executed.
+      last_exec = 0;
+    
+    // `no_trailing` defaults to falsy.
+    if ( typeof no_trailing !== 'boolean' ) {
+      debounce_mode = callback;
+      callback = no_trailing;
+      no_trailing = undefined;
+    }
+    
+    // The `wrapper` function encapsulates all of the throttling / debouncing
+    // functionality and when executed will limit the rate at which `callback`
+    // is executed.
+    function wrapper() {
+      var that = this,
+        elapsed = +new Date() - last_exec,
+        args = arguments;
+      
+      // Execute `callback` and update the `last_exec` timestamp.
+      function exec() {
+        last_exec = +new Date();
+        callback.apply( that, args );
+      };
+      
+      // If `debounce_mode` is true (at_begin) this is used to clear the flag
+      // to allow future `callback` executions.
+      function clear() {
+        timeout_id = undefined;
+      };
+      
+      if ( debounce_mode && !timeout_id ) {
+        // Since `wrapper` is being called for the first time and
+        // `debounce_mode` is true (at_begin), execute `callback`.
+        exec();
+      }
+      
+      // Clear any existing timeout.
+      timeout_id && clearTimeout( timeout_id );
+      
+      if ( debounce_mode === undefined && elapsed > delay ) {
+        // In throttle mode, if `delay` time has been exceeded, execute
+        // `callback`.
+        exec();
+        
+      } else if ( no_trailing !== true ) {
+        // In trailing throttle mode, since `delay` time has not been
+        // exceeded, schedule `callback` to execute `delay` ms after most
+        // recent execution.
+        // 
+        // If `debounce_mode` is true (at_begin), schedule `clear` to execute
+        // after `delay` ms.
+        // 
+        // If `debounce_mode` is false (at end), schedule `callback` to
+        // execute after `delay` ms.
+        timeout_id = setTimeout( debounce_mode ? clear : exec, debounce_mode === undefined ? delay - elapsed : delay );
+      }
+    };
+    
+    // Set the guid of `wrapper` function to the same of original callback, so
+    // it can be removed in jQuery 1.4+ .unbind or .die by using the original
+    // callback as a reference.
+    if ( $.guid ) {
+      wrapper.guid = callback.guid = callback.guid || $.guid++;
+    }
+    
+    // Return the wrapper function.
+    return wrapper;
+  };
+  
+  // Method: jQuery.debounce
+  // 
+  // Debounce execution of a function. Debouncing, unlike throttling,
+  // guarantees that a function is only executed a single time, either at the
+  // very beginning of a series of calls, or at the very end. If you want to
+  // simply rate-limit execution of a function, see the <jQuery.throttle>
+  // method.
+  // 
+  // In this visualization, | is a debounced-function call and X is the actual
+  // callback execution:
+  // 
+  // > Debounced with `at_begin` specified as false or unspecified:
+  // > ||||||||||||||||||||||||| (pause) |||||||||||||||||||||||||
+  // >                          X                                 X
+  // > 
+  // > Debounced with `at_begin` specified as true:
+  // > ||||||||||||||||||||||||| (pause) |||||||||||||||||||||||||
+  // > X                                 X
+  // 
+  // Usage:
+  // 
+  // > var debounced = jQuery.debounce( delay, [ at_begin, ] callback );
+  // > 
+  // > jQuery('selector').bind( 'someevent', debounced );
+  // > jQuery('selector').unbind( 'someevent', debounced );
+  // 
+  // This also works in jQuery 1.4+:
+  // 
+  // > jQuery('selector').bind( 'someevent', jQuery.debounce( delay, [ at_begin, ] callback ) );
+  // > jQuery('selector').unbind( 'someevent', callback );
+  // 
+  // Arguments:
+  // 
+  //  delay - (Number) A zero-or-greater delay in milliseconds. For event
+  //    callbacks, values around 100 or 250 (or even higher) are most useful.
+  //  at_begin - (Boolean) Optional, defaults to false. If at_begin is false or
+  //    unspecified, callback will only be executed `delay` milliseconds after
+  //    the last debounced-function call. If at_begin is true, callback will be
+  //    executed only at the first debounced-function call. (After the
+  //    throttled-function has not been called for `delay` milliseconds, the
+  //    internal counter is reset)
+  //  callback - (Function) A function to be executed after delay milliseconds.
+  //    The `this` context and all arguments are passed through, as-is, to
+  //    `callback` when the debounced-function is executed.
+  // 
+  // Returns:
+  // 
+  //  (Function) A new, debounced, function.
+  
+  $.debounce = function( delay, at_begin, callback ) {
+    return callback === undefined
+      ? jq_throttle( delay, at_begin, false )
+      : jq_throttle( delay, callback, at_begin !== false );
+  };
+  
+})(this);
index c32844c..3ca6632 100644 (file)
@@ -6,7 +6,7 @@
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2019-03-14T00:52:20Z
+ * Date: 2019-03-20T23:07:02Z
  */
 ( function ( OO ) {
 
@@ -7470,6 +7470,7 @@ OO.ui.MenuSectionOptionWidget = function OoUiMenuSectionOptionWidget( config ) {
        this.$element
                .addClass( 'oo-ui-menuSectionOptionWidget' )
                .removeAttr( 'role aria-selected' );
+       this.selected = false;
 };
 
 /* Setup */
index b73f430..c1b83fd 100644 (file)
                                        $table = $( table ),
                                        firstTime = true;
 
+                               // Don't construct twice on the same table
+                               if ( $.data( table, 'tablesorter' ) ) {
+                                       return;
+                               }
                                // Quit if no tbody
                                if ( !table.tBodies ) {
                                        return;
index c7eae2c..1cccb88 100644 (file)
@@ -5,17 +5,10 @@
 
 @import 'mediawiki.mixins';
 
-.TablePager {
+// TablePager uses `.mw-datatable` and is loaded in the right order by RL
+.mw-datatable {
        min-width: 80%;
 
-       // Remove as soon as `.mw-datatable` receives this `padding`, see T214208
-       td,
-       th {
-               padding: 0.2em 0.4em;
-       }
-}
-
-.mw-datatable {
        &-is-sorted a {
                background-position: left center;
                background-repeat: no-repeat;
diff --git a/resources/src/mediawiki.rollback.confirmation.js b/resources/src/mediawiki.rollback.confirmation.js
new file mode 100644 (file)
index 0000000..55d78d5
--- /dev/null
@@ -0,0 +1,14 @@
+/*!
+ * JavaScript for rollback confirmation prompt
+ */
+$( function () {
+       $( '.mw-rollback-link a' ).each( function () {
+               $( this ).confirmable( {
+                       i18n: {
+                               confirm: mw.msg( 'rollback-confirmation-confirm', $( this ).data( 'rollback-count' ) ),
+                               yes: mw.msg( 'rollback-confirmation-yes' ),
+                               no: mw.msg( 'rollback-confirmation-no' )
+                       }
+               } );
+       } );
+} );
index ffc1818..b53b58f 100644 (file)
@@ -19,6 +19,7 @@
         * @mixins OO.ui.mixin.IconElement
         * @mixins OO.ui.mixin.IndicatorElement
         * @mixins OO.ui.mixin.PendingElement
+        * @mixins OO.ui.mixin.FlaggedElement
         *
         * @constructor
         * @param {Object} [config] Configuration options
@@ -70,6 +71,7 @@
                OO.ui.mixin.IconElement.call( this, config );
                OO.ui.mixin.IndicatorElement.call( this, config );
                OO.ui.mixin.PendingElement.call( this, config );
+               OO.ui.mixin.FlaggedElement.call( this, config );
 
                // Properties
                this.$handle = $( '<span>' );
        OO.mixinClass( mw.widgets.datetime.DateTimeInputWidget, OO.ui.mixin.IconElement );
        OO.mixinClass( mw.widgets.datetime.DateTimeInputWidget, OO.ui.mixin.IndicatorElement );
        OO.mixinClass( mw.widgets.datetime.DateTimeInputWidget, OO.ui.mixin.PendingElement );
+       OO.mixinClass( mw.widgets.datetime.DateTimeInputWidget, OO.ui.mixin.FlaggedElement );
 
        /* Static properties */
 
index 680b8c3..861111a 100644 (file)
@@ -180,6 +180,7 @@ $wgAutoloadClasses += [
        'GenericArrayObjectTest' => "$testDir/phpunit/includes/libs/GenericArrayObjectTest.php",
 
        # tests/phpunit/maintenance
+       'MediaWiki\Tests\Maintenance\DumpAsserter' => "$testDir/phpunit/maintenance/DumpAsserter.php",
        'MediaWiki\Tests\Maintenance\DumpTestCase' => "$testDir/phpunit/maintenance/DumpTestCase.php",
        'MediaWiki\Tests\Maintenance\MaintenanceBaseTestCase' => "$testDir/phpunit/maintenance/MaintenanceBaseTestCase.php",
 
index 7ef057a..ee33f1d 100644 (file)
@@ -431,7 +431,6 @@ b
 b
 </p>
 <hr />
-
 !! end
 
 !! test
@@ -458,7 +457,6 @@ b
 b
 </p>
 <hr />
-
 !! end
 
 !! test
@@ -505,7 +503,6 @@ b
 b
 </p>
 <hr />
-
 !! end
 
 !! test
@@ -543,7 +540,6 @@ a
 </p><p><br />
 </p>
 <h1><span class="mw-headline" id="b_2">b</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: b">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
-
 !! end
 
 !! test
@@ -643,7 +639,6 @@ C</nowiki>==
 <h2><span id="A_B.0AC"></span><span class="mw-headline" id="A_B
 C">A B
 C</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 B&#10;C">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <h2 id="A_B
 C"><span id="A_B.0AC" typeof="mw:FallbackId"></span>A <span typeof="mw:Nowiki">B
@@ -668,7 +663,6 @@ Simple list
 !! html
 <ul><li>Item 1</li>
 <li>Item 2</li></ul>
-
 !! end
 
 !! test
@@ -705,7 +699,6 @@ Italics and bold
 <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
 
 # this example taken from the [[simple:Moon]] article (T49326)
@@ -1461,7 +1454,6 @@ Non-word characters are valid in extension tags (T19663)
 array (
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tåg" data-mw='{"name":"tåg","attrs":{},"body":{"extsrc":"tåg"}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -1575,7 +1567,6 @@ nowiki 3
 <li>There is nowiki.</li></ol>
 <ul><li>There is not nowiki.</li>
 <li>There is nowiki.</li></ul>
-
 !! html/parsoid
 <dl><dd data-parsoid='{}'>There is not nowiki.</dd>
 <dd data-parsoid='{}'>There is <span typeof="mw:Nowiki">nowiki</span>.</dd></dl>
@@ -1808,7 +1799,6 @@ Comment whitespace
 !! wikitext
 <!-- returns a single newline, not nothing, since the newline after > is not stripped -->
 !! html
-
 !! end
 
 !! test
@@ -1816,7 +1806,6 @@ Comment semantics and delimiters
 !! wikitext
 <!-- --><!----><!-----><!------>
 !! html/php
-
 !! html/parsoid
 <!-- --><!----><!--&#x2D;--><!--&#x2D;&#x2D;-->
 !! end
@@ -1827,7 +1816,6 @@ Comment semantics and delimiters, redux
 <!-- In SGML every "foo" here would actually show up in the text -- foo -- bar
 -- foo -- funky huh? ... -->
 !! html/php
-
 !! html/parsoid
 <!-- In SGML every "foo" here would actually show up in the text &#x2D;&#x2D; foo &#x2D;&#x2D; bar
 &#x2D;&#x2D; foo &#x2D;&#x2D; funky huh? ... -->
@@ -1870,7 +1858,6 @@ parsoid=wt2html,html2html
 !! wikitext
 <!--This comment will run out to the end of the document
 !! html/php
-
 !! html/parsoid
 <!--This comment will run out to the end of the document-->
 !! end
@@ -1980,7 +1967,6 @@ parsoid=wt2html,wt2wt
 !! html/php
 <ul><li>a</li>
 <li>b</li></ul>
-
 !! html/parsoid
 <!--c1--><ul>
 <li>a
@@ -2086,7 +2072,6 @@ b <div>foo</div>
 !! html
 a <div>foo</div>
 b <div>foo</div>
-
 !! html+tidy
 <p>a </p><div>foo</div><p>
 b </p><div>foo</div>
@@ -2101,7 +2086,6 @@ b <blockquote>foo</blockquote>
 !! html
 a <blockquote>foo</blockquote>
 b <blockquote>foo</blockquote>
-
 !! html+tidy
 <p>a </p><blockquote><p>foo</p></blockquote><p>
 b </p><blockquote><p>foo</p></blockquote>
 d e
 </p>
 x <div>foo</div> z
-
 !! html+tidy
 <div>foo</div><p> a
 </p><p>b
 c
 d e
 </p><p>
-x </p><div>foo</div><p> z
-</p>
+x </p><div>foo</div><p> z</p>
 !! end
 
 !! test
@@ -2160,7 +2142,6 @@ b
 <p><br />
 </p>
 <div>e</div>
-
 !! html+tidy
 <div></div>
 <p><br />
@@ -2243,7 +2224,6 @@ No paragraph necessary for SOL transparent template
 !! html/php
 <span><div>foo</div></span>
 <span><div>foo</div></span>
-
 !! html/parsoid
 <span data-parsoid='{"stx":"html"}'><div data-parsoid='{"stx":"html"}'>foo</div></span>
 <link rel="mw:PageProp/Category" href="./Category:Foo"/>
@@ -2458,7 +2438,6 @@ Ident preformatting with inline content
 &lt;cite&gt;
 &lt;em&gt;
 </pre>
-
 !! end
 
 !! test
@@ -2472,7 +2451,6 @@ Regression with preformatted in <center>
 <pre>Blah
 </pre>
 </center>
-
 !! end
 
 !! test
@@ -2496,7 +2474,6 @@ T54763: Preformatted in <blockquote>
 </p>
 </td></tr></table>
 </blockquote>
-
 !! end
 
 !! test
@@ -2513,7 +2490,6 @@ Bar
 </p><p>Bar
 </p>
 </blockquote>
-
 !! end
 
 !! test
@@ -2527,7 +2503,6 @@ Foo <del>bar</del> <ins>baz</ins> quux
 <p>Foo <del>bar</del> <ins>baz</ins> quux
 </p>
 </blockquote>
-
 !! html+tidy
 <blockquote>
 <p>Foo <del>bar</del> <ins>baz</ins> quux
@@ -2543,7 +2518,6 @@ T17491: <ins>/<del> in blockquote (2)
 !! html
 <blockquote>Foo <del>bar</del> <ins>baz</ins> quux
 </blockquote>
-
 !! html+tidy
 <blockquote><p>Foo <del>bar</del> <ins>baz</ins> quux
 </p></blockquote>
@@ -2555,7 +2529,6 @@ T17491: <ins>/<del> in blockquote (2)
 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
 !! html
 <pre style="background: blue; color:white">Bluescreen of WikiDeath</pre>
-
 !! end
 
 !! test
@@ -2564,7 +2537,6 @@ T17491: <ins>/<del> in blockquote (2)
 <pre width="8">Narrow screen goodies</pre>
 !! html
 <pre width="8">Narrow screen goodies</pre>
-
 !! end
 
 !! test
@@ -2573,7 +2545,6 @@ T17491: <ins>/<del> in blockquote (2)
 <pre width="8" onmouseover="alert(document.cookie)">Narrow screen goodies</pre>
 !! html
 <pre width="8">Narrow screen goodies</pre>
-
 !! end
 
 !! test
@@ -2582,7 +2553,6 @@ Entities inside <pre>
 <pre>&lt;</pre>
 !! html
 <pre>&lt;</pre>
-
 !! end
 
 !! test
@@ -2591,7 +2561,6 @@ Entities inside <pre>
 <pre width="8" style="border-width: expression(alert(document.cookie))">Narrow screen goodies</pre>
 !! html
 <pre width="8" style="/* insecure input */">Narrow screen goodies</pre>
-
 !! end
 
 !! test
@@ -2612,7 +2581,6 @@ Entities inside <pre>
 
 </pre>
 <pre>&lt;nowiki&gt;Foo&lt;/nowiki&gt;</pre>
-
 !! end
 
 !! test
@@ -2621,7 +2589,6 @@ Entities inside <pre>
 {{#tag:pre|Foo <nowiki>&rarr;bar</nowiki>}}
 !! html/php
 <pre>Foo &#8594;bar</pre>
-
 !! html/parsoid
 <pre about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"#tag:pre","function":"tag"},"params":{"1":{"wt":"Foo &lt;nowiki>&amp;rarr;bar&lt;/nowiki>"}},"i":0}}]}'>Foo <span typeof="mw:Entity">→</span>bar</pre>
 !! end
@@ -2730,8 +2697,7 @@ Templates: Indent-Pre: 1a. Templates that break a line should suppress <pre>
 !! wikitext
  {{echo|}}
 !! html
-
-!!end
+!! end
 
 !!test
 Templates: Indent-Pre: 1b. Templates that break a line should suppress <pre>
@@ -2854,7 +2820,6 @@ parsoid=wt2html,html2html
 two">hi</pre>
 !! html/php
 <pre class="one two">hi</pre>
-
 !! html/parsoid
 <pre class="one two" typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{"class":"one two"},"body":{"extsrc":"hi"}}'>hi</pre>
 !! end
@@ -2886,7 +2851,6 @@ parsoid=wt2html
 !! html/php
 <pre>x</pre>
 <table>&lt;pre </table>
-
 !! html/php+tidy
 <pre>x</pre>
 &lt;pre <table></table>
@@ -2920,7 +2884,6 @@ parsoid=wt2html
 <pre style="width:50%;" >{{echo|foo}}</pre>
 !! html/php
 <pre style="width:50%;">{{echo|foo}}</pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/pre" about="#mwt2" style="width:50%;" data-mw='{"name":"pre","attrs":{"style":"width:50%;"},"body":{"extsrc":"{{echo|foo}}"}}'>{{echo|foo}}</pre>
 !! end
@@ -2931,7 +2894,6 @@ Self-closed pre
 <pre />
 !! html/php
 <pre></pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{}}'></pre>
 !! end
@@ -3014,7 +2976,6 @@ Templates: Strip leading and trailing whitespace from named-param values
 </p><p>c
 </p>
 <ul><li>d</li></ul>
-
 !! end
 
 !! test
@@ -3408,7 +3369,6 @@ c
 <td>foo</td>
 <td>bar
 </td></tr></table>
-
 !!end
 
 !!test
@@ -3424,7 +3384,6 @@ c
 <tr>
 <td>foo
 </td></tr></table>
-
 !!end
 
 !!test
@@ -3441,7 +3400,6 @@ c
 <tr>
 <th>bar
 </th></tr></table>
-
 !!end
 
 !!test
@@ -3458,7 +3416,6 @@ c
 <tr>
 <td>b
 </td></tr></table>
-
 !! html/parsoid
 <pre>a</pre>
  <table>
@@ -3517,7 +3474,6 @@ a
  </td>
  </tr>
  </table>
-
 !! end
 
 !! test
@@ -3556,7 +3512,6 @@ parsoid=wt2html,html2html
 <pre>bam
 </pre>
 </td></tr></table>
-
 !! html/parsoid
 <table>
  <tbody><tr><th>
@@ -3606,7 +3561,6 @@ parsoid=wt2html,html2html
 <pre>a <span>foo</span>
 </pre>
  b <div> foo </div>
-
 !! html/parsoid
 <pre>a <span data-parsoid='{"stx":"html"}'>foo</span></pre>
 <!-- comment --> <p>b </p><div data-parsoid='{"stx":"html"}'> foo </div>
@@ -3730,7 +3684,6 @@ array (
  <pre class="123">hi</pre>
 !! html/php
  <pre class="123">hi</pre>
-
 !! html/parsoid
  <pre class="123" typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{"class":"123"},"body":{"extsrc":"hi"}}'>hi</pre>
 !! end
@@ -3749,7 +3702,6 @@ Render paragraphs when indent-pre is suppressed in blocklevels
 </p><p> bar
 </p>
 </blockquote>
-
 !!end
 
 !!test
@@ -3768,7 +3720,6 @@ Render paragraphs when indent-pre is suppressed in blocklevels
 <tr>
 <td>foo
 </td></tr></table>
-
 !!end
 
 ## NOTE: the leading white-space chars on empty line are significant
@@ -4004,7 +3955,6 @@ HTML-pre: 2: indented text
 <pre>
  foo
 </pre>
-
 !!end
 
 !!test
@@ -4025,7 +3975,6 @@ HTML-pre: 3: other wikitext
 '' no-italic ''
 [[ NoLink ]]
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\n* foo\n# bar\n= no-h =\n&#39;&#39; no-italic &#39;&#39;\n[[ NoLink ]]\n"}}'>* foo
 # bar
@@ -4045,7 +3994,6 @@ Simple definition
 !! html
 <dl><dt>name</dt>
 <dd>Definition</dd></dl>
-
 !! end
 
 !! test
@@ -4054,7 +4002,6 @@ Definition list for indentation only
 :Indented text
 !! html
 <dl><dd>Indented text</dd></dl>
-
 !! end
 
 !! test
@@ -4064,7 +4011,6 @@ Definition list with no space
 !! html
 <dl><dt>name</dt>
 <dd>Definition</dd></dl>
-
 !!end
 
 !! test
@@ -4074,7 +4020,6 @@ Definition list with URL link
 !! html
 <dl><dt><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a></dt>
 <dd>definition</dd></dl>
-
 !! end
 
 !! test
@@ -4084,7 +4029,6 @@ Definition list with bracketed URL link
 !! html
 <dl><dt><a rel="nofollow" class="external text" href="http://www.example.com/">Example</a></dt>
 <dd>Something about it</dd></dl>
-
 !! end
 
 !! test
@@ -4094,7 +4038,6 @@ Definition list with wikilink containing colon
 !! 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>
-
 !! end
 
 # At Brion's and JeLuF's insistence... :)
@@ -4105,7 +4048,6 @@ Definition list with news link containing colon
 !! 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>
-
 !! 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>
 !! end
@@ -4116,7 +4058,6 @@ Malformed definition list with colon
 ;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>
-
 !! end
 
 !! test
@@ -4126,7 +4067,6 @@ Definition lists: colon in external link text
 !! html
 <dl><dt><a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia :The Next Generation</a></dt>
 <dd>OK, I made that up</dd></dl>
-
 !! end
 
 !! test
@@ -4135,7 +4075,6 @@ Definition lists: colon in HTML attribute
 ;<b style="display: inline">bold</b>
 !! html
 <dl><dt><b style="display: inline">bold</b></dt></dl>
-
 !! end
 
 !! test
@@ -4145,7 +4084,6 @@ Definition lists: self-closed tag
 !! html
 <dl><dt>one<br />two</dt>
 <dd>two-line fun</dd></dl>
-
 !! end
 
 !! test
@@ -4155,7 +4093,6 @@ Definition lists: ignore colons inside tags
 !! html
 <dl><dt>one <b>two&#160;: tag <i>fun:</i>:</b></dt>
 <dd>def</dd></dl>
-
 !! end
 
 !! test
@@ -4188,7 +4125,6 @@ T13748: Literal closing tags
 <dt>test 2</dt>
 <dd>test test test test test</dd>
 </dl>
-
 !! end
 
 !! test
@@ -4204,7 +4140,6 @@ Definition and unordered list using wiki syntax nested in unordered list using h
 <dd>description</dd></dl>
 <ul><li>unordered</li></ul>
 </li></ul>
-
 !! end
 
 !! test
@@ -4230,7 +4165,6 @@ Nested definition lists using html syntax
 <dl><dt>x</dt>
 <dd>a</dd>
 <dd>b</dd></dl>
-
 !! end
 
 !! test
@@ -4243,7 +4177,6 @@ Definition Lists: No nesting: Multiple dd's
 <dl><dt>x</dt>
 <dd>a</dd>
 <dd>b</dd></dl>
-
 !! end
 
 !! test
@@ -4256,7 +4189,6 @@ Definition Lists: Indentation: Regular
 <dl><dd>i1
 <dl><dd>i2
 <dl><dd>i3</dd></dl></dd></dl></dd></dl>
-
 !! end
 
 !! test
@@ -4267,7 +4199,6 @@ Definition Lists: Indentation: Missing 1st level
 !! html
 <dl><dd><dl><dd>i2
 <dl><dd>i3</dd></dl></dd></dl></dd></dl>
-
 !! end
 
 !! test
@@ -4276,7 +4207,6 @@ Definition Lists: Indentation: Multi-level indent
 :::i3
 !! html
 <dl><dd><dl><dd><dl><dd>i3</dd></dl></dd></dl></dd></dl>
-
 !! end
 
 !! test
@@ -4370,7 +4300,6 @@ Definition Lists: Hacky use to indent tables (WS-insensitive)
 <tr>
 <td>a
 </td></tr></table></dd></dl>
-
 !! html/parsoid
 <dl><dd><table>
 <tbody><tr><td>a</td></tr>
@@ -4436,7 +4365,6 @@ Table / list interaction: indented table with lists in table contents
 <td>c
 <ul><li>d</li></ul>
 </td></tr></table></dd></dl>
-
 !! end
 
 !!test
@@ -4466,7 +4394,6 @@ Table / list interaction: lists nested in tables nested in indented lists
 </td></tr></table></dd></dl>
 <ul><li>e</li>
 <li>f</li></ul>
-
 !!end
 
 !! test
@@ -4492,8 +4419,6 @@ Definition Lists: Nesting: Multi-level (Parsoid only)
     </dl>
   </dt>
 </dl>
-
-
 !! end
 
 
@@ -4529,7 +4454,6 @@ Definition Lists: Nesting: Test 4
 !! html
 <dl><dd><dl><dd><dl><dt>t3</dt>
 <dd>d3</dd></dl></dd></dl></dd></dl>
-
 !! end
 
 
@@ -4549,7 +4473,6 @@ Definition Lists: Mixed Lists: Test 1
 <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>
@@ -4578,7 +4501,6 @@ Definition Lists: Mixed Lists: Test 2
 !! html
 <ul><li><dl><dd>d1</dd>
 <dd>d2</dd></dl></li></ul>
-
 !! end
 
 
@@ -4590,7 +4512,6 @@ Definition Lists: Mixed Lists: Test 3
 !! html
 <ul><li><dl><dd><dl><dd><dl><dd>d1</dd>
 <dd>d2</dd></dl></dd></dl></dd></dl></li></ul>
-
 !! end
 
 
@@ -4604,7 +4525,6 @@ Definition Lists: Mixed Lists: Test 4
 <dd>d2</dd>
 <dt>d3</dt>
 <dd>d4</dd></dl></li></ul>
-
 !! end
 
 
@@ -4616,7 +4536,6 @@ Definition Lists: Mixed Lists: Test 5
 !! html
 <ul><li><dl><dd>d1
 <dl><dd>d2</dd></dl></dd></dl></li></ul>
-
 !! end
 
 
@@ -4628,7 +4547,6 @@ Definition Lists: Mixed Lists: Test 6
 !! html
 <ol><li><ul><li><dl><dd>d1
 <dl><dd><dl><dd>d3</dd></dl></dd></dl></dd></dl></li></ul></li></ol>
-
 !! end
 
 
@@ -4640,7 +4558,6 @@ Definition Lists: Mixed Lists: Test 7
 !! html
 <dl><dd><ul><li>d1</li>
 <li>d2</li></ul></dd></dl>
-
 !! end
 
 
@@ -4652,7 +4569,6 @@ Definition Lists: Mixed Lists: Test 8
 !! html
 <dl><dd><ul><li>d1</li></ul>
 <dl><dd><ul><li>d2</li></ul></dd></dl></dd></dl>
-
 !! end
 
 
@@ -4663,7 +4579,6 @@ Definition Lists: Mixed Lists: Test 9
 !! html
 <ul><li><dl><dt>foo</dt>
 <dd>bar</dd></dl></li></ul>
-
 !! end
 
 
@@ -4674,7 +4589,6 @@ Definition Lists: Mixed Lists: Test 10
 !! html
 <ul><li><ol><li><dl><dt>foo</dt>
 <dd>bar</dd></dl></li></ol></li></ul>
-
 !! end
 
 # The Parsoid team disagrees with the PHP parser's seemingly-random
@@ -4692,7 +4606,6 @@ Definition Lists: Mixed Lists: Test 11
 <dl><dt>a</dt>
 <dd>
 <ul><li>b</li></ul></dd></dl>
-
 !! html/parsoid
 <dl><dt>a
 <dd><ul><li>b</li></ul></dd></dl>
@@ -4709,7 +4622,6 @@ Definition Lists: Mixed Lists: Test 12
 <dd><ul><li><dl><dt><dl><dt>bar</dt></dl></dd></dl></li></ul></dd></dl>
 <dl><dt>boo</dt>
 <dd>baz</dd></dl></li></ol></li></ul></li></ol></li></ul>
-
 !! html/php+tidy
 <ul><li><ol><li><ul><li><ol><li><dl><dt>foo</dt>
 <dd><ul><li><dl><dt><dl><dt>bar</dt></dl></dt></dl></li></ul></dd></dl></li></ol></li></ul>
@@ -4856,7 +4768,6 @@ Definition Lists: colons and tables 1
 <tr>
 <td>y
 </td></tr></table></dd></dl>
-
 !! html/parsoid
 <dl><dd><table>
 <tr>
@@ -5961,7 +5872,6 @@ Examples from RFC 2732, section 2:
 <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>
 
@@ -6025,7 +5935,6 @@ Examples from RFC 2732, section 2:
 <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>
 
@@ -6318,10 +6227,8 @@ parsoid=wt2html
 !! wikitext
 {||}
 !! html/php
-
 !! html/parsoid
 <table></table>
-
 !! end
 
 !! test
@@ -6377,7 +6284,6 @@ parsoid=wt2html
 <td>foo</td>
 </tr></tbody>
 </table>
-
 !! end
 
 !! test
@@ -6402,7 +6308,6 @@ A table with nothing but a caption
 <table>
 <caption>caption
 </caption><tr><td></td></tr></table>
-
 !! html/parsoid
 <table><caption>caption</caption></table>
 !! end
@@ -6422,7 +6327,6 @@ A table with caption with default-spaced attributes and a table row
 <tr>
 <td>foo
 </td></tr></table>
-
 !! end
 
 !! test
@@ -6443,7 +6347,6 @@ A table with captions with non-default spaced attributes and a table row
 <tr>
 <td>foo
 </td></tr></table>
-
 !! end
 
 !! test
@@ -6468,7 +6371,6 @@ Table td-cell syntax variations
 <td>style='color:red;'</td>
 <td>baz
 </td></tr></table>
-
 !! end
 
 !! test
@@ -6489,7 +6391,6 @@ Simple table
 <td>3</td>
 <td>4
 </td></tr></table>
-
 !! end
 
 !! test
@@ -6508,7 +6409,6 @@ Simple table but with multiple dashes for row wikitext
 <tr>
 <td>bar
 </td></tr></table>
-
 !! end
 
 !! test
@@ -6579,7 +6479,6 @@ Multiplication table
 <td>10</td>
 <td>15
 </td></tr></table>
-
 !! end
 
 !! test
@@ -6594,7 +6493,6 @@ Accept "||" in table headings
 <th>h1</th>
 <th>h2
 </th></tr></table>
-
 !! end
 
 !! test
@@ -6609,7 +6507,6 @@ Accept "!!" in table data
 <td>Foo!!</td>
 <td>
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td data-parsoid='{"autoInsertedEnd":true}'> Foo!! </td><td data-parsoid='{"stx":"row","autoInsertedEnd":true}'></td></tr>
@@ -6628,7 +6525,6 @@ Accept "||" in indented table headings
 <th>h1</th>
 <th>h2
 </th></tr></table></dd></dl>
-
 !! end
 
 !! test
@@ -6643,7 +6539,6 @@ Accept "!!" in templates
 <th>a b</th>
 <th>c
 </th></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr><th typeof="mw:Transclusion" about="#mwt1" data-parsoid='{"autoInsertedEnd":true,"pi":[[{"k":"1"}]]}' data-mw='{"parts":["!a ",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b!!c"}},"i":0}}]}'>a b</th><th about="#mwt1">c</th></tr>
@@ -6663,7 +6558,6 @@ b!!c
 <p>b!!c
 </p>
 </th></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr><th>a
@@ -6705,7 +6599,6 @@ Accept empty attributes in td/th cells (td/th cells starting with leading ||)
 </th>
 <td>a
 </td></tr></table>
-
 !! end
 
 !!test
@@ -6721,7 +6614,6 @@ Accept "| !" at start of line in tables (ignore !-attribute)
 <tr>
 <td>bar
 </td></tr></table>
-
 !!end
 
 !!test
@@ -6760,7 +6652,6 @@ Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present
 </td>
 <td>-1
 </td></tr></table>
-
 !!end
 
 !! test
@@ -6788,7 +6679,6 @@ Table rowspan
 </td>
 <td>Cell 3, row 2
 </td></tr></table>
-
 !! end
 
 !! test
@@ -6820,7 +6710,6 @@ Nested table
 </td>
 <td>the original table again
 </td></tr></table>
-
 !! end
 
 !! test
@@ -6834,7 +6723,6 @@ Invalid attributes in table cell (T3830)
 <tr>
 <td>broken
 </td></tr></table>
-
 !! end
 
 !! test
@@ -6854,7 +6742,6 @@ Table cell attributes: Pipes protected by nowikis should be treated as a plain c
 </td>
 <td>title="foo|" bar
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr><td title="foo">bar</td>
@@ -6881,7 +6768,6 @@ parsoid=wt2html,html2html
 </td>
 </tr>
 </table>
-
 !! html/parsoid
 <table><tbody>
 <tr>
@@ -6899,7 +6785,6 @@ Element attributes with double ! should not be broken up by <th>
 <tr>
 <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>
@@ -6917,7 +6802,6 @@ Element attributes with double ! should not be broken up by <th>
 <tr>
 <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>
@@ -6939,7 +6823,6 @@ parsoid=wt2html
 <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>
@@ -6998,7 +6881,6 @@ parsoid=wt2html
 </td>
 <td style="color:blue">2
 </td></tr></table>
-
 !! html/parsoid
 <table style="border:1px solid black">
 <tr>
@@ -7057,7 +6939,6 @@ parsoid={
 </td>
 <td align="center" style="color:red;">Foo
 </td></tr></table>
-
 !! end
 
 !! test
@@ -7074,7 +6955,6 @@ parsoid={
 <td>Bar</td>
 <td>Baz
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr><td about="#mwt1" typeof="mw:Transclusion" style="color:red;" data-mw='{"parts":["|",{"template":{"target":{"wt":"table_attribs_2","href":"./Template:Table_attribs_2"},"params":{},"i":0}}]}'>Foo</td>
@@ -7102,7 +6982,6 @@ parsoid={
 <td style="color:red;"><i>Bar</i></td>
 <td style="color:brown;"><i>Foo</i> and Baz
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr><th align="center" style="color:red;" typeof="mw:Transclusion" about="#mwt1" data-mw='{"parts":["!align=center ",{"template":{"target":{"wt":"table_header_cells","href":"./Template:Table_header_cells"},"params":{},"i":0}}]}'>Foo</th><th about="#mwt1" style="color:red;"><i about="#mwt1">Bar</i></th><th about="#mwt1" style="color:brown;"><i about="#mwt1">Foo</i> and Baz</th></tr><tr>
@@ -7130,7 +7009,6 @@ parsoid={
 <td style="color:red;"><i>Bar</i></td>
 <td style="color:brown;"><i>Foo</i> and Baz
 </td></tr></table>
-
 !! html/parsoid
 <table about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[],[],[],[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"tbl-start","href":"./Template:Tbl-start"},"params":{},"i":0}},"\n!align=center ",{"template":{"target":{"wt":"table_header_cells","href":"./Template:Table_header_cells"},"params":{},"i":1}},"\n|-\n|align=center ",{"template":{"target":{"wt":"table_cells","href":"./Template:Table_cells"},"params":{},"i":2}},"\n",{"template":{"target":{"wt":"tbl-end","href":"./Template:Tbl-end"},"params":{},"i":3}}]}'>
 <tbody><tr><th align="center" style="color:red;">Foo</th><th style="color:red;"><i>Bar</i></th><th style="color:brown;"><i>Foo</i> and Baz</th></tr>
@@ -7171,7 +7049,6 @@ parsoid=wt2html,html2html
 <tr>
 <th>foo
 </th></tr></table>
-
 !! end
 
 !! test
@@ -7191,7 +7068,6 @@ parsoid=wt2html,html2html
 <tr>
 <td>foo
 </td></tr></table>
-
 !! end
 
 !! test
@@ -7207,7 +7083,6 @@ parsoid=wt2html,html2html
 <tr>
 <td style="">hello
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr><td style="">hello</td></tr>
@@ -7234,7 +7109,6 @@ Wikitext table with a lot of comments
 <tr>
 <td>
 </td></tr></table>
-
 !! end
 
 !! test
@@ -7271,7 +7145,6 @@ b
 <p>b
 </p>
 </td></tr></table>
-
 !! end
 
 !! test
@@ -7288,7 +7161,6 @@ Table cell with a single comment
 </td>
 <td>a
 </td></tr></table>
-
 !! end
 
 !! test
@@ -7306,14 +7178,12 @@ Table-cell after a comment-only-empty-line
 </td>
 <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>
 </tbody></table>
-
 !! end
 
 !! test
@@ -7336,7 +7206,6 @@ Build table with {{!}}
 <td>data</td>
 <td style="color:red;">second data
 </td></tr></table>
-
 !! end
 
 !! test
@@ -7371,7 +7240,6 @@ Build table with pipe as data
 <td>data with |</td>
 <td>second data with |
 </td></tr></table>
-
 !! end
 
 !! test
@@ -7398,7 +7266,6 @@ Build table with wikilink
 <td>data</td>
 <td>second data <a href="/wiki/Main_Page" title="Main Page">link|text with pipe</a>
 </td></tr></table>
-
 !! end
 
 # The expected HTML structure in this test is debatable. The PHP parser does
@@ -7433,7 +7300,6 @@ a
 
 a
 </table>
-
 !! html/php+tidy
 
 
@@ -7460,7 +7326,6 @@ parsoid=wt2html,html2html
 
 <ul><li>a</li></ul>
 </table>
-
 !! html/php+tidy
 <ul><li>a</li></ul><table>
 
@@ -7514,8 +7379,7 @@ parsoid=wt2html,wt2wt
 </p><table>
 <tbody><tr>
 <td>baz
-</td></tr></tbody></table><p><b>quux</b>
-</p>
+</td></tr></tbody></table><p><b>quux</b></p>
 !! end
 
 !! test
@@ -7556,7 +7420,6 @@ parsoid=wt2html,wt2wt
 <td>baz</td>
 <td>quux
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr><th>foo</th><th>bar
@@ -8209,8 +8072,11 @@ Link containing double quotes and spaces
 File containing double quotes and spaces
 !! wikitext
 [[File:Cool "Gator".png]]
+!! html/php+tidy
+<p><a href="/index.php?title=Special:Upload&amp;wpDestFile=Cool_%22Gator%22.png" class="new" title="File:Cool &quot;Gator&quot;.png">File:Cool &quot;Gator&quot;.png</a>
+</p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[]}' data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./File:Cool_%22Gator%22.png" data-parsoid='{"a":{"href":"./File:Cool_%22Gator%22.png"},"sa":{"href":"File:Cool \"Gator\".png"}}'><img resource='./File:Cool_"Gator".png' src="./Special:FilePath/Cool_%22Gator%22.png" height="220" width="220" data-parsoid='{"a":{"resource":"./File:Cool_\"Gator\".png","height":"220","width":"220","src":"./Special:FilePath/Cool_%22Gator%22.png"},"sa":{"resource":"File:Cool \"Gator\".png","src":"./Special:FilePath/Cool_\"Gator\".png"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Cool_%22Gator%22.png"><span resource='./File:Cool_"Gator".png' data-parsoid='{"a":{"resource":"./File:Cool_\"Gator\".png"},"sa":{"resource":"File:Cool \"Gator\".png"}}'>File:Cool "Gator".png</span></a></figure-inline></p>
 !! end
 
 !! test
@@ -8241,6 +8107,7 @@ Link containing double-single-quotes '' in text embedded in italics (T6598 sanit
 </p>
 !! end
 
+## FIXME: Title part of filename is interpreted in php
 !! test
 Link with double quotes in title part (literal) and alternate part (interpreted)
 !! wikitext
@@ -8258,7 +8125,7 @@ Link with double quotes in title part (literal) and alternate part (interpreted)
 </p><p><a href="/index.php?title=%27%27Pentecoste%27%27&amp;action=edit&amp;redlink=1" class="new" title="&#39;&#39;Pentecoste&#39;&#39; (page does not exist)"><i>Pentecoste</i></a>
 </p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./File:Denys_Savchenko_''Pentecoste''.jpg"><img resource="./File:Denys_Savchenko_''Pentecoste''.jpg" src="./Special:FilePath/Denys_Savchenko_''Pentecoste''.jpg" height="220" width="220"/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Denys_Savchenko_''Pentecoste''.jpg"><span resource="./File:Denys_Savchenko_''Pentecoste''.jpg" data-parsoid='{"a":{"resource":"./File:Denys_Savchenko_&apos;&apos;Pentecoste&apos;&apos;.jpg"},"sa":{"resource":"File:Denys_Savchenko_&apos;&apos;Pentecoste&apos;&apos;.jpg"}}'>File:Denys Savchenko ''Pentecoste''.jpg</span></a></figure-inline></p>
 <p><a rel="mw:WikiLink" href="./''Pentecoste''" title="''Pentecoste''">''Pentecoste''</a></p>
 <p><a rel="mw:WikiLink" href="./''Pentecoste''" title="''Pentecoste''">Pentecoste</a></p>
 <p><a rel="mw:WikiLink" href="./''Pentecoste''" title="''Pentecoste''"><i>Pentecoste</i></a></p>
@@ -8278,10 +8145,10 @@ Broken image links with HTML captions (T41700)
 <a href="/index.php?title=Special:Upload&amp;wpDestFile=Nonexistent" class="new" title="File:Nonexistent">abc</a>
 </p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"caption","ak":"&lt;script>&lt;/script>"}]}' data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}],"caption":"&amp;lt;script>&amp;lt;/script>"}'><a href="./File:Nonexistent" data-parsoid='{"a":{"href":"./File:Nonexistent"},"sa":{}}'><img resource="./File:Nonexistent" src="./Special:FilePath/Nonexistent" height="220" width="220" data-parsoid='{"a":{"resource":"./File:Nonexistent","height":"220","width":"220"},"sa":{"resource":"File:Nonexistent"}}'/></a></figure-inline>
-<figure-inline typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":"100x100px"},{"ck":"caption","ak":"&lt;script>&lt;/script>"}]}' data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}],"caption":"&amp;lt;script>&amp;lt;/script>"}'><a href="./File:Nonexistent" data-parsoid='{"a":{"href":"./File:Nonexistent"},"sa":{}}'><img resource="./File:Nonexistent" src="./Special:FilePath/Nonexistent" height="100" width="100" data-parsoid='{"a":{"resource":"./File:Nonexistent","height":"100","width":"100"},"sa":{"resource":"File:Nonexistent"}}'/></a></figure-inline>
-<figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"caption","ak":"&amp;lt;"}]}' data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}],"caption":"&lt;span typeof=\"mw:Entity\" data-parsoid=&#39;{\"src\":\"&amp;amp;lt;\",\"srcContent\":\"&amp;lt;\",\"dsr\":[107,111,null,null]}&#39;>&amp;lt;&lt;/span>"}'><a href="./File:Nonexistent" data-parsoid='{"a":{"href":"./File:Nonexistent"},"sa":{}}'><img resource="./File:Nonexistent" src="./Special:FilePath/Nonexistent" height="220" width="220" data-parsoid='{"a":{"resource":"./File:Nonexistent","height":"220","width":"220"},"sa":{"resource":"File:Nonexistent"}}'/></a></figure-inline>
-<figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"caption","ak":"a&lt;i>b&lt;/i>c"}]}' data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}],"caption":"a&lt;i data-parsoid=&#39;{\"stx\":\"html\",\"dsr\":[134,142,3,4]}&#39;>b&lt;/i>c"}'><a href="./File:Nonexistent" data-parsoid='{"a":{"href":"./File:Nonexistent"},"sa":{}}'><img resource="./File:Nonexistent" src="./Special:FilePath/Nonexistent" height="220" width="220" data-parsoid='{"a":{"resource":"./File:Nonexistent","height":"220","width":"220"},"sa":{"resource":"File:Nonexistent"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"caption","ak":"&lt;script>&lt;/script>"}]}' data-mw='{"caption":"&amp;lt;script>&amp;lt;/script>","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent"><span resource="./File:Nonexistent" data-parsoid='{"a":{"resource":"./File:Nonexistent"},"sa":{"resource":"File:Nonexistent"}}'>File:Nonexistent</span></a></figure-inline>
+<figure-inline typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":"100x100px"},{"ck":"caption","ak":"&lt;script>&lt;/script>"}]}' data-mw='{"caption":"&amp;lt;script>&amp;lt;/script>","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent"><span resource="./File:Nonexistent" data-width="100" data-height="100" data-parsoid='{"a":{"resource":"./File:Nonexistent"},"sa":{"resource":"File:Nonexistent"}}'>File:Nonexistent</span></a></figure-inline>
+<figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"caption","ak":"&amp;lt;"}]}' data-mw='{"caption":"&lt;span typeof=\"mw:Entity\" data-parsoid=&apos;{\"src\":\"&amp;amp;lt;\",\"srcContent\":\"&amp;lt;\",\"dsr\":[107,111,null,null]}&apos;>&amp;lt;&lt;/span>","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent"><span resource="./File:Nonexistent" data-parsoid='{"a":{"resource":"./File:Nonexistent"},"sa":{"resource":"File:Nonexistent"}}'>File:Nonexistent</span></a></figure-inline>
+<figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"caption","ak":"a&lt;i>b&lt;/i>c"}]}' data-mw='{"caption":"a&lt;i data-parsoid=&apos;{\"stx\":\"html\",\"dsr\":[134,142,3,4]}&apos;>b&lt;/i>c","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent"><span resource="./File:Nonexistent" data-parsoid='{"a":{"resource":"./File:Nonexistent"},"sa":{"resource":"File:Nonexistent"}}'>File:Nonexistent</span></a></figure-inline></p>
 !! end
 
 !! test
@@ -8304,6 +8171,15 @@ Plain link to URL with link text
 </p>
 !! end
 
+!! test
+Plain link to URL containing special characters, with link text (see T213950).
+!! wikitext
+[[http://www.example.com/?q=%7Babc%7D Link text]]
+!! html
+<p>[<a rel="nofollow" class="external text" href="http://www.example.com/?q=%7Babc%7D">Link text</a>]
+</p>
+!! end
+
 !! test
 Plain link to protocol-relative URL
 !! wikitext
@@ -8866,7 +8742,6 @@ parsoid=wt2html,wt2wt
 !! html/php
 <ul><li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#355;a</a></li>
 <li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#355;a</a></li></ul>
-
 !! html/php+tidy
 <ul><li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#355;a</a></li>
 <li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteni&#355;a</a></li></ul>
@@ -9724,8 +9599,7 @@ Handling html with a div self-closing tag
 <div title="">
 <div title="bar"></div>
 <div title="bar"></div>
-<div title="bar/">
-</div></div>
+<div title="bar/"></div></div>
 !! html/parsoid
 <div title="" data-parsoid='{"stx":"html","selfClose":true}'></div>
 <div title="" data-parsoid='{"stx":"html","selfClose":true}'></div>
@@ -9806,8 +9680,7 @@ foo <hr
 !! html+tidy
 <hr />
 <hr /><p>
-foo </p><hr /><p> bar
-</p>
+foo </p><hr /><p> bar</p>
 !! end
 
 !! test
@@ -9816,7 +9689,6 @@ Horizontal ruler -- 4+ dashes render hr
 ----
 !! html
 <hr />
-
 !! end
 
 !! test
@@ -9825,7 +9697,6 @@ Horizontal ruler -- eats additional dashes on the same line
 ---------
 !! html
 <hr />
-
 !! end
 
 !! test
@@ -9836,7 +9707,6 @@ Horizontal ruler -- does not collapse dashes on consecutive lines
 !! html
 <hr />
 <hr />
-
 !! end
 
 !! test
@@ -9854,10 +9724,8 @@ Horizontal ruler -- Supports content following dashes on same line
 ---- Foo
 !! html
 <hr /> Foo
-
 !! html+tidy
-<hr /><p> Foo
-</p>
+<hr /><p> Foo</p>
 !! end
 
 ###
@@ -9873,7 +9741,6 @@ Common list
 <ul><li>Common list</li>
 <li>item 2</li>
 <li>item 3</li></ul>
-
 !! end
 
 !! test
@@ -9886,7 +9753,6 @@ Numbered list
 <ol><li>Numbered list</li>
 <li>item 2</li>
 <li>item 3</li></ol>
-
 !! end
 
 # the switch from level 3 to ordered should not introduce a newline between
@@ -9924,7 +9790,6 @@ Mixed list
 <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>
-
 !! end
 
 !! test
@@ -9939,7 +9804,6 @@ Mixed list
 <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>
@@ -9955,7 +9819,6 @@ Mixed list
 !! html/php
 <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>
@@ -9969,7 +9832,6 @@ Nested lists 1
 !! html
 <ul><li>foo
 <ul><li>bar</li></ul></li></ul>
-
 !! end
 
 !! test
@@ -9980,7 +9842,6 @@ Nested lists 2
 !! html
 <ul><li><ul><li>foo</li></ul></li>
 <li>bar</li></ul>
-
 !! end
 
 !! test
@@ -9991,7 +9852,6 @@ Nested lists 3 (first element empty)
 !! html
 <ul><li>
 <ul><li>bar</li></ul></li></ul>
-
 !! end
 
 !! test
@@ -10002,7 +9862,6 @@ Nested lists 4 (first element empty)
 !! html
 <ul><li><ul><li></li></ul></li>
 <li>bar</li></ul>
-
 !! end
 
 !! test
@@ -10013,7 +9872,6 @@ Nested lists 5 (both elements empty)
 !! html
 <ul><li><ul><li></li></ul></li>
 <li></li></ul>
-
 !! end
 
 !! test
@@ -10024,7 +9882,6 @@ Nested lists 6 (both elements empty)
 !! html
 <ul><li>
 <ul><li></li></ul></li></ul>
-
 !! end
 
 !! test
@@ -10033,7 +9890,6 @@ Nested lists 7 (skip initial nesting levels)
 ***foo
 !! html
 <ul><li><ul><li><ul><li>foo</li></ul></li></ul></li></ul>
-
 !! end
 
 !! test
@@ -10048,7 +9904,6 @@ Nested lists 8 (multiple nesting transitions)
 <ul><li><ul><li>bar</li></ul></li>
 <li>baz</li></ul></li>
 <li>boo</li></ul>
-
 !! end
 
 # XXX this test should be moved to citeParserTests, since it depends
@@ -10073,7 +9928,6 @@ Nested lists 9 (extension interaction)
 <ul><li>foo</li>
 <li>bar</li>
 <li>baz</li></ul>
-
 !! end
 
 !! test
@@ -10094,7 +9948,6 @@ Nested lists 10 (list and span siblings: wt2wt regression)
 !! html
 <ul><li>foo bar</li>
 <li>baz</li></ul>
-
 !! end
 
 !! test
@@ -10107,7 +9960,6 @@ List items are not parsed correctly following a <pre> block (T2785)
 <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>
@@ -10139,7 +9991,6 @@ List items from template
 <li>notSOL</li>
 <li>item 1</li>
 <li>item 2</li></ul>
-
 !! end
 
 !! test
@@ -10155,7 +10006,6 @@ List interrupted by empty line or heading
 <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>
-
 !!end
 
 !! test
@@ -10171,12 +10021,10 @@ Multiple list tags generated by templates
 </li>
 </li>
 
-
 !! html+tidy
 <li>a
 </li><li>b
-</li><li>c
-</li>
+</li><li>c</li>
 !! html/parsoid
 <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>"}},"i":0}},"a"]}'>a</li>
 <li about="#mwt2" 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>"}},"i":0}},"b"]}'>b</li>
@@ -10235,7 +10083,6 @@ Single-comment whitespace lines dont break lists, and neither do multi-comment w
 <li>b</li>
 <li>c</li>
 <li>d</li></ul>
-
 !!end
 
 !!test
@@ -10254,7 +10101,6 @@ Replacing whitespace with tabs still doesn't break the list (gerrit 78327)
 <li>b</li>
 <li>c</li>
 <li>d</li></ul>
-
 !!end
 
 # FIXME: Parsoid has a dedicated DOM pass to mimic this Tidy-specific li-hack
@@ -10292,8 +10138,7 @@ parsoid=wt2html,wt2wt
 <li class="mw-empty-elt" data-parsoid='{"stx":"html","autoInsertedEnd":true}'></li><li data-parsoid='{"stx":"html"}'>not a li-hack
 </li>
 </ul>
-
-!!end
+!! end
 
 !! test
 Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines
@@ -10620,7 +10465,6 @@ Magic Words LOCAL (UTC)
 <li>1</li>
 <li>4</li>
 <li>19700101000203</li></ul>
-
 !! end
 
 !! test
@@ -10727,7 +10571,6 @@ parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
 !! wikitext
 {{SUBJECTSPACE}}
 !! html/*
-
 !! end
 
 !! test
@@ -10989,7 +10832,6 @@ parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
 !! wikitext
 {{SCRIPTPATH}}
 !! html/*
-
 !! end
 
 !! test
@@ -11148,7 +10990,6 @@ Namespace 0 {{ns:0}} (T6783)
 !! wikitext
 {{ns:0}}
 !! html
-
 !! end
 
 !! test
@@ -11156,7 +10997,6 @@ Namespace 0 {{ns:00}} (T6783)
 !! wikitext
 {{ns:00}}
 !! html
-
 !! end
 
 !! test
@@ -11694,7 +11534,6 @@ Templates with templated name
 <p>foo
 </p>
 <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>
@@ -11733,11 +11572,10 @@ Template with thumb image (with link in description)
 {{paramtest|param=[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}}
 !! html/php
 This is a test template with parameter <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a>  <div class="thumbcaption"><a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div>
-
 !! html+tidy
 <p>This is a test template with parameter </p><div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&amp;wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a>  <div class="thumbcaption"><a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&amp;action=edit&amp;redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div>
 !! html/parsoid
-<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"paramtest","href":"./Template:Paramtest"},"params":{"param":{"wt":"[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]"}},"i":0}}]}'>This is a test template with parameter </p><figure class="mw-default-size" typeof="mw:Error mw:Image/Thumb" about="#mwt1" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./File:Noimage.png" ><img resource="./File:Noimage.png" src="./Special:FilePath/Noimage.png" height="220" width="220"/></a><figcaption><a rel="mw:WikiLink" href="./No_link" title="No link">link</a> <a rel="mw:WikiLink" href="./No_link" title="No link">caption</a></figcaption></figure>
+<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"paramtest","href":"./Template:Paramtest"},"params":{"param":{"wt":"[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]"}},"i":0}}]}'>This is a test template with parameter </p><figure class="mw-default-size" typeof="mw:Error mw:Image/Thumb" about="#mwt1" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Noimage.png"><span resource="./File:Noimage.png" data-width="220">File:Noimage.png</span></a><figcaption><a rel="mw:WikiLink" href="./No_link" title="No link">link</a> <a rel="mw:WikiLink" href="./No_link" title="No link">caption</a></figcaption></figure>
 !! end
 
 !! article
@@ -11769,7 +11607,6 @@ T2553: link with two variables in a piped link
 <tr>
 <td>[[{{{1}}}|{{{2}}}]]
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr><td>[[<span about="#mwt5" typeof="mw:Param" data-mw='{"parts":[{"templatearg":{"target":{"wt":"1"},"params":{},"i":0}}]}'>{{{1}}}</span>|<span about="#mwt2" typeof="mw:Param" data-mw='{"parts":[{"templatearg":{"target":{"wt":"2"},"params":{},"i":0}}]}'>{{{2}}}</span>]]</td></tr>
@@ -11797,7 +11634,6 @@ Abort table cell attribute parsing on wikilink
 <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>
@@ -11946,7 +11782,6 @@ foo {{table}}
 <td>3</td>
 <td>4
 </td></tr></table>
-
 !! end
 
 !! test
@@ -11966,7 +11801,6 @@ foo
 <td>3</td>
 <td>4
 </td></tr></table>
-
 !! end
 
 !! test
@@ -12140,13 +11974,16 @@ Template:Includes3
 </p>
 !! end
 
+# FIXME: Parsoid's markup for this is quite ugly.
 !! test
 <includeonly> and <noinclude> on a page
 !! wikitext
 Foo<noinclude>zar</noinclude><includeonly>bar</includeonly>
-!! html
+!! html/php+tidy
 <p>Foozar
 </p>
+!! html/parsoid
+<p>Foo<meta typeof="mw:Includes/NoInclude" data-parsoid="{}"/>zar</p><meta typeof="mw:Includes/NoInclude/End" data-parsoid="{}"/><meta typeof="mw:Includes/IncludeOnly" data-mw='{"src":"&lt;includeonly>bar&lt;/includeonly>"}' data-parsoid="{}"/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid="{}"/>
 !! end
 
 !! test
@@ -12203,7 +12040,6 @@ Unbalanced includeonly and noinclude tags
 </td>
 <td>d&lt;/includeonly&gt;&lt;/includeonly&gt;
 </td></tr></table>
-
 !!end
 
 !! article
@@ -12222,7 +12058,6 @@ T8563: Edit link generation for section shown by <includeonly>
 !! html
 <h2><span class="mw-headline" id="Includeonly_section">Includeonly section</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-1" title="Template:Includeonly section">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Section_T-1">Section T-1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Includeonly_section&amp;action=edit&amp;section=T-2" title="Template:Includeonly section">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 # Uses same input as the contents of [[Template:Includeonly section]]
@@ -12248,7 +12083,6 @@ T8563: Edit link generation for section suppressed by <includeonly>
 ==Section 1==
 !! html
 <h2><span class="mw-headline" id="Section_1">Section 1</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: Section 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 !! test
@@ -12306,7 +12140,6 @@ some* stuff
 </p>
 <ul><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>
 
@@ -12320,7 +12153,6 @@ some* stuff
 <ul><li>here</li></ul>
 
 <meta typeof="mw:Includes/IncludeOnly" data-parsoid='{"src":"&lt;includeonly>can have stuff&lt;/includeonly>"}' data-mw='{"src":"&lt;includeonly>can have stuff&lt;/includeonly>"}'/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid='{"src":""}'/><h3 id="here">here</h3>
-
 !! end
 
 # TODO: test with DOM fragment reuse!
@@ -12467,7 +12299,6 @@ Parsoid: Merge double tds in nested transclusion content (T52603)
 <td>a
 </td></tr>
 </table>
-
 !!end
 
 ###
@@ -12558,7 +12389,6 @@ Preprocessor precedence 5: tplarg takes precedence over template
 {{Precedence5|Bullet}}
 !! html/php
 <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>
 !! end
@@ -12658,7 +12488,6 @@ Preprocessor precedence 9: groups of braces
 <dd>Four</dd>
 <dt>7</dt>
 <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}}]}'>
 <dt>4</dt>
@@ -12710,7 +12539,6 @@ language=zh
 <dd>-Three-</dd>
 <dt>7</dt>
 <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}}]}'>
 <dt>1</dt>
@@ -13084,7 +12912,6 @@ Templates: 2. Inside a block tag
 !! html
 <div>Foo</div>
 <blockquote>Foo</blockquote>
-
 !! html+tidy
 <div>Foo</div>
 <blockquote><p>Foo</p></blockquote>
@@ -13124,7 +12951,6 @@ Templates: P-wrapping: 1c. Templates on consecutive lines
 <p>Foo
 </p>
 bar <div>baz</div>
-
 !! html+tidy
 <p>Foo
 </p><p>
@@ -13184,7 +13010,6 @@ Templates: Block Tags: 1. Multiple template uses
 {{echo|<div>Foo</div>}}<div>bar</div>{{echo|<div>baz</div>}}
 !! html
 <div>Foo</div><div>bar</div><div>baz</div>
-
 !!end
 
 !!test
@@ -13193,7 +13018,6 @@ Templates: Block Tags: 2. Back-to-back template uses
 {{echo|<div>Foo</div>}}{{echo|<div>bar</div>}}
 !! html
 <div>Foo</div><div>bar</div>
-
 !!end
 
 ## Parsoid drops empty elements in templates.
@@ -13280,13 +13104,20 @@ Templates: Links: 5. Nested templates (only outermost template should be marked)
 </p>
 !!end
 
+!! test
+File with template filename
+!! wikitext
+[[File:{{echo|Foobar.jpg}}]]
+!! html/parsoid
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"href"},{"html":"File:&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&apos;{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[7,26,null,null]}&apos; data-mw=&apos;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"Foobar.jpg\"}},\"i\":0}}]}&apos;>Foobar.jpg&lt;/span>"}]]}'><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":"File:{{echo|Foobar.jpg}}"}}'/></a></figure-inline></p>
+!! end
+
 !!test
 Templates: HTML Tag: 1. Generation of HTML attr. key
 !! wikitext
 <div {{echo|style}}="color:red;">foo</div>
 !! html
 <div style="color:red;">foo</div>
-
 !!end
 
 !!test
@@ -13295,7 +13126,6 @@ Templates: HTML Tag: 2. Generation of HTML attr. value
 <div style={{echo|'color:red;'}}>foo</div>
 !! html
 <div style="color:red;">foo</div>
-
 !!end
 
 !!test
@@ -13304,7 +13134,6 @@ Templates: HTML Tag: 3. Generation of HTML attr key and value
 <div {{echo|style}}={{echo|'color:red;'}}>foo</div>
 !! html
 <div style="color:red;">foo</div>
-
 !!end
 
 !!test
@@ -13313,7 +13142,6 @@ Templates: HTML Tag: 4. Generation of starting piece of HTML attr value
 <div title="{{echo|This is a long title}} with just one piece templated">foo</div>
 !! html
 <div title="This is a long title with just one piece templated">foo</div>
-
 !!end
 
 !!test
@@ -13322,7 +13150,6 @@ Templates: HTML Tag: 5. Generation of middle piece of HTML attr value
 <div title="This is a long title with just {{echo|one piece}} templated">foo</div>
 !! html
 <div title="This is a long title with just one piece templated">foo</div>
-
 !!end
 
 !!test
@@ -13331,7 +13158,6 @@ Templates: HTML Tag: 6. Generation of end piece of HTML attr value
 <div title="This is a long title with just one piece {{echo|templated}}">foo</div>
 !! html
 <div title="This is a long title with just one piece templated">foo</div>
-
 !!end
 
 # SSS FIXME: While it is great we added support for all this,
@@ -13343,7 +13169,6 @@ Templates: HTML Tag: 7. Generation of partial attribute key string
 <div st{{echo|yle}}="color:red;">foo</div>
 !! html
 <div style="color:red;">foo</div>
-
 !!end
 
 !! test
@@ -13352,7 +13177,6 @@ Templates: HTML Tag: 8. Template-generated attribute (k=v)
 <div {{echo|1=id="v1"}}>bar</div>
 !! html
 <div id="v1">bar</div>
-
 !!end
 
 !! test
@@ -13361,7 +13185,6 @@ Templates: HTML Tag: 9. Multiple template-generated attributes
 <div {{echo|1=id="v1" title="foo"}}>bar</div>
 !! html
 <div id="v1" title="foo">bar</div>
-
 !!end
 
 !! test
@@ -13380,7 +13203,6 @@ Templates: Support for templates generating attributes and content
 <tr>
 <td>bar
 </td></tr></table>
-
 !! html/parsoid
 <table style="color:red;" title="T48811" about="#mwt1" typeof="mw:Transclusion mw:ExpandedAttrs" data-mw='{"parts":["{| ",{"template":{"target":{"wt":"mixed_attr_content_template","href":"./Template:Mixed_attr_content_template"},"params":{},"i":0}},"\n|-\n|bar\n|}"]}'>
 <tbody><tr>
@@ -13414,7 +13236,6 @@ Table cell with attribute before expanded attribute
 <div {{echo|style{{=}}"background:&#35;f9f9f9;"}}>foo</div>
 !! html/php
 <div style="background:#f9f9f9;">foo</div>
-
 !! html/parsoid
 <div style="background:#f9f9f9;" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html"}' data-mw='{"attribs":[[{"txt":"style","html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[5,49,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"style{{=}}\\\"background:&amp;amp;#35;f9f9f9;\\\"\"}},\"i\":0}}]}&#39;>style&lt;/span>&lt;span typeof=\"mw:Nowiki\" about=\"#mwt1\" data-parsoid=\"{}\">=&lt;/span>&lt;span about=\"#mwt1\" data-parsoid=\"{}\">\"background:&lt;/span>&lt;span typeof=\"mw:Entity\" about=\"#mwt1\" data-parsoid=&#39;{\"src\":\"&amp;amp;#35;\",\"srcContent\":\"#\"}&#39;>#&lt;/span>&lt;span about=\"#mwt1\" data-parsoid=\"{}\">f9f9f9;\"&lt;/span>"},{"html":""}]]}'>foo</div>
 !! end
@@ -13430,7 +13251,6 @@ Table cell with attribute before expanded attribute
 <tr>
 <td style="background:#f9f9f9;">Foo
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tbody><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td style="background:#f9f9f9;" typeof="mw:Transclusion" about="#mwt1" data-parsoid='{"autoInsertedEnd":true,"pi":[[]]}' data-mw='{"parts":["|",{"template":{"target":{"wt":"table_attribs_3","href":"./Template:Table_attribs_3"},"params":{},"i":0}}]}'>Foo</td></tr>
@@ -13448,7 +13268,6 @@ Table cell with attribute before expanded attribute
 <tr>
 <td style="background:#f9f9f9;">Foo
 </td></tr></table>
-
 !! html/parsoid
 <table about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[],[],[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"tbl-start","href":"./Template:Tbl-start"},"params":{},"i":0}},"\n|",{"template":{"target":{"wt":"table_attribs_3","href":"./Template:Table_attribs_3"},"params":{},"i":1}},"\n",{"template":{"target":{"wt":"tbl-end","href":"./Template:Tbl-end"},"params":{},"i":2}}]}'>
 <tbody><tr><td style="background:#f9f9f9;">Foo</td></tr>
@@ -13467,7 +13286,6 @@ Table cell with attribute before expanded attribute
 <tr>
 <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>
@@ -13480,7 +13298,6 @@ Templates: HTML Tables: 1. Generating start of a HTML table
 {{echo|<table><tr><td>foo</td>}}</tr></table>
 !! html
 <table><tr><td>foo</td></tr></table>
-
 !!end
 
 !!test
@@ -13489,7 +13306,6 @@ Templates: HTML Tables: 2a. Generating middle of a HTML table
 <table><tr>{{echo|<td>foo</td>}}</tr></table>
 !! html
 <table><tr><td>foo</td></tr></table>
-
 !!end
 
 !!test
@@ -13498,7 +13314,6 @@ Templates: HTML Tables: 2b. Generating middle of a HTML table
 <table>{{echo|<tr><td>foo</td></tr>}}</table>
 !! html
 <table><tr><td>foo</td></tr></table>
-
 !!end
 
 !!test
@@ -13507,8 +13322,7 @@ Templates: HTML Tables: 3. Generating end of a HTML table
 <table><tr>{{echo|<td>foo</td></tr></table>}}
 !! html
 <table><tr><td>foo</td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: HTML Tables: 4a. Generating a single tag of a HTML table
@@ -13516,8 +13330,7 @@ Templates: HTML Tables: 4a. Generating a single tag of a HTML table
 {{echo|<table>}}<tr><td>foo</td></tr></table>
 !! html
 <table><tr><td>foo</td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: HTML Tables: 4b. Generating a single tag of a HTML table
@@ -13525,8 +13338,7 @@ Templates: HTML Tables: 4b. Generating a single tag of a HTML table
 <table>{{echo|<tr>}}<td>foo</td></tr></table>
 !! html
 <table><tr><td>foo</td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: HTML Tables: 4c. Generating a single tag of a HTML table
@@ -13534,8 +13346,7 @@ Templates: HTML Tables: 4c. Generating a single tag of a HTML table
 <table><tr>{{echo|<td>}}foo</td></tr></table>
 !! html
 <table><tr><td>foo</td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: HTML Tables: 4d. Generating a single tag of a HTML table
@@ -13543,8 +13354,7 @@ Templates: HTML Tables: 4d. Generating a single tag of a HTML table
 <table><tr><td>foo{{echo|</td>}}</tr></table>
 !! html
 <table><tr><td>foo</td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: HTML Tables: 4e. Generating a single tag of a HTML table
@@ -13552,8 +13362,7 @@ Templates: HTML Tables: 4e. Generating a single tag of a HTML table
 <table><tr><td>foo</td>{{echo|</tr>}}</table>
 !! html
 <table><tr><td>foo</td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: HTML Tables: 4f. Generating a single tag of a HTML table
@@ -13561,8 +13370,7 @@ Templates: HTML Tables: 4f. Generating a single tag of a HTML table
 <table><tr><td>foo</td></tr>{{echo|</table>}}
 !! html
 <table><tr><td>foo</td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: HTML Tables: 5. Proper fostering of categories from inside
@@ -13592,7 +13400,6 @@ Templates: Wiki Tables: 1a. Fostering of entire template content
 <table>
 a
 <tr><td></td></tr></table>
-
 !! html/php+tidy
 
 a
@@ -13618,7 +13425,6 @@ foo
 </p>
 </div>
 <tr><td></td></tr></table>
-
 !! html/php+tidy
 <div>
 <p>foo
@@ -13647,7 +13453,6 @@ Templates: Wiki Tables: 2. Fostering of partial template content
 a
 <div>b</div>
 <tr><td></td></tr></table>
-
 !! html/php+tidy
 
 a
@@ -13671,8 +13476,7 @@ Templates: Wiki Tables: 3. td-content via multiple templates
 <tr>
 <td>ab
 </td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: Wiki Tables: 4. Templated tags, no content
@@ -13682,8 +13486,7 @@ Templates: Wiki Tables: 4. Templated tags, no content
 !! html
 <table>
 <tr><td></td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: Wiki Tables: 5. Templated tags, regular td-tags
@@ -13696,8 +13499,7 @@ Templates: Wiki Tables: 5. Templated tags, regular td-tags
 <tr>
 <td>foo
 </td></tr></table>
-
-!!end
+!! end
 
 !!test
 Templates: Wiki Tables: 6. Templated tags, templated td-tags
@@ -13710,8 +13512,7 @@ Templates: Wiki Tables: 6. Templated tags, templated td-tags
 <tr>
 <td>foo
 </td></tr></table>
-
-!!end
+!! end
 
 ## This test case is very specific to Parsoid's internals
 ## and is hence only tested for Parsoid's code. Parsoid uses
@@ -13763,7 +13564,6 @@ unused}}}}
 !! html
 <ul><li>a <a href="/index.php?title=Template:Nonexistent&amp;action=edit&amp;redlink=1" class="new" title="Template:Nonexistent (page does not exist)">Template:Nonexistent</a></li>
 <li>b <a href="/index.php?title=Template:Nonexistent&amp;action=edit&amp;redlink=1" class="new" title="Template:Nonexistent (page does not exist)">Template:Nonexistent</a></li></ul>
-
 !!end
 
 !!test
@@ -13805,10 +13605,8 @@ Templates: Ugly nesting: 4. Divs opened/closed across templates
 a<div>b{{echo|c</div>d}}e
 !! html
 a<div>bc</div>de
-
 !! html+tidy
-<p>a</p><div>bc</div><p>de
-</p>
+<p>a</p><div>bc</div><p>de</p>
 !! end
 
 !! test
@@ -14685,9 +14483,8 @@ Right-aligned image
 [[File:Foobar.jpg|right]]
 !! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
-<figure class="mw-default-size mw-halign-right" 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"/></a></figure>
+<figure class="mw-default-size mw-halign-right" 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"/></a><figcaption></figcaption></figure>
 !! end
 
 !! test
@@ -14696,7 +14493,6 @@ Image with caption
 [[File:Foobar.jpg|right|Caption text]]
 !! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-right" 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"/></a><figcaption>Caption text</figcaption></figure>
 !! end
@@ -14707,7 +14503,6 @@ Image with caption, T55312 #1
 [[File:Foobar.jpg|right|Caption page stuff]]
 !! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption page stuff"><img alt="Caption page stuff" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-right" 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"/></a><figcaption>Caption page stuff</figcaption></figure>
 !! end
@@ -14718,7 +14513,6 @@ Image with caption, T55312 #2
 [[File:Foobar.jpg|right|Caption page=]]
 !! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption page="><img alt="Caption page=" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-right" 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"/></a><figcaption>Caption page=</figcaption></figure>
 !! end
@@ -14729,7 +14523,6 @@ Image with caption, T55312 #3
 [[File:Foobar.jpg|right|Caption page=stuff]]
 !! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption page=stuff"><img alt="Caption page=stuff" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-right" 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"/></a><figcaption>Caption page=stuff</figcaption></figure>
 !! end
@@ -14742,7 +14535,6 @@ Image caption with pipe entity
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>one &#x7c; two</div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>one <i>two</i> &#x7c; three</div></div></div>
-
 !! html/parsoid
 <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>one <span typeof="mw:Entity">|</span> two</figcaption></figure>
 <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>one <i>two</i> <span typeof="mw:Entity">|</span> three</figcaption></figure>
@@ -14759,7 +14551,6 @@ thumbsize=220
 ]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Caption <a href="/index.php?title=Link1&amp;action=edit&amp;redlink=1" class="new" title="Link1 (page does not exist)">Link1</a> [[]] <a href="/index.php?title=Link2&amp;action=edit&amp;redlink=1" class="new" title="Link2 (page does not exist)">Link2</a></div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"Caption [[Link1]]\n[[]]\n[[Link2]]\n"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>Caption <a rel="mw:WikiLink" href="./Link1" title="Link1" data-parsoid='{"stx":"simple","a":{"href":"./Link1"},"sa":{"href":"Link1"}}'>Link1</a>
 [[]]
@@ -14806,7 +14597,6 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|right||Caption text]]
 !! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-right" 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"/></a><figcaption>Caption text</figcaption></figure>
 !! end
@@ -14817,9 +14607,8 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|thumb|{{echo|137px}}|This is a caption]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:139px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" decoding="async" width="137" height="16" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/206px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/274px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is a caption</div></div></div>
-
 !! html/parsoid
-<figure typeof="mw:Image/Thumb mw:ExpandedAttrs" about="#mwt2" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"{{echo|137px}}"},{"ck":"caption","ak":"This is a caption"}]}' data-mw='{"attribs":[["thumbnail",{"html":"thumb"}],["width",{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[24,38,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"137px\"}},\"i\":0}}]}&#39;>137px&lt;/span>"}]]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="16" width="137" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"16","width":"137"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>This is a caption</figcaption></figure>
+<figure typeof="mw:Image/Thumb mw:ExpandedAttrs" about="#mwt2" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"{{echo|137px}}"},{"ck":"caption","ak":"This is a caption"}]}' data-mw='{"attribs":[["width",{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[24,38,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"137px\"}},\"i\":0}}]}&#39;>137px&lt;/span>"}]]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="16" width="137" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"16","width":"137"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>This is a caption</figcaption></figure>
 !! end
 
 !! test
@@ -14828,7 +14617,6 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|{{echo|thumb}}|{{echo|137px}}|This is a caption]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:139px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" decoding="async" width="137" height="16" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/206px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/274px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is a caption</div></div></div>
-
 !! html/parsoid
 <figure typeof="mw:Image/Thumb mw:ExpandedAttrs" about="#mwt3" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"{{echo|thumb}}"},{"ck":"width","ak":"{{echo|137px}}"},{"ck":"caption","ak":"This is a caption"}]}' data-mw='{"attribs":[["thumbnail",{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[18,32,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"thumb\"}},\"i\":0}}]}&#39;>thumb&lt;/span>"}],["width",{"html":"&lt;span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[33,47,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"137px\"}},\"i\":0}}]}&#39;>137px&lt;/span>"}]]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/137px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="16" width="137" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"16","width":"137"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>This is a caption</figcaption></figure>
 !! end
@@ -14852,7 +14640,6 @@ Image with multiple attributes from the same template
 [[File:Foobar.jpg|{{image_attribs}}]]
 !! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption text"><img alt="Caption text" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-right" typeof="mw:Image mw:Placeholder"><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"/></a><figcaption>Caption text</figcaption></figure>
 !! end
@@ -14870,17 +14657,15 @@ thumbsize=220
 </p>
 123<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>456
 123<div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div>456
-
 !! html/php+tidy
 <p>123<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a>456
 </p><p>
 123</p><div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div><p>456
-123</p><div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div><p>456
-</p>
+123</p><div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div><p>456</p>
 !! html/parsoid
 <p>123<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"/></a></figure-inline>456</p>
-<p>123</p><figure class="mw-default-size mw-halign-right" 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"/></a></figure><p>456
-123</p><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></figure><p>456</p>
+<p>123</p><figure class="mw-default-size mw-halign-right" 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"/></a><figcaption></figcaption></figure><p>456
+123</p><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></figcaption></figure><p>456</p>
 !! end
 
 !! test
@@ -14889,7 +14674,6 @@ Image with multiple captions -- only last one is accepted
 [[File:Foobar.jpg|right|Caption1 - ignored|[[Caption2]] - ignored|Caption3 - accepted]]
 !! html/php
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption3 - accepted"><img alt="Caption3 - accepted" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-right" 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"/></a><figcaption>Caption3 - accepted</figcaption></figure>
 !! end
@@ -14932,7 +14716,6 @@ Image with width attribute at different positions
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" width="200" height="23" 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>
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" width="200" height="23" 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>
 <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" decoding="async" width="200" height="23" 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>
-
 !! html/parsoid
 <figure class="mw-halign-right" typeof="mw:Image"><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>Caption</figcaption></figure>
 <figure class="mw-halign-right" typeof="mw:Image"><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>Caption</figcaption></figure>
@@ -15093,7 +14876,6 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|thumb|link=http://example.com/|Title]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="http://example.com/"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="http://example.com/"><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>Title</figcaption></figure>
 !! end
@@ -15106,7 +14888,19 @@ thumbsize=220
 [[File:Foobar.jpg|thumbnail=Thumb.png|Title]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg"><img alt="" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
+!! html/parsoid
+<figure class="mw-default-size" typeof="mw:Image/Thumb" about="#mwt1" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
+!! end
 
+!! test
+Manually-specified thumbnail image (backwards compat)
+!! options
+thumbsize=220
+parsoid=html2wt
+!! wikitext
+[[File:Foobar.jpg|thumbnail=Thumb.png|Title]]
+!! html/php
+<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Foobar.jpg"><img alt="" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
 !! end
@@ -15120,9 +14914,8 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|thumb=Thumb.png|link=Main_Page|Title]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
-
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="./Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
@@ -15134,9 +14927,8 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|thumb=Thumb.png|link=http://example.com|Title]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="http://example.com"><img alt="" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
-
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="http://example.com"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="http://example.com"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
@@ -15148,9 +14940,8 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|thumb=Thumb.png|link=|Title]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><img alt="" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" />  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
-
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><span><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></span><figcaption>Title</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><span><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></span><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
@@ -15162,9 +14953,8 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|thumb=Thumb.png|link=Main_Page|alt=alttext|Title]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="alttext" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
-
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="./Main_Page"><img alt="alttext" resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"attribs":[["manualthumb",{"txt":"Thumb.png"}]]}'><a href="./Main_Page"><img alt="alttext" resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
@@ -15175,7 +14965,6 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|frame|left|This is a test image [[Main Page]]]]
 !! html/php
 <div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><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"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></figcaption></figure>
 !! end
@@ -15188,7 +14977,6 @@ parsoid=wt2html,wt2wt,html2html
 [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]]
 !! html/php
 <div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Altitude" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="./File:Foobar.jpg"><img alt="Altitude" 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"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></figcaption></figure>
 !! end
@@ -15206,7 +14994,7 @@ Image with wiki markup in implicit alt
 !! html/parsoid
 <p><figure-inline class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"caption","ak":"testing &#39;&#39;&#39;bold&#39;&#39;&#39; in alt"}]}' data-mw='{"caption":"testing &lt;b data-parsoid=&#39;{\"dsr\":[27,37,3,3]}&#39;>bold&lt;/b> in alt"}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{}}'><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></p>
 
-<p><figure-inline class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=testing &#39;&#39;&#39;bold&#39;&#39;&#39; in alt"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{}}'><img alt="testing bold in alt" 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":{"alt":"testing bold in alt","resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"alt":"alt=testing &#39;&#39;&#39;bold&#39;&#39;&#39; in alt","resource":"Image:Foobar.jpg"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt1" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=testing &apos;&apos;&apos;bold&apos;&apos;&apos; in alt"}]}' data-mw='{"attribs":[["alt",{"html":"alt=testing &lt;b data-parsoid=&apos;{\"dsr\":[79,89,3,3]}&apos;>bold&lt;/b> in alt","txt":"testing bold in alt"}]]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{"href":"Image:Foobar.jpg"}}'><img alt="testing bold in alt" 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></p>
 !! end
 
 !! test
@@ -15215,17 +15003,12 @@ Alt image option should handle most kinds of wikitext without barfing
 [[Image:Foobar.jpg|thumb|This is the image caption|alt=This is a [[link]] and a {{echo|''bold template''}}.]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="This is a link and a bold template." src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is the image caption</div></div></div>
-
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb mw:ExpandedAttrs" about="#mwt2" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"This is the image caption"},{"ck":"alt","ak":"alt=This is a [[link]] and a {{echo|&apos;&apos;bold template&apos;&apos;}}."}]}' data-mw='{"attribs":[["thumbnail",{"html":"thumb"}],["alt",{"html":"alt=This is a &lt;a rel=\"mw:WikiLink\" href=\"./Link\" title=\"Link\" data-parsoid=&apos;{\"stx\":\"simple\",\"a\":{\"href\":\"./Link\"},\"sa\":{\"href\":\"link\"},\"dsr\":[65,73,2,2]}&apos;>link&lt;/a> and a &lt;i about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&apos;{\"dsr\":[80,106,null,null],\"pi\":[[{\"k\":\"1\"}]]}&apos; data-mw=&apos;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"&amp;apos;&amp;apos;bold template&amp;apos;&amp;apos;\"}},\"i\":0}}]}&#39;>bold template&lt;/i>."}]]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{}}'><img alt="This is a link and a bold template." 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" data-parsoid='{"a":{"alt":"This is a link and a bold template.","resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"alt":"alt=This is a [[link]] and a {{echo|&#39;&#39;bold template&#39;&#39;}}.","resource":"Image:Foobar.jpg"}}'/></a><figcaption>This is the image caption</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb mw:ExpandedAttrs" about="#mwt2" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"This is the image caption"},{"ck":"alt","ak":"alt=This is a [[link]] and a {{echo|&apos;&apos;bold template&apos;&apos;}}."}]}' data-mw='{"attribs":[["alt",{"html":"alt=This is a &lt;a rel=\"mw:WikiLink\" href=\"./Link\" title=\"Link\" data-parsoid=&apos;{\"stx\":\"simple\",\"a\":{\"href\":\"./Link\"},\"sa\":{\"href\":\"link\"},\"dsr\":[65,73,2,2]}&apos;>link&lt;/a> and a &lt;i about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&apos;{\"dsr\":[80,106,null,null],\"pi\":[[{\"k\":\"1\"}]]}&apos; data-mw=&apos;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"&amp;apos;&amp;apos;bold template&amp;apos;&amp;apos;\"}},\"i\":0}}]}&apos;>bold template&lt;/i>.","txt":"This is a link and a bold template."}]]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{"href":"Image:Foobar.jpg"}}'><img alt="This is a link and a bold template." 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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"Image:Foobar.jpg"}}'/></a><figcaption>This is the image caption</figcaption></figure>
 !! end
 
 !! test
 Ampersand in alt attribute (T206940)
-!! options
-parsoid = {
-  "nativeGallery": true
-}
 !! wikitext
 [[File:Foobar.jpg|alt=&amp;amp;]]
 
@@ -15244,19 +15027,53 @@ File:Foobar.jpg|alt=&amp;amp;
                </div></li>
 </ul>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="&amp;amp;" 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"/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt1" data-mw='{"attribs":[["alt",{"html":"alt=&lt;span typeof=\"mw:Entity\" data-parsoid=&apos;{\"src\":\"&amp;amp;amp;\",\"srcContent\":\"&amp;amp;\",\"dsr\":[22,27,null,null]}&apos;>&amp;amp;&lt;/span>amp;","txt":"&amp;amp;"}]]}'><a href="./File:Foobar.jpg"><img alt="&amp;amp;" 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"/></a></figure-inline></p>
 
 <!-- consistency with gallery extension -->
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
-<li class="gallerybox">
-<div class="thumb"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="&amp;amp;" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt5" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
+<li class="gallerybox" style="width: 155px;">
+<div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=&lt;span typeof=\"mw:Entity\" data-parsoid=&apos;{\"src\":\"&amp;amp;amp;\",\"srcContent\":\"&amp;amp;\",\"dsr\":[109,114,null,null]}&apos;>&amp;amp;&lt;/span>amp;","txt":"&amp;amp;"}]]}'><a href="./File:Foobar.jpg"><img alt="&amp;amp;" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div>
 <div class="gallerytext"></div>
 </li>
 </ul>
 !! end
 
+## FIXME: The inconsistency in the gallery extension on the php side is T49646
+!! test
+Link with encoded pipe in alt option
+!! options
+parsoid={
+  "modes": ["wt2html", "html2html"]
+}
+!! wikitext
+[[File:Foobar.jpg|alt=http://testing.123?4=5&vert;6|caption]]
+
+<!-- consistency with gallery extension -->
+<gallery>
+File:Foobar.jpg|alt=http://testing.123?4=5&vert;6|caption
+</gallery>
+!! html/php+tidy
+<p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="http://testing.123?4=5|6" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a>
+</p>
+<ul class="gallery mw-gallery-traditional">
+               <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+                       <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="http://testing.123?4=5&amp;vert;6%7Ccaption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
+                       <div class="gallerytext">
+                       </div>
+               </div></li>
+</ul>
+!! html/parsoid
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt1" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=http://testing.123?4=5&amp;vert;6"},{"ck":"caption","ak":"caption"}]}' data-mw='{"attribs":[["alt",{"html":"alt=&lt;a rel=\"mw:ExtLink\" href=\"http://testing.123?4=5%7C6\" data-parsoid=&apos;{\"stx\":\"url\",\"a\":{\"href\":\"http://testing.123?4=5%7C6\"},\"sa\":{\"href\":\"http://testing.123?4=5&amp;amp;vert;6\"},\"dsr\":[22,51,0,0]}&apos;>http://testing.123?4=5%7C6&lt;/a>","txt":"http://testing.123?4=5|6"}]],"caption":"caption"}'><a href="./File:Foobar.jpg"><img alt="http://testing.123?4=5|6" 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"/></a></figure-inline></p>
+
+<!-- consistency with gallery extension -->
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt5" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=&lt;a rel=\"mw:ExtLink\" href=\"http://testing.123?4=5%7C6\" data-parsoid=&apos;{\"stx\":\"url\",\"a\":{\"href\":\"http://testing.123?4=5%7C6\"},\"sa\":{\"href\":\"http://testing.123?4=5&amp;amp;vert;6\"},\"dsr\":[137,166,0,0]}&apos;>http://testing.123?4=5%7C6&lt;/a>","txt":"http://testing.123?4=5|6"}]]}'><a href="./File:Foobar.jpg"><img alt="http://testing.123?4=5|6" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext">caption</div></li>
+!! end
+
 !! test
 Italics markup in alt attribute (T206940)
+!! options
+parsoid=wt2html,html2html
 !! wikitext
 [[File:Foobar.jpg|alt=''x''|caption]]
 
@@ -15277,19 +15094,20 @@ File:Foobar.jpg|alt=''x''|caption
                </div></li>
 </ul>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=&apos;&apos;x&apos;&apos;"},{"ck":"caption","ak":"caption"}]}' data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg"><img alt="x" 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":{"alt":"x","resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"alt":"alt=&apos;&apos;x&apos;&apos;","resource":"File:Foobar.jpg"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt1" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=&apos;&apos;x&apos;&apos;"},{"ck":"caption","ak":"caption"}]}' data-mw='{"attribs":[["alt",{"html":"alt=&lt;i data-parsoid=&apos;{\"dsr\":[22,27,2,2]}&apos;>x&lt;/i>","txt":"x"}]],"caption":"caption"}'><a href="./File:Foobar.jpg"><img alt="x" 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"/></a></figure-inline></p>
 
 <!-- consistency with gallery extension -->
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{"extsrc":"\nFile:Foobar.jpg|alt=&apos;&apos;x&apos;&apos;|caption\n"}}'>
-<li class="gallerybox">
-<div class="thumb"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="x" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div>
-<div class="gallerytext">caption</div>
-</li>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt5" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=&lt;i data-parsoid=&apos;{\"dsr\":[113,118,2,2]}&apos;>x&lt;/i>","txt":"x"}]]}'><a href="./File:Foobar.jpg"><img alt="x" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext">caption</div></li>
 </ul>
 !! end
 
+## FIXME: This test can be dropped when Parsoid content versions 2.0.0 / 1.8.0
+## are no longer in storage.
 !! test
 Nowiki markup in alt attribute (T206940)
+!! options
+parsoid=html2wt
 !! wikitext
 [[File:Foobar.jpg|alt=<nowiki>''</nowiki>x<nowiki>''</nowiki>|caption]]
 
@@ -15310,12 +15128,12 @@ File:Foobar.jpg|alt=<nowiki>''</nowiki>x<nowiki>''</nowiki>|caption
                </div></li>
 </ul>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=&lt;nowiki>&apos;&apos;&lt;/nowiki>x&lt;nowiki>&apos;&apos;&lt;/nowiki>"},{"ck":"caption","ak":"caption"}],"dsr":[0,71,null,null]}' data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg"><img alt="''x''" 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":{"alt":"&apos;&apos;x&apos;&apos;","resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"alt":"alt=&lt;nowiki>&apos;&apos;&lt;/nowiki>x&lt;nowiki>&apos;&apos;&lt;/nowiki>","resource":"File:Foobar.jpg"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt5" data-parsoid='{"optList":[{"ck":"alt","ak":"alt=&lt;nowiki>&apos;&apos;&lt;/nowiki>x&lt;nowiki>&apos;&apos;&lt;/nowiki>"},{"ck":"caption","ak":"caption"}]}' data-mw='{"attribs":[["alt",{"html":"alt=&lt;span typeof=\"mw:Nowiki\" data-parsoid=&apos;{\"dsr\":[22,41,8,9]}&apos;>&apos;&apos;&lt;/span>x&lt;span typeof=\"mw:Nowiki\" data-parsoid=&apos;{\"dsr\":[42,61,8,9]}&apos;>&apos;&apos;&lt;/span>","txt":"&apos;&apos;x&apos;&apos;"}]],"caption":"caption"}'><a href="./File:Foobar.jpg"><img alt="''x''" 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" /></a></figure-inline></p>
 
 <!-- consistency with gallery extension -->
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{"extsrc":"\nFile:Foobar.jpg|alt=&lt;nowiki>&apos;&apos;&lt;/nowiki>x&lt;nowiki>&apos;&apos;&lt;/nowiki>|caption\n"}}'>
-<li class="gallerybox">
-<div class="thumb"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="''x''" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt13" data-mw='{"name":"gallery","attrs":{},"body":{"extsrc":"\nFile:Foobar.jpg|alt=&lt;nowiki>&apos;&apos;&lt;/nowiki>x&lt;nowiki>&apos;&apos;&lt;/nowiki>|caption\n"}}'>
+<li class="gallerybox" style="width: 155px;">
+<div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=&lt;span typeof=\"mw:Nowiki\" data-parsoid=&apos;{\"dsr\":[147,166,8,9]}&apos;>&apos;&apos;&lt;/span>x&lt;span typeof=\"mw:Nowiki\" data-parsoid=&apos;{\"dsr\":[167,186,8,9]}&apos;>&apos;&apos;&lt;/span>","txt":"&apos;&apos;x&apos;&apos;"}]]}'><a href="./File:Foobar.jpg"><img alt="''x''" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div>
 <div class="gallerytext">caption</div>
 </li>
 </ul>
@@ -15323,10 +15141,6 @@ File:Foobar.jpg|alt=<nowiki>''</nowiki>x<nowiki>''</nowiki>|caption
 
 !! test
 Nowiki markup in alt attribute (edited html, no data-parsoid) (T206940)
-!! options
-parsoid = {
-  "nativeGallery": true
-}
 !! wikitext
 [[File:Foobar.jpg|alt=<nowiki>''x''</nowiki>|caption]]
 
@@ -15347,19 +15161,23 @@ File:Foobar.jpg|alt=<nowiki>''x''</nowiki>|caption
                </div></li>
 </ul>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg"><img alt="''x''" 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"/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt3" data-mw='{"attribs":[["alt",{"html":"alt=&lt;span typeof=\"mw:Nowiki\" data-parsoid=&apos;{\"dsr\":[22,44,8,9]}&apos;>&apos;&apos;x&apos;&apos;&lt;/span>","txt":"&apos;&apos;x&apos;&apos;"}]],"caption":"caption"}'><a href="./File:Foobar.jpg"><img alt="''x''" 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"/></a></figure-inline></p>
 
 <!-- consistency with gallery extension -->
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
-<li class="gallerybox">
-<div class="thumb"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="''x''" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt9" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
+<li class="gallerybox" style="width: 155px;">
+<div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=&lt;span typeof=\"mw:Nowiki\" data-parsoid=&apos;{\"dsr\":[130,152,8,9]}&apos;>&apos;&apos;x&apos;&apos;&lt;/span>","txt":"&apos;&apos;x&apos;&apos;"}]]}'><a href="./File:Foobar.jpg"><img alt="''x''" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div>
 <div class="gallerytext">caption</div>
 </li>
 </ul>
 !! end
 
+## FIXME: This test can be dropped when Parsoid content versions 2.0.0 / 1.8.0
+## are no longer in storage.
 !! test
 Ampersand in link attribute (T206940)
+!! options
+parsoid=html2wt
 !! wikitext
 [[File:Foobar.jpg|link=Foo &amp; bar]]
 
@@ -15391,10 +15209,6 @@ File:Foobar.jpg|link=Foo &amp; bar
 
 !! test
 Ampersand in link attribute (edited html, no data-parsoid) (T206940)
-!! options
-parsoid = {
-  "nativeGallery": true
-}
 !! wikitext
 [[File:Foobar.jpg|link=Foo_&_bar]]
 
@@ -15426,6 +15240,8 @@ File:Foobar.jpg|link=Foo_&_bar
 
 !! test
 Italics markup in link attribute (T206940)
+!! options
+parsoid=wt2html,html2html
 !! wikitext
 [[Foo''s bar''s]]
 
@@ -15469,7 +15285,7 @@ File:Foobar.jpg|link=''Main Page''|caption2
 <p><figure-inline class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"link","ak":"link=&apos;&apos;Main Page&apos;&apos;"},{"ck":"caption","ak":"caption2"}]}' data-mw='{"caption":"caption2"}'><a href="./Main_Page" data-parsoid='{"a":{"href":"./Main_Page"},"sa":{"href":"link=&apos;&apos;Main Page&apos;&apos;"}}'><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":"File:Foobar.jpg"}}'/></a></figure-inline></p>
 
 <!-- consistency with gallery extension -->
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{"extsrc":"\nFile:Foobar.jpg|link=Foo&apos;&apos;s bar&apos;&apos;s|caption1\nFile:Foobar.jpg|link=&apos;&apos;Main Page&apos;&apos;|caption2\n"}}'>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
 <li class="gallerybox">
 <div class="thumb"><figure-inline typeof="mw:Image"><a href="./Foos_bars"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div>
 <div class="gallerytext">caption1</div>
@@ -15481,8 +15297,12 @@ File:Foobar.jpg|link=''Main Page''|caption2
 </ul>
 !! end
 
+## FIXME: This test can be dropped when Parsoid content versions 2.0.0 / 1.8.0
+## are no longer in storage.
 !! test
 Nowiki markup in link attribute (T206940)
+!! options
+parsoid=html2wt
 !! wikitext
 [[File:Foobar.jpg|link=Foo<nowiki>''</nowiki>s_bar<nowiki>''</nowiki>s|caption]]
 
@@ -15516,10 +15336,6 @@ File:Foobar.jpg|link=Foo<nowiki>''</nowiki>s_bar<nowiki>''</nowiki>s|caption
 
 !! test
 Nowiki markup in link attribute (edited html, no data-parsoid) (T206940)
-!! options
-parsoid = {
-  "nativeGallery": true
-}
 !! wikitext
 [[File:Foobar.jpg|link=Foo<nowiki>''s_bar''</nowiki>s|caption]]
 
@@ -15574,7 +15390,7 @@ File:Foobar.jpg|link=https://example.com?foo&params=bar
 <p><figure-inline class="mw-default-size" typeof="mw:Image"><a href="https://example.com?foo&amp;params=bar"><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"/></a></figure-inline></p>
 
 <!-- consistency with gallery extension -->
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{"extsrc":"\nFile:Foobar.jpg|link=https://example.com?foo&amp;params=bar\n"}}'>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
 <li class="gallerybox">
 <div class="thumb"><figure-inline typeof="mw:Image"><a href="https://example.com?foo&amp;params=bar"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div>
 <div class="gallerytext"></div>
@@ -15650,7 +15466,6 @@ Image with heading and horizontal rule in caption
 ]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><h3><span class="mw-headline" id="Testing">Testing</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: Testing">edit</a><span class="mw-editsection-bracket">]</span></span></h3> 123 <hr /></div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"\n=== Testing ===\n123\n--------------\n"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{"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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>
 <h3 id="Testing">Testing</h3>
@@ -15697,7 +15512,6 @@ parsoid=wt2html,wt2wt,html2html
 <div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption">caption</div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption">caption</div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption">caption</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Frame"><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"/></a><figcaption>caption</figcaption></figure>
 <figure class="mw-default-size" typeof="mw:Image/Frame"><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"/></a><figcaption>caption</figcaption></figure>
@@ -15716,7 +15530,6 @@ parsoid=wt2html,wt2wt,html2html
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div>
-
 !! html/parsoid
 <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>caption</figcaption></figure>
 <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>caption</figcaption></figure>
@@ -15776,9 +15589,8 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|thumb|50px]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:52px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" decoding="async" width="50" height="6" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/75px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/100px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></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/50px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50"/></a></figure>
+<figure typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50"/></a><figcaption></figcaption></figure>
 !! end
 
 !! test
@@ -15792,10 +15604,9 @@ parsoid=wt2html,wt2wt,html2html
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:2002px;"><a href="/wiki/File:Foobar.svg" class="image"><img alt="Foobar.svg" src="http://example.com/images/thumb/f/ff/Foobar.svg/2000px-Foobar.svg.png" decoding="async" width="2000" height="1500" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/3000px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/4000px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"></a></div></div></div></div>
-
 !! html/parsoid
-<figure typeof="mw:Image/Thumb"><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"/></a></figure>
-<figure typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/thumb/f/ff/Foobar.svg/2000px-Foobar.svg.png" data-file-width="240" data-file-height="180" data-file-type="drawing" height="1500" width="2000"/></a></figure>
+<figure typeof="mw:Image/Thumb"><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"/></a><figcaption></figcaption></figure>
+<figure typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/thumb/f/ff/Foobar.svg/2000px-Foobar.svg.png" data-file-width="240" data-file-height="180" data-file-type="drawing" height="1500" width="2000"/></a><figcaption></figcaption></figure>
 !! end
 
 !! test
@@ -15845,12 +15656,11 @@ parsoid=wt2html,wt2wt,html2html
 <div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption"></div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption"></div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption"></div></div></div>
-
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Frame"><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"/></a></figure>
-<figure typeof="mw:Image/Frame"><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"/></a></figure>
-<figure typeof="mw:Image/Frame"><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"/></a></figure>
-<figure typeof="mw:Image/Frame"><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"/></a></figure>
+<figure class="mw-default-size" typeof="mw:Image/Frame"><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"/></a><figcaption></figcaption></figure>
+<figure typeof="mw:Image/Frame"><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"/></a><figcaption></figcaption></figure>
+<figure typeof="mw:Image/Frame"><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"/></a><figcaption></figcaption></figure>
+<figure typeof="mw:Image/Frame"><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"/></a><figcaption></figcaption></figure>
 !! end
 
 ###################
@@ -15894,7 +15704,6 @@ thumbsize=220
 [[File:Foobar.jpg|thumb|http://example.com]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
-
 !! html/parsoid
 <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><a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a></figcaption></figure>
 !! end
@@ -15908,7 +15717,6 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.jpg|thumb|http://example.com|alt=Alteration]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Alteration" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img alt="Alteration" 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><a rel="mw:ExtLink" class="external free" href="http://example.com">http://example.com</a></figcaption></figure>
 !! end
@@ -15920,7 +15728,6 @@ SVG thumbnails with no language set
 [[File:Foobar.svg|thumb|caption]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.svg" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" decoding="async" width="180" height="135" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"></a></div>caption</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/thumb/f/ff/Foobar.svg/220px-Foobar.svg.png" data-file-width="240" data-file-height="180" data-file-type="drawing" height="165" width="220"/></a><figcaption>caption</figcaption></figure>
 !! end
@@ -15933,7 +15740,6 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.svg|thumb|caption|lang=de]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=File:Foobar.svg&amp;lang=de" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/langde-180px-Foobar.svg.png" decoding="async" width="180" height="135" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/langde-270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/langde-360px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"></a></div>caption</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/thumb/f/ff/Foobar.svg/220px-Foobar.svg.png" lang="de" data-file-width="240" data-file-height="180" data-file-type="drawing" height="165" width="220"/></a><figcaption>caption</figcaption></figure>
 !! end
@@ -15946,7 +15752,6 @@ parsoid=wt2html,wt2wt,html2html
 [[File:Foobar.svg|thumb|caption|lang=invalid:language:code]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.svg" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/180px-Foobar.svg.png" decoding="async" width="180" height="135" class="thumbimage" srcset="http://example.com/images/thumb/f/ff/Foobar.svg/270px-Foobar.svg.png 1.5x, http://example.com/images/thumb/f/ff/Foobar.svg/360px-Foobar.svg.png 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.svg" class="internal" title="Enlarge"></a></div>lang=invalid:language:code</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/thumb/f/ff/Foobar.svg/220px-Foobar.svg.png" data-file-width="240" data-file-height="180" data-file-type="drawing" height="165" width="220"/></a><figcaption>lang=invalid:language:code</figcaption></figure>
 !! end
@@ -15979,7 +15784,6 @@ T3887: A ISBN with a thumbnail
 [[File:Foobar.jpg|thumb|ISBN 1235467890]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a href="/wiki/Special:BookSources/1235467890" class="internal mw-magiclink-isbn">ISBN 1235467890</a></div></div></div>
-
 !! html/parsoid
 <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><a href="./Special:BookSources/1235467890" rel="mw:WikiLink">ISBN 1235467890</a></figcaption></figure>
 !! end
@@ -15990,7 +15794,6 @@ T3887: A RFC with a thumbnail
 [[File:Foobar.jpg|thumb|This is RFC 12354]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is <a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc12354">RFC 12354</a></div></div></div>
-
 !! html/parsoid
 <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>This is <a href="https://tools.ietf.org/html/rfc12354" rel="mw:ExtLink" class="external mw-magiclink">RFC 12354</a></figcaption></figure>
 !! end
@@ -16001,7 +15804,6 @@ T3887: A mailto link with a thumbnail
 [[File:Foobar.jpg|thumb|Please mailto:nobody@example.com]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Please <a rel="nofollow" class="external free" href="mailto:nobody@example.com">mailto:nobody@example.com</a></div></div></div>
-
 !! html/parsoid
 <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>Please <a rel="mw:ExtLink" class="external free" href="mailto:nobody@example.com">mailto:nobody@example.com</a></figcaption></figure>
 !! end
@@ -16091,7 +15893,7 @@ Entities in file name and attributes
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=7%25_solution.gif" class="new" title="File:7% solution.gif">7% solution</a>
 </p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"bogus","ak":"manualthumb=7%25 solution.gif"},{"ck":"link","ak":"link=7%25 solution"},{"ck":"caption","ak":"[[7%25 solution]]"}]}' data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}],"caption":"&lt;a rel=\"mw:WikiLink\" href=\"./7%25_solution\" title=\"7% solution\" data-parsoid=&#39;{\"stx\":\"simple\",\"a\":{\"href\":\"./7%25_solution\"},\"sa\":{\"href\":\"7%25 solution\"},\"dsr\":[74,91,2,2]}&#39;>7% solution&lt;/a>"}'><a href="./7%25_solution" data-parsoid='{"a":{"href":"./7%25_solution"},"sa":{"href":"link=7%25 solution"}}'><img resource="./File:7%25_solution.gif" src="./Special:FilePath/7%25_solution.gif" height="220" width="220" data-parsoid='{"a":{"resource":"./File:7%25_solution.gif","height":"220","width":"220"},"sa":{"resource":"File:7%25 solution.gif"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"bogus","ak":"manualthumb=7%25 solution.gif"},{"ck":"link","ak":"link=7%25 solution"},{"ck":"caption","ak":"[[7%25 solution]]"}]}' data-mw='{"attribs":[["link",{"txt":"7%25 solution"}]],"caption":"&lt;a rel=\"mw:WikiLink\" href=\"./7%25_solution\" title=\"7% solution\" data-parsoid=&apos;{\"stx\":\"simple\",\"a\":{\"href\":\"./7%25_solution\"},\"sa\":{\"href\":\"7%25 solution\"},\"dsr\":[74,91,2,2]}&apos;>7% solution&lt;/a>","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/7%25_solution.gif"><span resource="./File:7%25_solution.gif" data-parsoid='{"a":{"resource":"./File:7%25_solution.gif"},"sa":{"resource":"File:7%25 solution.gif"}}'>File:7% solution.gif</span></a></figure-inline></p>
 !! end
 
 !! test
@@ -16124,7 +15926,6 @@ Image caption containing another image
 [[File:Foobar.jpg|thumb|This is a caption with another [[File:Thumb.png|image]] inside it!]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is a caption with another <a href="/wiki/File:Thumb.png" class="image" title="image"><img alt="image" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" /></a> inside it!</div></div></div>
-
 !! html/parsoid
 <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>This is a caption with another <figure-inline class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"image"}'><a href="./File:Thumb.png"><img resource="./File:Thumb.png" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a></figure-inline> inside it!</figcaption></figure>
 !! end
@@ -16148,7 +15949,6 @@ Image: caption containing leading space
 [[File:Foobar.jpg|thumb| bar]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>bar</div></div></div>
-
 !! html/parsoid
 <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
@@ -16171,7 +15971,6 @@ parsoid=wt2html,wt2wt,html2html
 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" decoding="async" 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>
@@ -16188,7 +15987,6 @@ T5090: External links other than http: in image captions
 [[File:Foobar.jpg|thumb|200x200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]]
 !! 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" decoding="async" 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 caption has <a rel="nofollow" class="external text" href="irc://example.net">irc</a> and <a rel="nofollow" class="external text" href="https://example.com">Secure</a> ext links in it.</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 caption has <a rel="mw:ExtLink" class="external text" href="irc://example.net">irc</a> and <a rel="mw:ExtLink" class="external text" href="https://example.com">Secure</a> ext links in it.</figcaption></figure>
 !! end
@@ -16215,7 +16013,6 @@ language=es
 [[Archivo:Foobar.jpg|izquierda|enlace=foo|caption]]
 !! html/php
 <div class="floatleft"><a href="/wiki/Foo" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-left" typeof="mw:Image"><a href="./Foo"><img resource="./Archivo: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"/></a><figcaption>caption</figcaption></figure>
 !! end
@@ -16230,7 +16027,6 @@ language=es
 [[Archivo:Foobar.jpg|miniatura|izquierda|enlace=foo|caption]]
 !! html/php
 <div class="thumb tleft"><div class="thumbinner" style="width:222px;"><a href="/wiki/Foo" title="Foo"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/Archivo:Foobar.jpg" class="internal" title="Aumentar"></a></div>caption</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><a href="./Foo"><img resource="./Archivo: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>caption</figcaption></figure>
 !! end
@@ -16276,7 +16072,6 @@ parsoid=wt2html,wt2wt,html2html
 <div class="thumb tleft"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div>
 <div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div>
 <div class="thumb tleft"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" decoding="async" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size mw-halign-left" 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>caption</figcaption></figure>
 <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>caption</figcaption></figure>
@@ -16300,6 +16095,7 @@ Redirected image
 </p>
 !! end
 
+## FIXME: Parsoid needs to learn about this flag.
 !! test
 Missing image with uploads disabled
 !! options
@@ -16310,7 +16106,7 @@ wgEnableUploads=0
 <p><a href="/wiki/File:Foobaz.jpg" title="File:Foobaz.jpg">File:Foobaz.jpg</a>
 </p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./File:Foobaz.jpg"><img resource="./File:Foobaz.jpg" src="./Special:FilePath/Foobaz.jpg" height="220" width="220"/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Foobaz.jpg"><span resource="./File:Foobaz.jpg">File:Foobaz.jpg</span></a></figure-inline></p>
 !! end
 
 # Parsoid-specific testing for images
@@ -17128,7 +16924,6 @@ parsoid=wt2html,html2html
 !! html/php
 <div>a
 <a href="/wiki/Foo" title="Foo">Foo</a></div>
-
 !! html/parsoid
 <link rel="mw:PageProp/Category" href="./Category:Foo"/><div>a
 
@@ -17384,7 +17179,6 @@ Some text
 <p>Some text
 </p>
 <h3><span class="mw-headline" id="Another_headline">Another headline</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: Another headline">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
-
 !! end
 
 !! test
@@ -17409,7 +17203,6 @@ __FORCETOC__
 <h2><span class="mw-headline" id="Headline">Headline</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: Headline">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Headline_2_2">Headline 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Headline 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Headline_3">Headline</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: Headline">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
@@ -17470,7 +17263,6 @@ parsoid=wt2html
 <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>
@@ -17520,7 +17312,6 @@ TOC regression (T11764)
 <h3><span class="mw-headline" id="title_1.2">title 1.2</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: title 1.2">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
 <h2><span class="mw-headline" id="title_2">title 2</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: title 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h3><span class="mw-headline" id="title_2.1">title 2.1</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: title 2.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
-
 !! end
 
 !! test
@@ -17536,7 +17327,6 @@ __FORCETOC__
 </div>
 
 <h2><span class="mw-headline" id="New_title"><span id="old-anchor"></span>New title</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: New title">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 !! test
@@ -17573,7 +17363,6 @@ wgMaxTocLevel=3
 <h3><span class="mw-headline" id="title_1.2">title 1.2</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: title 1.2">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
 <h2><span class="mw-headline" id="title_2">title 2</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: title 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h3><span class="mw-headline" id="title_2.1">title 2.1</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: title 2.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
-
 !! end
 
 !! test
@@ -17603,7 +17392,6 @@ wgMaxTocLevel=3
 <h4><span class="mw-headline" id="Section_1.1.1">Section 1.1.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Section 1.1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h4>
 <h4><span class="mw-headline" id="Section_1.1.1.1">Section 1.1.1.1</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: Section 1.1.1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h4>
 <h2><span class="mw-headline" id="Section_2">Section 2</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: Section 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 
@@ -17615,7 +17403,6 @@ Resolving duplicate section names
 !! 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>
-
 !! end
 
 !! test
@@ -17626,7 +17413,6 @@ Resolving duplicate section names with differing case (T12721)
 !! 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>
-
 !! end
 
 !! article
@@ -17648,7 +17434,6 @@ __NOTOC__
 <h3><span class="mw-headline" id="Section_1">Section 1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=T-1" title="Template:Sections">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
 <h2><span class="mw-headline" id="Section_2">Section 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Template:Sections&amp;action=edit&amp;section=T-2" title="Template:Sections">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Section_4">Section 4</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: Section 4">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 !! test
@@ -17660,7 +17445,6 @@ __NOEDITSECTION__
 !! html
 <h2><span class="mw-headline" id="Section_1">Section 1</span></h2>
 <h2><span class="mw-headline" id="Section_2">Section 2</span></h2>
-
 !! end
 
 !! test
@@ -17669,7 +17453,6 @@ Link inside a section heading
 ==Section with a [[Main Page|link]] in it==
 !! html
 <h2><span class="mw-headline" id="Section_with_a_link_in_it">Section with a <a href="/wiki/Main_Page" title="Main Page">link</a> in it</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: Section with a link in it">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 !! test
@@ -17694,7 +17477,6 @@ __TOC__
 <h2><span class="mw-headline" id="title_1">title 1</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: title 1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h3><span class="mw-headline" id="title_1.1">title 1.1</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: title 1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
 <h2><span class="mw-headline" id="title_2">title 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: title 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 !! test
@@ -17921,7 +17703,6 @@ parsoid=wt2html,wt2wt,html2html
 <h1><span class="mw-headline" id=".3Dfoo">=foo</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">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 <h1><span class="mw-headline" id="italic_heading.3D"><i>italic</i> heading=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: italic heading=">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 <h1><span class="mw-headline" id=".3Ditalic_heading">=<i>italic</i> 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: =italic heading">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
-
 !! html/parsoid
 <h1 id="foo="><span id="foo.3D" typeof="mw:FallbackId"></span>foo=</h1>
 <h1 id="=foo"><span id=".3Dfoo" typeof="mw:FallbackId"></span>=foo</h1>
@@ -17967,7 +17748,6 @@ __NOEDITSECTION__
 </span></h1>
 <h2><span class="mw-headline" id="Header_2.1">Header 2.1</span></h2>
 <h2><span class="mw-headline" id="Header_2.2">Header 2.2</span></h2>
-
 !! html/parsoid
 <h1 id="Header_1" data-parsoid='{"stx":"html"}'>Header 1</h1>
 <h2 id="Header_1.1" data-parsoid='{}'>Header 1.1</h2>
@@ -17994,7 +17774,6 @@ c3-->
 <h2><span class="mw-headline" id="foo">foo</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">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="bar">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: bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="baz">baz</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: baz">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <h2 id="foo">foo</h2><!---->
 <h2 id="bar">bar</h2><!--c1-->
@@ -18053,7 +17832,6 @@ div with no attributes
 <div>HTML rocks</div>
 !! html
 <div>HTML rocks</div>
-
 !! end
 
 !! test
@@ -18062,7 +17840,6 @@ div with double-quoted attribute
 <div id="rock">HTML rocks</div>
 !! html
 <div id="rock">HTML rocks</div>
-
 !! end
 
 !! test
@@ -18071,7 +17848,6 @@ div with single-quoted attribute
 <div id='rock'>HTML rocks</div>
 !! html
 <div id="rock">HTML rocks</div>
-
 !! end
 
 !! test
@@ -18080,7 +17856,6 @@ div with unquoted attribute
 <div id=rock>HTML rocks</div>
 !! html
 <div id="rock">HTML rocks</div>
-
 !! end
 
 !! test
@@ -18089,8 +17864,7 @@ div with illegal double attributes
 <div id="a" id="b">HTML rocks</div>
 !! html
 <div id="b">HTML rocks</div>
-
-!!end
+!! end
 
 !! test
 div with empty attribute value, space before equals
@@ -18100,7 +17874,6 @@ parsoid=wt2html,html2html
 <div class =>HTML rocks</div>
 !! html/php
 <div class="">HTML rocks</div>
-
 !! html/parsoid
 <div class="" data-parsoid='{"stx":"html"}'>HTML rocks</div>
 !! end
@@ -18115,7 +17888,6 @@ parsoid=wt2html,html2html
 <div id= title=>HTML rocks</div>
 !! html/php
 <div id="title=">HTML rocks</div>
-
 !! html/parsoid
 <div id="title=" data-parsoid='{"stx":"html"}'>HTML rocks</div>
 !! end
@@ -18147,7 +17919,6 @@ parsoid=wt2html,html2html
 <tr>
 <td>hi
 </td></tr></table>
-
 !! html/parsoid
 <table title="id=">
 <tbody><tr><td>hi</td></tr>
@@ -18160,7 +17931,6 @@ div with braces in attribute value
 <div title="{}">Foo</div>
 !! html/php
 <div title="&#123;&#125;">Foo</div>
-
 !! html/parsoid
 <div title="{}">Foo</div>
 !! end
@@ -18173,7 +17943,6 @@ parsoid=wt2html,html2html
 <div class=>HTML rocks</div>
 !! html/php
 <div class="">HTML rocks</div>
-
 !! html/parsoid
 <div class="">HTML rocks</div>
 !! end
@@ -18184,8 +17953,7 @@ HTML multiple attributes correction
 <p class="error" class="awesome">Awesome!</p>
 !! html
 <p class="awesome">Awesome!</p>
-
-!!end
+!! end
 
 !! test
 Table multiple attributes correction
@@ -18198,8 +17966,7 @@ Table multiple attributes correction
 <tr>
 <th class="awesome">status
 </th></tr></table>
-
-!!end
+!! end
 
 !! test
 DIV IN UPPERCASE
@@ -18207,8 +17974,7 @@ DIV IN UPPERCASE
 <DIV ID="x">HTML ROCKS</DIV>
 !! html
 <div id="x">HTML ROCKS</div>
-
-!!end
+!! end
 
 !! test
 Non-ASCII pseudo-tags are rendered as text
@@ -18297,7 +18063,6 @@ parsoid=wt2html
 !! html/php
 <div style="style=">hi</div>
 <div>ho</div>
-
 !! html/parsoid
 <div style=" style=" data-parsoid='{"stx":"html","a":{"123\"":null},"sa":{"123\"":""}}'>hi</div>
 <div data-parsoid='{"stx":"html","a":{"=":null},"sa":{"=":""}}'>ho</div>
@@ -18439,7 +18204,6 @@ parsoid=wt2html,html2html
 [[Media:Foobar.jpg|Safe Link<div style=display:none>" onmouseover="alert(document.cookie)" onfoo="</div>]]
 !! 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><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
@@ -18514,7 +18278,7 @@ Image link to nonexistent file (T3850 - good)
 <p><a href="/index.php?title=Special:Upload&amp;wpDestFile=No_such.jpg" class="new" title="File:No such.jpg">File:No such.jpg</a>
 </p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./File:No_such.jpg"><img resource="./File:No_such.jpg" src="./Special:FilePath/No_such.jpg" height="220" width="220"/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/No_such.jpg"><span resource="./File:No_such.jpg">File:No such.jpg</span></a></figure-inline></p>
 !! end
 
 !! test
@@ -18692,7 +18456,6 @@ T4304: HTML attribute safety (safe template; regression T4309)
 <div title="{{test}}"></div>
 !! html/php
 <div title="This is a test template"></div>
-
 !! html/parsoid
 <div title="This is a test template" about="#mwt2" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"title":"This is a test template"},"sa":{"title":"{{test}}"}}' data-mw='{"attribs":[[{"txt":"title"},{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[12,20,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"test\",\"href\":\"./Template:Test\"},\"params\":{},\"i\":0}}]}&#39;>This is a test template&lt;/span>"}]]}'></div>
 !! end
@@ -18704,7 +18467,6 @@ T4304: HTML attribute safety (dangerous template; 2309)
 <div title="{{dangerous attribute}}"></div>
 !! html/php
 <div title=""></div>
-
 !! html/parsoid
 <div title='" onmouseover="alert(document.cookie)' about="#mwt2" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"title":"\" onmouseover=\"alert(document.cookie)"},"sa":{"title":"{{dangerous attribute}}"}}' data-mw='{"attribs":[[{"txt":"title"},{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[12,35,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"dangerous attribute\",\"href\":\"./Template:Dangerous_attribute\"},\"params\":{},\"i\":0}}]}&#39;>\" onmouseover=\"alert(document.cookie)&lt;/span>"}]]}'></div>
 !! end
@@ -18715,7 +18477,6 @@ T4304: HTML attribute safety (dangerous style template; 2309)
 <div style="{{dangerous style attribute}}"></div>
 !! html/php
 <div style="/* insecure input */"></div>
-
 !! html/parsoid
 <div style="/* insecure input */" about="#mwt2" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"{{dangerous style attribute}}"}}' data-mw='{"attribs":[[{"txt":"style"},{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[12,41,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"dangerous style attribute\",\"href\":\"./Template:Dangerous_style_attribute\"},\"params\":{},\"i\":0}}]}&#39;>border-size: expression(alert(document.cookie))&lt;/span>"}]]}'></div>
 !! end
@@ -18726,7 +18487,6 @@ T4304: HTML attribute safety (safe parameter; 2309)
 {{div style|width: 200px}}
 !! html/php
 <div style="float: right; width: 200px">Magic div</div>
-
 !! html/parsoid
 <div style="float: right; width: 200px" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","a":{"style":"float: right; width: 200px"},"sa":{"style":"float: right; {{{1}}}"},"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"div style","href":"./Template:Div_style"},"params":{"1":{"wt":"width: 200px"}},"i":0}}]}'>Magic div</div>
 !! end
@@ -18737,7 +18497,6 @@ T4304: HTML attribute safety (unsafe parameter; 2309)
 {{div style|width: expression(alert(document.cookie))}}
 !! html/php
 <div style="/* insecure input */">Magic div</div>
-
 !! html/parsoid
 <div style="/* insecure input */" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"float: right; {{{1}}}"},"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"div style","href":"./Template:Div_style"},"params":{"1":{"wt":"width: expression(alert(document.cookie))"}},"i":0}}]}'>Magic div</div>
 !! end
@@ -18749,7 +18508,6 @@ T4304: HTML attribute safety (unsafe breakout parameter; 2309)
 {{div style|"><script>alert(document.cookie)</script>}}
 !! html
 <div style="float: right;">&lt;script&gt;alert(document.cookie)&lt;/script&gt;"&gt;Magic div</div>
-
 !! end
 
 ## Parsoid output here differs; needs investigation.
@@ -18759,7 +18517,6 @@ T4304: HTML attribute safety (unsafe breakout parameter 2; 2309)
 {{div style|" ><script>alert(document.cookie)</script>}}
 !! html
 <div style="float: right;">&lt;script&gt;alert(document.cookie)&lt;/script&gt;"&gt;Magic div</div>
-
 !! end
 
 !! test
@@ -18768,7 +18525,6 @@ T4304: HTML attribute safety (link)
 <div title="[[Main Page]]"></div>
 !! html/php
 <div title="&#91;&#91;Main Page&#93;&#93;"></div>
-
 !! html/parsoid
 <div title="[[Main Page]]"></div>
 !! end
@@ -18779,7 +18535,6 @@ T4304: HTML attribute safety (italics)
 <div title="''foobar''"></div>
 !! html
 <div title="&#39;&#39;foobar&#39;&#39;"></div>
-
 !! end
 
 !! test
@@ -18788,7 +18543,6 @@ T4304: HTML attribute safety (bold)
 <div title="'''foobar'''"></div>
 !! html
 <div title="&#39;&#39;&#39;foobar&#39;&#39;&#39;"></div>
-
 !! end
 
 !! test
@@ -18797,7 +18551,6 @@ T4304: HTML attribute safety (ISBN)
 <div title="ISBN 1234567890"></div>
 !! html
 <div title="&#73;SBN 1234567890"></div>
-
 !! end
 
 !! test
@@ -18806,7 +18559,6 @@ T4304: HTML attribute safety (RFC)
 <div title="RFC 1234"></div>
 !! html
 <div title="&#82;FC 1234"></div>
-
 !! end
 
 !! test
@@ -18815,7 +18567,6 @@ T4304: HTML attribute safety (PMID)
 <div title="PMID 1234567890"></div>
 !! html
 <div title="&#80;MID 1234567890"></div>
-
 !! end
 
 !! test
@@ -18824,7 +18575,6 @@ T4304: HTML attribute safety (web link)
 <div title="http://example.com/"></div>
 !! html
 <div title="http&#58;//example.com/"></div>
-
 !! end
 
 !! test
@@ -18833,7 +18583,6 @@ T4304: HTML attribute safety (named web link)
 <div title="[http://example.com/ link]"></div>
 !! html/php
 <div title="&#91;http&#58;//example.com/ link&#93;"></div>
-
 !! html/parsoid
 <div title="[http://example.com/ link]"></div>
 !! end
@@ -18844,7 +18593,6 @@ T5244: HTML attribute safety (extension; safe)
 <div style="<nowiki>background:blue</nowiki>"></div>
 !! html/php
 <div style="background:blue"></div>
-
 !! html/parsoid
 <div style="background:blue" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"style":"background:blue"},"sa":{"style":"&lt;nowiki>background:blue&lt;/nowiki>"}}' data-mw='{"attribs":[[{"txt":"style"},{"html":"&lt;span typeof=\"mw:Nowiki\" data-parsoid=&apos;{\"dsr\":[12,44,8,9]}&apos;>background:blue&lt;/span>"}]]}'></div>
 !! end
@@ -18855,7 +18603,6 @@ T5244: HTML attribute safety (extension; unsafe)
 <div style="<nowiki>border-left:expression(alert(document.cookie))</nowiki>"></div>
 !! html/php
 <div style="/* insecure input */"></div>
-
 !! html/parsoid
 <div style="/* insecure input */" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"&lt;nowiki>border-left:expression(alert(document.cookie))&lt;/nowiki>"}}' data-mw='{"attribs":[[{"txt":"style"},{"html":"&lt;span typeof=\"mw:Nowiki\" data-parsoid=&apos;{\"dsr\":[12,75,8,9]}&apos;>border-left:expression(alert(document.cookie))&lt;/span>"}]]}'></div>
 !! end
@@ -18868,7 +18615,6 @@ MSIE CSS safety test: spurious slash
 <div style="background-image:u\rl(javascript:alert('boo'))">evil</div>
 !! html/php
 <div style="/* insecure input */">evil</div>
-
 !! html/parsoid
 <div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:u\\rl(javascript:alert(&#39;boo&#39;))"}}'>evil</div>
 !! end
@@ -18879,7 +18625,6 @@ MSIE CSS safety test: hex code
 <div style="background-image:u\72l(javascript:alert('boo'))">evil</div>
 !! html/php
 <div style="/* insecure input */">evil</div>
-
 !! html/parsoid
 <div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:u\\72l(javascript:alert(&#39;boo&#39;))"}}'>evil</div>
 !! end
@@ -18890,7 +18635,6 @@ MSIE CSS safety test: comment in url
 <div style="background-image:u/**/rl(javascript:alert('boo'))">evil</div>
 !! html/php
 <div style="background-image:u rl(javascript:alert(&#39;boo&#39;))">evil</div>
-
 !! html/parsoid
 <div style="background-image:u rl(javascript:alert('boo'))" data-parsoid='{"stx":"html","a":{"style":"background-image:u rl(javascript:alert(&#39;boo&#39;))"},"sa":{"style":"background-image:u/**/rl(javascript:alert(&#39;boo&#39;))"}}'>evil</div>
 !! end
@@ -18901,7 +18645,6 @@ MSIE CSS safety test: comment in expression
 <div style="background-image:expres/**/sion(alert('boo4'))">evil4</div>
 !! html/php
 <div style="background-image:expres sion(alert(&#39;boo4&#39;))">evil4</div>
-
 !! html/parsoid
 <div style="background-image:expres sion(alert('boo4'))" data-parsoid='{"stx":"html","a":{"style":"background-image:expres sion(alert(&#39;boo4&#39;))"},"sa":{"style":"background-image:expres/**/sion(alert(&#39;boo4&#39;))"}}'>evil4</div>
 !! end
@@ -18912,7 +18655,6 @@ CSS safety test (all browsers): vertical tab (T57332 / CVE-2013-4567)
 <p style="font-size: 100px; background-image:url\b(https://www.google.com/images/srpr/logo6w.png)">A</p>
 !! html/php
 <p style="/* invalid control char */">A</p>
-
 !! html/parsoid
 <p style="/* invalid control char */" data-parsoid='{"stx":"html","a":{"style":"/* invalid control char */"},"sa":{"style":"font-size: 100px; background-image:url\\b(https://www.google.com/images/srpr/logo6w.png)"}}'>A</p>
 !! end
@@ -18925,7 +18667,6 @@ MSIE 6 CSS safety test: Fullwidth (T57332)
 !! html/php
 <p style="/* insecure input */">A</p>
 <div style="/* insecure input */">B</div>
-
 !! html/parsoid
 <p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expression((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>A</p>
 <div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"top:EXPRESSION(alert())"}}'>B</div>
@@ -18939,7 +18680,6 @@ MSIE 6 CSS safety test: IPA extensions (T57332)
 !! html/php
 <div style="/* insecure input */">A</div>
 <p style="/* insecure input */">B</p>
-
 !! html/parsoid
 <div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:uʀʟ(javascript:alert())"}}'>A</div>
 <p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expʀessɪoɴ((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>B</p>
@@ -18955,7 +18695,6 @@ MSIE 6 CSS safety test: sup/sub script (T57332)
 <div style="/* insecure input */">A</div>
 <div style="/* insecure input */">B</div>
 <p style="/* insecure input */">C</p>
-
 !! html/parsoid
 <div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:url⁽javascript:alert())"}}'>A</div>
 <div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:url₍javascript:alert())"}}'>B</div>
@@ -18972,7 +18711,6 @@ title="&#100;&#97;&#116;&#97;&#58;&#116;&#101;&#120;&#116;&#47;&#104;&#116;&#109
 style="-o-link:attr(title);-o-link-source:current">X</div>
 !! html/php
 <div title="data:text/html,&lt;img src=1 onerror=alert(1)&gt;" style="/* insecure input */">X</div>
-
 !! html/parsoid
 <div title="data:text/html,&lt;img src=1 onerror=alert(1)>" style="/* insecure input */" data-parsoid='{"stx":"html","a":{"title":"data:text/html,&lt;img src=1 onerror=alert(1)>","style":"/* insecure input */"},"sa":{"title":"&amp;#100;&amp;#97;&amp;#116;&amp;#97;&amp;#58;&amp;#116;&amp;#101;&amp;#120;&amp;#116;&amp;#47;&amp;#104;&amp;#116;&amp;#109;&amp;#108;&amp;#44;&amp;#60;&amp;#105;&amp;#109;&amp;#103;&amp;#32;&amp;#115;&amp;#114;&amp;#99;&amp;#61;&amp;#49;&amp;#32;&amp;#111;&amp;#110;&amp;#101;&amp;#114;&amp;#114;&amp;#111;&amp;#114;&amp;#61;&amp;#97;&amp;#108;&amp;#101;&amp;#114;&amp;#116;&amp;#40;&amp;#49;&amp;#41;&amp;#62;","style":"-o-link:attr(title);-o-link-source:current"}}'>X</div>
 !! end
@@ -18995,7 +18733,6 @@ MSIE 6 CSS safety test: Repetition markers (T57332)
 <p style="/* insecure input */">E</p>
 <p style="/* insecure input */">F</p>
 <p style="/* insecure input */">G</p>
-
 !! html/parsoid
 <p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expres〱ion((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>A</p>
 <p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresゝion((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>B</p>
@@ -19017,8 +18754,7 @@ Table attribute legitimate extension
 <tr>
 <th style="color:blue">status
 </th></tr></table>
-
-!!end
+!! end
 
 !! test
 Table attribute safety
@@ -19031,7 +18767,6 @@ Table attribute safety
 <tr>
 <th style="/* insecure input */">status
 </th></tr></table>
-
 !! end
 
 !! test
@@ -19040,7 +18775,6 @@ CSS line continuation 1
 <div style="background-image: u\&#10;rl(test.jpg);"></div>
 !! html
 <div style="/* insecure input */"></div>
-
 !! end
 
 !! test
@@ -19049,7 +18783,6 @@ CSS line continuation 2
 <div style="background-image: u\&#13;rl(test.jpg); "></div>
 !! html
 <div style="/* invalid control char */"></div>
-
 !! end
 
 !! article
@@ -19064,7 +18797,6 @@ Expansion of multi-line templates in attribute values (T8255)
 <div style="background: {{identity|#00FF00}}">-</div>
 !! html
 <div style="background: #00FF00">-</div>
-
 !! end
 
 !! test
@@ -19074,7 +18806,6 @@ Expansion of multi-line templates in attribute values (T8255 sanity check)
 #00FF00">-</div>
 !! html/php
 <div style="background: #00FF00">-</div>
-
 !! html/parsoid
 <div style="background:
 #00FF00">-</div>
@@ -19086,7 +18817,6 @@ Expansion of multi-line templates in attribute values (T8255 sanity check 2)
 <div style="background: &#10;#00FF00">-</div>
 !! html
 <div style="background: &#10;#00FF00">-</div>
-
 !! end
 
 !! test
@@ -19112,7 +18842,6 @@ Parser hook: empty input
 array (
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" data-mw='{"name":"tag","attrs":{},"body":{"extsrc":""}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -19130,7 +18859,6 @@ NULL
 array (
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" data-mw='{"name":"tag","attrs":{}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -19145,7 +18873,6 @@ NULL
 array (
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" data-mw='{"name":"tag","attrs":{}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -19160,7 +18887,6 @@ Parser hook: basic input
 array (
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" data-mw='{"name":"tag","attrs":{},"body":{"extsrc":"input"}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -19178,7 +18904,6 @@ parsoid=wt2html,html2html
 array (
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" data-mw='{"name":"tag","attrs":{},"body":{"extsrc":"input"}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -19196,7 +18921,6 @@ parsoid=wt2html,html2html
 array (
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" data-mw='{"name":"tag","attrs":{},"body":{"extsrc":"input"}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -19213,13 +18937,11 @@ parsoid=wt2html
 array (
 )
 </pre>&lt;/tag&gt;
-
 !! html/php+tidy
 <pre>'<tag>'
 array (
 )
-</tag></pre><p>&lt;/tag&gt;
-</p>
+</tag></pre><p>&lt;/tag&gt;</p>
 !! html/parsoid
 <pre typeof="mw:Extension/tag" about="#mwt2" data-mw='{"name":"tag","attrs":{},"body":{"extsrc":"&lt;tag>"}}'></pre><p>&lt;/tag></p>
 !! end
@@ -19238,7 +18960,6 @@ array (
   'square' => '',
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" data-mw='{"name":"tag","attrs":{"width":"200","height":"100","depth":"50","square":""},"body":{"extsrc":""}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -19260,7 +18981,6 @@ array (
   'square' => '',
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" data-mw='{"name":"tag","attrs":{"width":"200","height":"100","depth":"50","square":""},"body":{"extsrc":""}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -19276,7 +18996,6 @@ array (
   'filename' => '/tmp/bla',
 )
 </pre>
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" data-mw='{"name":"tag","attrs":{"filename":"/tmp/bla"},"body":{"extsrc":""}}' data-parsoid='{}' about="#mwt2"></pre>
 !! end
@@ -19295,7 +19014,6 @@ array (
   'foo' => 'bar',
 )
 </pre>text
-
 !! html/parsoid
 <pre typeof="mw:Extension/tag" about="#mwt2" data-mw='{"name":"tag","attrs":{"foo":"bar"}}'></pre><p>text</p>
 !! end
@@ -19365,7 +19083,6 @@ Goodbye
 array (
 )
 </pre>
-
 !! end
 
 ###
@@ -19466,8 +19183,7 @@ parsoid=wt2html
 !! wikitext
 Table not started</td></tr></table>
 !! html+tidy
-<p>Table not started
-</p>
+<p>Table not started</p>
 !! end
 
 !! test
@@ -19540,7 +19256,6 @@ Sanitizer: Validating that <meta> and <link> work, but only for Microdata
        <link itemprop="hello" href="http&#58;//example.org" />
 </p>
 </div>
-
 !! end
 
 !! test
@@ -19627,7 +19342,7 @@ language=sr variant=sr-el
 !! html/parsoid
 <p><meta typeof="mw:LanguageVariant" data-mw-variant='{"add":true,"oneway":[{"f":"foAjrjvi","l":"sr-el","t":"\" onload=\"alert(1)\" data-foo=\""}]}'/></p>
 
-<p><figure-inline class="mw-default-size" typeof="mw:Image"><a href="./Датотека:Foobar.jpg"><img alt="foAjrjvi" resource="./Датотека: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":{"alt":"foAjrjvi","resource":"./Датотека:Foobar.jpg","height":"220","width":"1941"},"sa":{"alt":"alt=-{}-foAjrjvi-{}-","resource":"File:Foobar.jpg"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt1" data-mw='{"attribs":[["alt",{"html":"alt=&lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&apos;{\"disabled\":{\"t\":\"\"}}&apos; data-parsoid=&apos;{\"fl\":[],\"dsr\":[76,80,null,2]}&apos;>&lt;/span>foAjrjvi&lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&apos;{\"disabled\":{\"t\":\"\"}}&apos; data-parsoid=&apos;{\"fl\":[],\"dsr\":[88,92,null,2]}&apos;>&lt;/span>","txt":"foAjrjvi"}]]}'><a href="./Датотека:Foobar.jpg"><img alt="foAjrjvi" resource="./Датотека: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":"./Датотека:Foobar.jpg","height":"220","width":"1941"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></figure-inline></p>
 !! end
 
 !! test
@@ -19655,8 +19370,7 @@ Punctuation: CSS !important (T13874)
 <div style="width:50% !important">important</div>
 !! html
 <div style="width:50% !important">important</div>
-
-!!end
+!! end
 
 !! test
 Punctuation: CSS ! important (T13874; with space after)
@@ -19664,8 +19378,7 @@ Punctuation: CSS ! important (T13874; with space after)
 <div style="width:50% ! important">important</div>
 !! html
 <div style="width:50%&#32;! important">important</div>
-
-!!end
+!! end
 
 !! test
 HTML bullet list, closed tags (T7497)
@@ -19679,13 +19392,11 @@ HTML bullet list, closed tags (T7497)
 <li>One</li>
 <li>Two</li>
 </ul>
-
 !! html/parsoid
 <ul data-parsoid='{"stx":"html"}'>
 <li data-parsoid='{"stx":"html"}'>One</li>
 <li data-parsoid='{"stx":"html"}'>Two</li>
 </ul>
-
 !! end
 
 !! test
@@ -19705,7 +19416,6 @@ HTML bullet list, unclosed tags (T7497)
 <li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>One</li>
 <li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>Two</li>
 </ul>
-
 !! end
 
 !! test
@@ -19720,13 +19430,11 @@ HTML ordered list, closed tags (T7497)
 <li>One</li>
 <li>Two</li>
 </ol>
-
 !! html/parsoid
 <ol data-parsoid='{"stx":"html"}'>
 <li data-parsoid='{"stx":"html"}'>One</li>
 <li data-parsoid='{"stx":"html"}'>Two</li>
 </ol>
-
 !! end
 
 !! test
@@ -19747,7 +19455,6 @@ HTML ordered list, unclosed tags (T7497)
 <li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>One</li>
 <li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>Two</li>
 </ol>
-
 !! end
 
 !! test
@@ -19772,7 +19479,6 @@ HTML nested bullet list, closed tags (T7497)
 </ul>
 </li>
 </ul>
-
 !! html/parsoid
 <ul data-parsoid='{"stx":"html"}'>
 <li data-parsoid='{"stx":"html"}'>One</li>
@@ -19829,7 +19535,6 @@ HTML nested ordered list, closed tags (T7497)
 </ol>
 </li>
 </ol>
-
 !! end
 
 !! test
@@ -19852,7 +19557,6 @@ HTML nested ordered list, open tags (T7497)
 <li>Sub-two
 </ol>
 </ol>
-
 !! html/parsoid
 <ol>
 <li>One
@@ -19866,7 +19570,6 @@ HTML nested ordered list, open tags (T7497)
 </ol>
 </li>
 </ol>
-
 !! end
 
 !! test
@@ -19877,7 +19580,6 @@ HTML ordered list item with parameters oddity
 !! html
 <ol><li id="fragment">One</li>
 </ol>
-
 !! end
 
 # parsoid doesn't explicitly mark autonumbered links, see T55505
@@ -19926,7 +19628,6 @@ Fuzz testing: Parser13
 </td>
 </tr>
 </table>
-
 !! end
 
 # Note that Parsoid output differs from the PHP parser here: the PHP
@@ -19945,7 +19646,6 @@ http://<div id="toc" class="toc"><input type="checkbox" role="button" id="toctog
 </ul>
 </div>
 
-
 !! html/php+tidy
 <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><p>
 http://</p><div id="toc" class="toc"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none" /><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span></div>
@@ -19970,7 +19670,6 @@ parsoid=wt2html,html2html
 <table style="&#95;_TOC&#95;_">
 <tr><td></td></tr>
 </table>
-
 !! html/php+tidy
 <h2><span class="mw-headline" id="a">a</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">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <table style="&#95;_TOC&#95;_">
@@ -20015,7 +19714,6 @@ Fuzz testing: Parser21
 </td>
 </tr>
 </table>
-
 !! end
 
 !! test
@@ -20030,7 +19728,6 @@ http://===r:::https://b
 <table>
 <tr><td></td></tr>
 </table>
-
 !! end
 
 ## Remex doesn't account for fostered content.
@@ -20060,7 +19757,6 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT
 </td>
 </tr>
 </table>
-
 !! html/php+tidy
 
 {{{|
@@ -20072,8 +19768,7 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT
 <td>
 </td>
 </tr>
-</tbody></table><p><u class="&#124;">
-</u></p>
+</tbody></table>
 !! html/parsoid
 <p data-parsoid='{"fostered":true,"autoInsertedEnd":true,"autoInsertedStart":true}'>
 {{{|
@@ -20136,7 +19831,6 @@ Fuzz testing: URL adjacent extension (no space, dirty; pre)
 http://example.com<pre>junk</pre>
 !! html/php
 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><pre>junk</pre>
-
 !! html/php+tidy
 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></p><pre>junk</pre>
 !! html/parsoid
@@ -20149,9 +19843,8 @@ Fuzz testing: image with bogus manual thumbnail
 [[Image:foobar.jpg|thumbnail= ]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;">Error creating thumbnail:   <div class="thumbcaption"></div></div></div>
-
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Error mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"manualthumb","ak":"thumbnail= "}]}' data-mw='{"errors":[{"key":"apierror-invalidtitle","message":"Invalid thumbnail title.","params":{"name":""}}],"thumb":""}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{"href":"Image:foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="./Special:FilePath/Foobar.jpg" height="220" width="220" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"220"},"sa":{"resource":"Image:foobar.jpg"}}'/></a></figure>
+<figure class="mw-default-size" typeof="mw:Error mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"manualthumb","ak":"thumbnail= "}]}' data-mw='{"attribs":[["manualthumb",{"txt":""}]],"errors":[{"key":"apierror-invalidtitle","message":"Invalid thumbnail title.","params":{"name":""}}]}'><a href="./Special:FilePath/Foobar.jpg"><span resource="./File:Foobar.jpg" data-parsoid='{"a":{"resource":"./File:Foobar.jpg"},"sa":{"resource":"Image:foobar.jpg"}}'>File:Foobar.jpg</span></a><figcaption></figcaption></figure>
 !! end
 
 # Parsoid will emit the newline literally in wt2wt; see next test case.
@@ -20163,7 +19856,6 @@ parsoid=wt2html
 <pre dir="&#10;"></pre>
 !! html/php
 <pre dir="&#10;"></pre>
-
 !! html/parsoid
 <pre dir="
 " typeof="mw:Extension/pre" about="#mwt2"data-mw='{"name":"pre","attrs":{"dir":"\n"},"body":{"extsrc":""}}'></pre>
@@ -20181,7 +19873,6 @@ parsoid=html2wt
 "></pre>
 !! html/php
 <pre dir=""></pre>
-
 !! end
 
 !! test
@@ -20190,7 +19881,6 @@ Templates in extension attributes are not expanded
 <pre dir="{{echo|ltr}}"></pre>
 !! html/php
 <pre dir="{{echo|ltr}}"></pre>
-
 !! html/parsoid
 <pre dir="{{echo|ltr}}" typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{"dir":"{{echo|ltr}}"},"body":{"extsrc":""}}'></pre>
 !! end
@@ -20214,7 +19904,6 @@ Parsing optional HTML elements (T8171)
     </td><td> And yet som tabular data</td>
   </tr>
 </table>
-
 !! end
 
 !! test
@@ -20236,7 +19925,6 @@ Correct handling of <td>, <tr> (T8171)
     <td> And yet som tabular data</td>
   </tr>
 </table>
-
 !! end
 
 
@@ -20314,7 +20002,6 @@ Special page transclusion
 !! html
 <ul class="mw-prefixindex-list"><li><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></li>
 </ul>
-
 !! end
 
 !! test
@@ -20328,7 +20015,6 @@ Special page transclusion twice (T7021)
 </ul>
 <ul class="mw-prefixindex-list"><li><a href="/wiki/Xyzzyx" title="Xyzzyx">Xyzzyx</a></li>
 </ul>
-
 !! end
 
 !! test
@@ -20720,8 +20406,7 @@ section=2
 <!-- -->==sec1==
 ==sec2==
 !! html/php
-
-!!end
+!! end
 
 # Formerly testing for T4607, now resolved by the use of unmarked sections
 # instead of respecting HTML-style headings
@@ -21201,7 +20886,6 @@ Handling of &#x0A; in URLs
 *irc://&#x0A;a
 !! html/php
 <ul><li><a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul>
-
 !! html/parsoid
 <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
@@ -21212,7 +20896,6 @@ Handling of %0A in URLs
 *irc://%0Aa
 !! html/php
 <ul><li><a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul>
-
 !! html/parsoid
 <ul><li><a rel="mw:ExtLink" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul>
 !! end
@@ -21329,7 +21012,6 @@ title=[[Parser test]]
 <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.
 
@@ -21347,10 +21029,9 @@ File:File:Foobar.jpg
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
-<ul class="gallery mw-gallery-traditional" type="123" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"type":"123","summary":"345"},"body":{"extsrc":"\nFile:File:Foobar.jpg\n"}}'>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:File:Foobar.jpg"><img resource="./File:File:Foobar.jpg" src="./Special:FilePath/File:Foobar.jpg" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
+<ul class="gallery mw-gallery-traditional" type="123" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"type":"123","summary":"345"},"body":{}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/File:Foobar.jpg"><span resource="./File:File:Foobar.jpg" data-width="120" data-height="120">File:File:Foobar.jpg</span></a></figure-inline></div><div class="gallerytext"></div></li>
 </ul>
 !! end
 
@@ -21359,8 +21040,7 @@ File:File:Foobar.jpg
 Gallery
 !! options
 parsoid={
-  "modes": ["wt2html"],
-  "nativeGallery": true
+  "modes": ["wt2html"]
 }
 !! wikitext
 <gallery>
@@ -21410,15 +21090,14 @@ image4    |300px| centre
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Image1.png"><img resource="./File:Image1.png" src="./Special:FilePath/Image1.png" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Image2.gif"><img resource="./File:Image2.gif" src="./Special:FilePath/Image2.gif" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Image3"><img resource="./File:Image3" src="./Special:FilePath/Image3" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Image4"><img resource="./File:Image4" src="./Special:FilePath/Image4" height="300" width="300"/></a></figure-inline></div><div class="gallerytext"></div></li>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Image5.svg"><img resource="./File:Image5.svg" src="./Special:FilePath/Image5.svg" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"> <a rel="mw:ExtLink" class="external free" href="http://///////">http://///////</a></div></li>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:*_image6"><img resource="./File:*_image6" src="./Special:FilePath/*_image6" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image1.png"><span resource="./File:Image1.png" data-width="120" data-height="120">File:Image1.png</span></a></figure-inline></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image2.gif"><span resource="./File:Image2.gif" data-width="120" data-height="120">File:Image2.gif</span></a></figure-inline></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image3"><span resource="./File:Image3" data-width="120" data-height="120">File:Image3</span></a></figure-inline></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image4"><span resource="./File:Image4" data-width="300">File:Image4</span></a></figure-inline></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Image5.svg"><span resource="./File:Image5.svg" data-width="120" data-height="120">File:Image5.svg</span></a></figure-inline></div><div class="gallerytext"> <a rel="mw:ExtLink" class="external free" href="http://///////">http://///////</a></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/*_image6"><span resource="./File:*_image6" data-width="120" data-height="120">File:* image6</span></a></figure-inline></div><div class="gallerytext"></div></li>
 </ul>
 !! end
 
@@ -21426,8 +21105,7 @@ image4    |300px| centre
 Gallery (with options, html)
 !! options
 parsoid={
-  "modes": ["wt2html", "html2html"],
-  "nativeGallery": true
+  "modes": ["wt2html", "html2html"]
 }
 !! wikitext
 <gallery widths="70px" heights="40px" perrow="2" caption="Foo [[Main Page]]">
@@ -21472,24 +21150,23 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" style="max-width: 226px; _width: 226px;" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"widths":"70px","heights":"40px","perrow":"2"},"body":{}}'>
 <li class="gallerycaption">Foo <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></li>
-<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Nonexistent.jpg"><img resource="./File:Nonexistent.jpg" src="./Special:FilePath/Nonexistent.jpg" height="40" width="70"/></a></figure-inline></div><div class="gallerytext">caption</div></li>
-<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Nonexistent.jpg"><img resource="./File:Nonexistent.jpg" src="./Special:FilePath/Nonexistent.jpg" height="40" width="70"/></a></figure-inline></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span resource="./File:Nonexistent.jpg" data-width="70" data-height="40">File:Nonexistent.jpg</span></a></figure-inline></div><div class="gallerytext">caption</div></li>
+<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span resource="./File:Nonexistent.jpg" data-width="70" data-height="40">File:Nonexistent.jpg</span></a></figure-inline></div><div class="gallerytext"></div></li>
 <li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70"/></a></figure-inline></div><div class="gallerytext">some <b>caption</b> <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></div></li>
 <li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70"/></a></figure-inline></div><div class="gallerytext"></div></li>
 <li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="This is a foo-bar." resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70"/></a></figure-inline></div><div class="gallerytext">blabla.</div></li>
 </ul>
 !! end
 
+## FIXME: This test can be dropped when Parsoid content versions 2.0.0 / 1.8.0
+## are no longer in storage.
 !! test
 Gallery (with options, extsrc)
 !! options
-parsoid={
-  "nativeGallery": false
-}
+parsoid=html2wt
 !! wikitext
 <gallery widths="70px" heights="40px" perrow="2" caption="Foo [[Main Page]]">
 File:Nonexistent.jpg|caption
@@ -21533,12 +21210,11 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
-<ul class="gallery mw-gallery-traditional" style="max-width: 226px; _width: 226px;" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"widths":"70px","heights":"40px","perrow":"2","caption":"Foo [[Main Page]]"},"body":{"extsrc":"\nFile:Nonexistent.jpg|caption\nFile:Nonexistent.jpg\nimage:foobar.jpg|some &#39;&#39;&#39;caption&#39;&#39;&#39; [[Main Page]]\nimage:foobar.jpg\nimage:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.\n"}}'>
+<ul class="gallery mw-gallery-traditional" style="max-width: 226px; _width: 226px;" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"widths":"70px","heights":"40px","perrow":"2","caption":"Foo [[Main Page]]"},"body":{"extsrc":"\nFile:Nonexistent.jpg|caption\nFile:Nonexistent.jpg\nimage:foobar.jpg|some &apos;&apos;&apos;caption&apos;&apos;&apos; [[Main Page]]\nimage:foobar.jpg\nimage:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.\n"}}'>
 <li class="gallerycaption">Foo <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></li>
-<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Nonexistent.jpg"><img resource="./File:Nonexistent.jpg" src="./Special:FilePath/Nonexistent.jpg" height="40" width="70"/></a></figure-inline></div><div class="gallerytext">caption</div></li>
-<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Nonexistent.jpg"><img resource="./File:Nonexistent.jpg" src="./Special:FilePath/Nonexistent.jpg" height="40" width="70"/></a></figure-inline></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span resource="./File:Nonexistent.jpg" data-width="70" data-height="40">File:Nonexistent.jpg</span></a></figure-inline></div><div class="gallerytext">caption</div></li>
+<li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span resource="./File:Nonexistent.jpg" data-width="70" data-height="40">File:Nonexistent.jpg</span></a></figure-inline></div><div class="gallerytext"></div></li>
 <li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70"/></a></figure-inline></div><div class="gallerytext">some <b>caption</b> <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></div></li>
 <li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70"/></a></figure-inline></div><div class="gallerytext"></div></li>
 <li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="This is a foo-bar." resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70"/></a></figure-inline></div><div class="gallerytext">blabla.</div></li>
@@ -21559,9 +21235,8 @@ File:Foobar.jpg
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"widths":"70","heights":"40"},"body":{"extsrc":"\nFile:Foobar.jpg\n"}}'>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"widths":"70","heights":"40"},"body":{}}'>
 <li class="gallerybox" style="width: 105px;"><div class="thumb" style="width: 100px; height: 70px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="8" width="70"/></a></figure-inline></div><div class="gallerytext"></div></li>
 </ul>
 !! end
@@ -21580,9 +21255,8 @@ File:Foobar.jpg
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"widths":"70em","heights":"40em"},"body":{"extsrc":"\nFile:Foobar.jpg\n"}}'>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"widths":"70em","heights":"40em"},"body":{}}'>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
 </ul>
 !! end
@@ -21591,8 +21265,7 @@ File:Foobar.jpg
 Gallery with link that has fragment
 !! options
 parsoid={
-  "modes": ["wt2html", "html2html"],
-  "nativeGallery": true
+  "modes": ["wt2html", "html2html"]
 }
 !! wikitext
 <gallery>
@@ -21620,7 +21293,6 @@ image:foobar.jpg|link=Main Page#section|caption
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
@@ -21631,10 +21303,6 @@ image:foobar.jpg|link=Main Page#section|caption
 
 !! test
 Gallery with template inside caption
-!! options
-parsoid={
-  "nativeGallery": true
-}
 !! wikitext
 <gallery caption="{{echo|hi}}">
 File:Foobar.jpg|{{echo|ho}}
@@ -21650,7 +21318,6 @@ File:Foobar.jpg|{{echo|ho}}
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt6" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
 <li class="gallerycaption"><span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"hi"}},"i":0}}]}'>hi</span></li>
@@ -21660,8 +21327,12 @@ File:Foobar.jpg|{{echo|ho}}
 
 !! test
 Gallery with wikitext inside gallery caption
+!! options
+parsoid={
+  "modes": ["wt2html", "html2html"]
+}
 !! wikitext
-<gallery caption="# List item
+<gallery caption="# This should not be a list item
 
 Text '''bold''' [[link]] {{ns:-1}}
 
@@ -21670,7 +21341,7 @@ File:Foobar.jpg|Image caption
 </gallery>
 !! html/php
 <ul class="gallery mw-gallery-traditional">
-       <li class='gallerycaption'># List item Text <b>bold</b> <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">link</a> Special <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>File in gallery caption</div></div></div></li>
+       <li class='gallerycaption'># This should not be a list item Text <b>bold</b> <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">link</a> Special <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>File in gallery caption</div></div></div></li>
                <li class="gallerybox" style="width: 155px"><div style="width: 155px">
                        <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" decoding="async" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
                        <div class="gallerytext">
@@ -21679,15 +21350,15 @@ File:Foobar.jpg|Image caption
                        </div>
                </div></li>
 </ul>
-
+!! html/parsoid
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
+<li class="gallerycaption"># This should not be a list item Text <b>bold</b> <a rel="mw:WikiLink" href="./Link" title="Link">link</a> <span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"ns:-1","function":"ns"},"params":{},"i":0}}]}'>-1</span> <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>File in gallery caption</figcaption></figure></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext">Image caption</div></li>
+</ul>
 !! end
 
 !! test
 Gallery with wikitext inside caption
-!! options
-parsoid={
-  "nativeGallery": true
-}
 !! wikitext
 <gallery>
 File:Foobar.jpg|alt=galleryalt|[[File:Foobar.jpg|alt=inneralt|20x20px|desc]]
@@ -21710,7 +21381,6 @@ File:Foobar.jpg|alt=galleryalt|{{Test|unamedParam|alt=param}}
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt6" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"><figure-inline typeof="mw:Image" data-mw='{"caption":"desc"}'><a href="./File:Foobar.jpg"><img alt="inneralt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="2" width="20"/></a></figure-inline></div></li>
@@ -21720,10 +21390,6 @@ File:Foobar.jpg|alt=galleryalt|{{Test|unamedParam|alt=param}}
 
 !! test
 Gallery (with showfilename option)
-!! options
-parsoid={
-  "nativeGallery": true
-}
 !! wikitext
 <gallery showfilename="">
 File:Nonexistent.jpg|caption
@@ -21764,11 +21430,10 @@ some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{"showfilename":""},"body":{}}'>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Nonexistent.jpg"><img resource="./File:Nonexistent.jpg" src="./Special:FilePath/Nonexistent.jpg" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"><a href="./File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">File:Nonexistent.jpg</a>caption</div></li>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Nonexistent.jpg"><img resource="./File:Nonexistent.jpg" src="./Special:FilePath/Nonexistent.jpg" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"><a href="./File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">File:Nonexistent.jpg</a></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span resource="./File:Nonexistent.jpg" data-width="120" data-height="120">File:Nonexistent.jpg</span></a></figure-inline></div><div class="gallerytext"><a href="./File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">File:Nonexistent.jpg</a>caption</div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span resource="./File:Nonexistent.jpg" data-width="120" data-height="120">File:Nonexistent.jpg</span></a></figure-inline></div><div class="gallerytext"><a href="./File:Nonexistent.jpg" class="galleryfilename galleryfilename-truncate" title="File:Nonexistent.jpg">File:Nonexistent.jpg</a></div></li>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"><a href="./File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">File:Foobar.jpg</a>some <b>caption</b> <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></div></li>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"><a href="./File:Foobar.jpg" class="galleryfilename galleryfilename-truncate" title="File:Foobar.jpg">File:Foobar.jpg</a></div></li>
 </ul>
@@ -21779,8 +21444,7 @@ some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a>
 Gallery (with namespace-less filenames)
 !! options
 parsoid={
-  "modes": ["wt2html", "html2html"],
-  "nativeGallery": true
+  "modes": ["wt2html", "html2html"]
 }
 !! wikitext
 <gallery>
@@ -21812,11 +21476,10 @@ foobar.jpg
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Nonexistent.jpg"><img resource="./File:Nonexistent.jpg" src="./Special:FilePath/Nonexistent.jpg" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image"><a href="./File:Nonexistent.jpg"><img resource="./File:Nonexistent.jpg" src="./Special:FilePath/Nonexistent.jpg" height="120" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span resource="./File:Nonexistent.jpg" data-width="120" data-height="120">File:Nonexistent.jpg</span></a></figure-inline></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Nonexistent.jpg"><span resource="./File:Nonexistent.jpg" data-width="120" data-height="120">File:Nonexistent.jpg</span></a></figure-inline></div><div class="gallerytext"></div></li>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
 </ul>
@@ -21824,10 +21487,6 @@ foobar.jpg
 
 !! test
 Gallery override link with wikilink (T36852)
-!! options
-parsoid={
-  "nativeGallery": true
-}
 !! wikitext
 <gallery>
 File:Foobar.jpg|alt=galleryalt|link=Wikilink
@@ -21840,7 +21499,6 @@ File:Foobar.jpg|alt=galleryalt|link=Wikilink
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./Wikilink"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
@@ -21849,10 +21507,6 @@ File:Foobar.jpg|alt=galleryalt|link=Wikilink
 
 !! test
 Gallery override link with absolute external link (T36852)
-!! options
-parsoid={
-  "nativeGallery": true
-}
 !! wikitext
 <gallery>
 File:Foobar.jpg|alt=galleryalt|link=http://www.example.org
@@ -21865,17 +21519,19 @@ File:Foobar.jpg|alt=galleryalt|link=http://www.example.org
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="http://www.example.org"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
 </ul>
 !! end
 
+## Putting the caption at the end here runs into T49646 on the php side
+## so reducing the modes this runs in Parsoid
 !! test
 Gallery override link with absolute external link with LanguageConverter
 !! options
 language=zh
+parsoid=wt2html,html2html
 !! wikitext
 <gallery>
 File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
@@ -21890,9 +21546,8 @@ File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{"extsrc":"\nFile:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org\n"}}'>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="http://www.example.org"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext">caption</div></li>
 </ul>
 !! end
@@ -21901,8 +21556,7 @@ File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
 Gallery override link with malicious javascript (T36852)
 !! options
 parsoid={
-  "modes": ["wt2html", "html2html"],
-  "nativeGallery": true
+  "modes": ["wt2html", "html2html"]
 }
 !! wikitext
 <gallery>
@@ -21916,20 +21570,17 @@ File:Foobar.jpg|alt=galleryalt|link=" onclick="alert('malicious javascript code!
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./%22_onclick=%22alert('malicious_javascript_code!');"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
 </ul>
 !! end
 
-# Note that parsoid uses the invalid link as a caption, PHP does not.
 !! test
 Gallery with invalid title as link (T45964)
 !! options
 parsoid={
-  "modes": ["wt2html", "html2html"],
-  "nativeGallery": true
+  "modes": ["wt2html", "html2html"]
 }
 !! wikitext
 <gallery>
@@ -21943,10 +21594,9 @@ File:Foobar.jpg|link=<
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext">link=&lt;</div></li>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt3" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image" data-mw='{"attribs":[["link",{"txt":"&lt;"}]]}'><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
 </ul>
 !! end
 
@@ -21954,8 +21604,7 @@ File:Foobar.jpg|link=<
 Serialize gallery without attrs in data-mw
 !! options
 parsoid={
-  "modes": ["html2wt"],
-  "nativeGallery": true
+  "modes": ["html2wt"]
 }
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","body":{}}'>
@@ -21970,10 +21619,6 @@ File:Test.png
 
 !! test
 Gallery with class and style attributes
-!! options
-parsoid={
-  "nativeGallery": true
-}
 !! wikitext
 <gallery class="center" style="text-align: center;">
 File:Foobar.jpg
@@ -21986,7 +21631,6 @@ File:Foobar.jpg
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional center" style="text-align: center;" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"class":"center","style":"text-align: center;"},"body":{}}'>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
@@ -21995,10 +21639,6 @@ File:Foobar.jpg
 
 !! test
 Gallery in slideshow mode
-!! options
-parsoid={
-  "nativeGallery": true
-}
 !! wikitext
 <gallery mode="slideshow" showthumbnails="">
 File:Foobar.jpg
@@ -22011,19 +21651,37 @@ File:Foobar.jpg
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
 <ul class="gallery mw-gallery-slideshow" data-showthumbnails="1" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{"mode":"slideshow","showthumbnails":""},"body":{}}'>
 <li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"></div></li>
 </ul>
 !! end
 
+!! test
+Gallery in packed mode
+!! wikitext
+<gallery mode="packed">
+File:Foobar.jpg
+</gallery>
+!! html/php
+<ul class="gallery mw-gallery-packed">
+               <li class="gallerybox" style="width: 1061.3333333333px"><div style="width: 1061.3333333333px">
+                       <div class="thumb" style="width: 1059.3333333333px;"><div style="margin:0px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1589px-Foobar.jpg" decoding="async" width="1060" height="120" srcset="http://example.com/images/3/3a/Foobar.jpg 1.5x" /></a></div></div>
+                       <div class="gallerytext">
+                       </div>
+               </div></li>
+</ul>
+!! html/parsoid
+<ul class="gallery mw-gallery-packed" typeof="mw:Extension/gallery" about="#mwt3" data-parsoid='{"dsr":[0,50,23,10]}' data-mw='{"name":"gallery","attrs":{"mode":"packed"},"body":{}}'>
+<li class="gallerybox" style="width: 1061px;"><div class="thumb" style="width: 1059px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/1589px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="120" width="1059"/></a></figure-inline></div><div class="gallerytext"></div></li>
+</ul>
+!! end
+
 !! test
 Serialize gallery image captions on a line
 !! options
 parsoid={
-  "modes": ["html2wt"],
-  "nativeGallery": true
+  "modes": ["html2wt"]
 }
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
@@ -22231,9 +21889,8 @@ Centre-aligned image
 [[Image:foobar.jpg|centre]]
 !! html/php
 <div class="center"><div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div></div>
-
 !! html/parsoid
-<figure class="mw-default-size mw-halign-center" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"center","ak":"centre"}]}'><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>
+<figure class="mw-default-size mw-halign-center" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"center","ak":"centre"}]}'><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><figcaption></figcaption></figure>
 !! end
 
 !! test
@@ -22242,9 +21899,8 @@ None-aligned image
 [[Image:foobar.jpg|none]]
 !! html/php
 <div class="floatnone"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></div>
-
 !! html/parsoid
-<figure class="mw-default-size mw-halign-none" 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>
+<figure class="mw-default-size mw-halign-none" 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><figcaption></figcaption></figure>
 !! end
 
 !! test
@@ -22291,6 +21947,7 @@ Width-sized image (using px, with preceding whitespace - test regression from r3
 <p><figure-inline typeof="mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":" 640px"}]}'><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/640px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="73" width="640" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"73","width":"640"},"sa":{"resource":"Image:foobar.jpg"}}'/></a></figure-inline></p>
 !! end
 
+## FIXME: Parsoid mocking should include the page in the url to catch regressions
 !! test
 Image with page parameter
 !! options
@@ -22301,7 +21958,7 @@ djvu
 <p><a href="/index.php?title=File:LoremIpsum.djvu&amp;page=2" class="image"><img alt="LoremIpsum.djvu" src="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-2480px-LoremIpsum.djvu.jpg" decoding="async" width="2480" height="3508" srcset="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-3720px-LoremIpsum.djvu.jpg 1.5x, http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-4960px-LoremIpsum.djvu.jpg 2x" /></a>
 </p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"page","ak":"page=2"}]}' data-mw='{"page":"2"}'><a href="./File:LoremIpsum.djvu" data-parsoid='{"a":{"href":"./File:LoremIpsum.djvu"},"sa":{"href":"File:LoremIpsum.djvu"}}'><img resource="./File:LoremIpsum.djvu" src="//example.com/images/5/5f/LoremIpsum.djvu" data-file-width="2480" data-file-height="3508" data-file-type="bitmap" height="3508" width="2480" data-parsoid='{"a":{"resource":"./File:LoremIpsum.djvu","height":"3508","width":"2480"},"sa":{"resource":"File:LoremIpsum.djvu"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image" data-mw='{"attribs":[["page",{"txt":"2"}]]}'><a href="./File:LoremIpsum.djvu" data-parsoid='{"a":{"href":"./File:LoremIpsum.djvu"},"sa":{"href":"File:LoremIpsum.djvu"}}'><img resource="./File:LoremIpsum.djvu" src="//example.com/images/5/5f/LoremIpsum.djvu" data-file-width="2480" data-file-height="3508" data-file-type="bitmap" height="3508" width="2480" data-parsoid='{"a":{"resource":"./File:LoremIpsum.djvu","height":"3508","width":"2480"},"sa":{"resource":"File:LoremIpsum.djvu"}}'/></a></figure-inline></p>
 !! end
 
 !! test
@@ -22320,11 +21977,9 @@ dt/dd/dl test
 :;;;::
 !! html/php
 <dl><dd><dl><dt><dl><dt><dl><dt><dl><dd><dl><dd></dt></dl></dd></dl></dd></dl></dd></dl></dd></dl></dd></dl>
-
 !! html/parsoid
 <dl><dd><dl><dt><dl><dt><dl><dt><dl><dd><dl><dd></dd></dl></dd></dl></dt></dl></dt></dl></dt></dl></dd></dl>
-
-!!end
+!! end
 
 # Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "</a>" tag.
 !! test
@@ -22333,7 +21988,6 @@ Images with the "|" character in the comment
 [[File:Foobar.jpg|thumb|An [http://test/?param1=|left|&param2=|x external] URL]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>An <a rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx">external</a> URL</div></div></div>
-
 !! html/parsoid
 <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>An <a rel="mw:ExtLink" class="external text" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx" data-parsoid='{"a":{"href":"http://test/?param1=%7Cleft%7C&amp;param2=%7Cx"},"sa":{"href":"http://test/?param1=|left|&amp;param2=|x"}}'>external</a> URL</figcaption></figure>
 !! end
@@ -22479,7 +22133,6 @@ Definition list code coverage
 <dd>def</dd>
 <dt>title</dt>
 <dd>def</dd></dl>
-
 !! html/parsoid
 <dl><dt>title   </dt><dd>def</dd>
 <dt>title </dt><dd>def</dd>
@@ -22492,7 +22145,6 @@ Don't fall for the self-closing div
 <div>hello world</div/>
 !! html
 <div>hello world</div>
-
 !! end
 
 !! test
@@ -22547,7 +22199,6 @@ Inclusion of !userCanEdit() content
 {{MediaWiki:Fake}}
 !! html
 <h2><span class="mw-headline" id="header">header</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=MediaWiki:Fake&amp;action=edit&amp;section=T-1" title="MediaWiki:Fake">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 
@@ -22584,7 +22235,6 @@ Out-of-order TOC heading levels
 <h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 <h5><span class="mw-headline" id="5">5</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: 5">edit</a><span class="mw-editsection-bracket">]</span></span></h5>
 <h2><span class="mw-headline" id="2_2">2</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: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 
@@ -23041,7 +22691,6 @@ conversion:
 цонверсион:
 </p>
 <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>
 
@@ -23615,8 +23264,7 @@ language=zh variant=zh-cn
 !! html/php+tidy
 <span>ab<div>cd
 <span>ab<div>cd
-<span>ad
-</span></div></span></div></span>
+<span>ad</span></div></span></div></span>
 !! html/parsoid
 <span data-parsoid='{"stx":"html","autoInsertedEnd":true}'>a<div typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"b&lt;div data-parsoid=&apos;{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[10,16,5,0]}&apos;>c&lt;/div>"}}'></div>d
 
@@ -23822,7 +23470,6 @@ language=sr
 [[Датотека:Foobar.jpg|thumb|-{R|caption:}-]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/%D0%94%D0%B0%D1%82%D0%BE%D1%82%D0%B5%D0%BA%D0%B0:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/%D0%94%D0%B0%D1%82%D0%BE%D1%82%D0%B5%D0%BA%D0%B0:Foobar.jpg" class="internal" title="Повећајте"></a></div>caption:</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"}]}'><a href="./Датотека:Foobar.jpg"><img resource="./Датотека: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><span typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"caption:"}}' data-parsoid='{"fl":["R"]}'></span></figcaption></figure>
 !! end
@@ -23835,7 +23482,6 @@ language=zh variant=zh-cn
 [[File:Foobar.jpg|thumb|-{|zh-cn:blog (hk: -{zh-hans|WEBJOURNAL}-, tw: -{zh-hans|WEBLOG}-)}-]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="放大"></a></div>blog (hk: WEBJOURNAL, tw: WEBLOG)</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"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><span typeof="mw:LanguageVariant" data-mw-variant='{"twoway":[{"l":"zh-cn","t":"blog (hk: &lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&#39;{\"filter\":{\"l\":[\"zh-hans\"],\"t\":\"WEBJOURNAL\"}}&#39; data-parsoid=&#39;{\"fl\":[\"zh-hans\"],\"dsr\":[43,65,null,2]}&#39;>&lt;/span>, tw: &lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&#39;{\"filter\":{\"l\":[\"zh-hans\"],\"t\":\"WEBLOG\"}}&#39; data-parsoid=&#39;{\"fl\":[\"zh-hans\"],\"dsr\":[71,89,null,2]}&#39;>&lt;/span>)"}]}'></span></figcaption></figure>
 !! end
@@ -23845,10 +23491,11 @@ language=zh variant=zh-cn
 Don't break gallery if language converter markup is inside.
 !! options
 language=zh
+parsoid=wt2html,html2html
 !! wikitext
 <gallery>
-File:foobar.jpg|[[File:foobar.jpg|20px|desc|alt=-{R|foo}-|-{R|bar}-]]|alt=-{R|bat}-
-File:foobar.jpg|{{Test|unamedParam|alt=-{R|param}-}}|alt=galleryalt
+File:Foobar.jpg|alt=-{R|bat}-|[[File:foobar.jpg|20px|desc|alt=-{R|foo}-|-{R|bar}-]]
+File:Foobar.jpg|alt=galleryalt|{{Test|unamedParam|alt=-{R|param}-}}
 </gallery>
 !! html/php
 <ul class="gallery mw-gallery-traditional">
@@ -23867,11 +23514,10 @@ File:foobar.jpg|{{Test|unamedParam|alt=-{R|param}-}}|alt=galleryalt
                        </div>
                </div></li>
 </ul>
-
 !! html/parsoid
-<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt6" data-mw='{"name":"gallery","attrs":{},"body":{"extsrc":"\nFile:foobar.jpg|[[File:foobar.jpg|20px|desc|alt=-{R|foo}-|-{R|bar}-]]|alt=-{R|bat}-\nFile:foobar.jpg|{{Test|unamedParam|alt=-{R|param}-}}|alt=galleryalt\n"}}'>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"><figure-inline typeof="mw:Image" data-mw='{"caption":"&lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&#39;{\"disabled\":{\"t\":\"bar\"}}&#39; data-parsoid=&#39;{\"fl\":[\"R\"],\"dsr\":[68,77,null,2]}&#39;>&lt;/span>"}'><a href="./File:Foobar.jpg"><img alt="" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="2" width="20"/></a></figure-inline></div></li>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"><span about="#mwt4" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Test","href":"./Template:Test"},"params":{"1":{"wt":"unamedParam"},"alt":{"wt":"-{R|param}-"}},"i":0}}]}'>This is a test template</span></div></li>
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt6" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image mw:ExpandedAttrs" data-mw='{"attribs":[["alt",{"html":"alt=&lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&apos;{\"disabled\":{\"t\":\"bat\"}}&apos; data-parsoid=&apos;{\"fl\":[\"R\"],\"dsr\":[84,93,null,2]}&apos;>&lt;/span>","txt":""}]]}'><a href="./File:Foobar.jpg"><img alt="" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"><figure-inline typeof="mw:Image mw:ExpandedAttrs" about="#mwt3" data-mw='{"attribs":[["alt",{"html":"alt=&lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&apos;{\"disabled\":{\"t\":\"foo\"}}&apos; data-parsoid=&apos;{\"fl\":[\"R\"],\"dsr\":[58,67,null,2]}&apos;>&lt;/span>","txt":""}]],"caption":"&lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&apos;{\"disabled\":{\"t\":\"bar\"}}&apos; data-parsoid=&apos;{\"fl\":[\"R\"],\"dsr\":[68,77,null,2]}&apos;>&lt;/span>"}'><a href="./File:Foobar.jpg"><img alt="" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="2" width="20"/></a></figure-inline></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><figure-inline typeof="mw:Image"><a href="./File:Foobar.jpg"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></figure-inline></div><div class="gallerytext"><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"Test","href":"./Template:Test"},"params":{"1":{"wt":"unamedParam"},"alt":{"wt":"-{R|param}-"}},"i":0}}]}'>This is a test template</span></div></li>
 </ul>
 !! end
 
@@ -23885,7 +23531,6 @@ language=zh variant=zh-cn
 !! html/php
 <dl><dt>AAA</dt>
 <dt>foo:bar</dt></dl>
-
 !! html/parsoid
 <dl><dt data-parsoid='{"dsr":[0,24,1,0]}'><span typeof="mw:LanguageVariant" data-parsoid='{"tSp":[6]}' data-mw-variant='{"twoway":[{"l":"zh-cn","t":"AAA"},{"l":"zh-tw","t":"BBB"}]}'></span></dt>
 <dt data-parsoid='{"dsr":[25,39,1,0]}'><span typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"foo:bar"}}'></span></dt>
@@ -23903,8 +23548,7 @@ language=zh variant=zh-cn
 ;-{zh-cn:AAA
 !! html/php+tidy
 <dl><dt><b>foo:bar</b></dt><b>
-<dt>-{zh-cn:AAA</dt></b></dl><p><b>
-</b></p>
+<dt>-{zh-cn:AAA</dt></b></dl>
 !! html/parsoid
 <dl><dt data-parsoid='{}'><b data-parsoid='{"stx":"html","autoInsertedEnd":true}'>foo:bar</b></dt><b data-parsoid='{"stx":"html","autoInsertedEnd":true,"autoInsertedStart":true}'>
 <dt data-parsoid='{}'>-{zh-cn</dt><dd data-parsoid='{"stx":"row"}'>AAA</dd></b></dl>
@@ -23919,7 +23563,6 @@ language=zh variant=zh-cn
 !! html/php
 <dl><dt>AAA foo:bar bat:baz</dt>
 <dd>def</dd></dl>
-
 !! html/parsoid
 <dl><dt data-parsoid='{"dsr":[0,49,1,0]}'><span typeof="mw:LanguageVariant" data-mw-variant='{"twoway":[{"l":"zh-cn","t":"AAA &lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&#39;{\"filter\":{\"l\":[\"zh-hans\"],\"t\":\"foo:bar\"}}&#39; data-parsoid=&#39;{\"fl\":[\"zh-hans\"],\"dsr\":[14,33,null,2]}&#39;>&lt;/span> &lt;span typeof=\"mw:LanguageVariant\" data-mw-variant=&#39;{\"disabled\":{\"t\":\"bat:baz\"}}&#39; data-parsoid=&#39;{\"fl\":[\"R\"],\"dsr\":[34,47,null,2]}&#39;>&lt;/span>"}]}'></span></dt>
 <dd data-parsoid='{"stx":"row","dsr":[49,53,1,0]}'>def</dd>
@@ -23943,7 +23586,6 @@ parsoid=wt2html,wt2wt,html2html
 <tr>
 <td>B
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tbody>
@@ -24076,7 +23718,6 @@ T2529: Uncovered bullet
 !! html
 <ul><li>Foo</li>
 <li>Bar</li></ul>
-
 !! end
 
 !! test
@@ -24086,7 +23727,6 @@ T2529: Uncovered bullet in a deeply nested list
 !! 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>
-
 !! end
 
 !! test
@@ -24119,7 +23759,6 @@ T2529: Uncovered bullet in parser function result
 !! html
 <ul><li>Foo</li>
 <li>bar</li></ul>
-
 !! end
 
 !! test
@@ -24175,7 +23814,6 @@ Morwen/13: Unclosed link followed by heading
 <p>[[link
 </p>
 <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>
-
 !! end
 
 !! test
@@ -24187,7 +23825,6 @@ HHP2.1: Heuristics for headings in preprocessor parenthetical structures
 <p>{{foo|
 </p>
 <h1><span class="mw-headline" id="heading">heading</span></h1>
-
 !! end
 
 !! test
@@ -24199,7 +23836,6 @@ HHP2.2: Heuristics for headings in preprocessor parenthetical structures
 <p>{{foo|
 </p>
 <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>
-
 !! end
 
 !! test
@@ -24221,7 +23857,6 @@ Line two</div>
 !! html
 <div>Line one
 Line two</div>
-
 !! end
 
 !! test
@@ -24236,7 +23871,6 @@ Line two</div>
 <p>Line one
 </p>
 Line two</div>
-
 !! end
 
 !! test
@@ -24251,7 +23885,6 @@ Line two
 <p>Line two
 </p>
 </div>
-
 !! end
 
 !! test
@@ -24268,7 +23901,6 @@ Line two
 </p><p>Line two
 </p>
 </div>
-
 !! end
 
 # doBlockLevels screws up this output and Remex cleans up as much as it can.
@@ -24296,7 +23928,6 @@ Line two</blockquote>
 !! html
 <blockquote>Line one
 Line two</blockquote>
-
 !! html+tidy
 <blockquote><p>Line one
 Line two</p></blockquote>
@@ -24314,7 +23945,6 @@ Line two</blockquote>
 <p>Line one
 </p>
 Line two</blockquote>
-
 !! html+tidy
 <blockquote>
 <p>Line one
@@ -24334,7 +23964,6 @@ Line two
 <p>Line two
 </p>
 </blockquote>
-
 !! html+tidy
 <blockquote><p>Line one
 </p><p>Line two
@@ -24356,7 +23985,6 @@ Line two
 </p><p>Line two
 </p>
 </blockquote>
-
 !! end
 
 ## This is a corner case interaction between the paragraph wrapping in the
@@ -24374,7 +24002,6 @@ Line two</div></blockquote>
 !! html
 <blockquote><div>Line one
 Line two</div></blockquote>
-
 !! end
 
 !! test
@@ -24389,7 +24016,6 @@ Line two</div></blockquote>
 <p>Line one
 </p>
 Line two</div></blockquote>
-
 !! end
 
 !! test
@@ -24404,7 +24030,6 @@ Line two
 <p>Line two
 </p>
 </div></blockquote>
-
 !! end
 
 !! test
@@ -24421,7 +24046,6 @@ Line two
 </p><p>Line two
 </p>
 </div></blockquote>
-
 !! end
 
 !! test
@@ -24445,7 +24069,6 @@ Free external link invading image caption
 [[Image:Foobar.jpg|thumb|http://x|hello]]
 !! html/php
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>hello</div></div></div>
-
 !! html/parsoid
 <figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"bogus","ak":"http://x"},{"ck":"caption","ak":"hello"}]}'><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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"Image:Foobar.jpg"}}'/></a><figcaption>hello</figcaption></figure>
 !! end
@@ -24688,7 +24311,6 @@ Id starting with underscore
 <div id="_ref"></div>
 !! html/*
 <div id="_ref"></div>
-
 !! end
 
 !! test
@@ -24744,7 +24366,7 @@ Bad images - basic functionality
 [[File:Bad.jpg]]
 !! 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>
+<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Bad.jpg"><span resource="./File:Bad.jpg">File:Bad.jpg</span></a></figure-inline></p>
 !! end
 
 !! test
@@ -24759,7 +24381,7 @@ Bar foo
 </p>
 !! html/parsoid
 <p>Foo bar
-<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>
+<figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Bad.jpg"><span resource="./File:Bad.jpg">File:Bad.jpg</span></a></figure-inline>
 Bar foo</p>
 !! end
 
@@ -24949,7 +24571,6 @@ paragraphs</indicator>
 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" decoding="async" 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>
-
 06=foo
 07=<pre>Preformatted
 </pre>
@@ -24959,7 +24580,6 @@ paragraphs</indicator>
 <tr>
 <td>cell
 </td></tr></table>
-
 10=<p>Two
 </p><p>paragraphs
 </p>
@@ -25023,13 +24643,11 @@ Play a bit with r67090 and T5158
 <div style="width:50% !important">&#160;</div>
 <div style="width:50% !important">&#160;</div>
 <div style="border&#32;: solid;">&#160;</div>
-
 !! html/parsoid
 <div style="width:50% !important" data-parsoid='{"stx":"html"}'><span typeof="mw:Entity" data-parsoid='{"srcContent":" "}'> </span></div>
 <div style="width:50% !important" data-parsoid='{"stx":"html","a":{"style":"width:50% !important"},"sa":{"style":"width:50%&amp;nbsp;!important"}}'><span typeof="mw:Entity" data-parsoid='{"srcContent":" "}'> </span></div>
 <div style="width:50% !important" data-parsoid='{"stx":"html","a":{"style":"width:50% !important"},"sa":{"style":"width:50%&amp;#160;!important"}}'><span typeof="mw:Entity" data-parsoid='{"srcContent":" "}'> </span></div>
 <div style="border : solid;" data-parsoid='{"stx":"html"}'><span typeof="mw:Entity" data-parsoid='{"srcContent":" "}'> </span></div>
-
 !! end
 
 !! test
@@ -25073,7 +24691,6 @@ HTML5 data attributes
 <p><span data-foo="bar">Baz</span>
 </p>
 <p data-abc-def_hij="">Quuz</p>
-
 !! html/parsoid
 <p><span data-foo="bar" data-parsoid='{"stx":"html"}'>Baz</span></p>
 <p data-abc-def_hij="" data-parsoid='{"stx":"html"}'>Quuz</p>
@@ -25082,12 +24699,11 @@ HTML5 data attributes
 !! test
 Strip reserved data attributes
 !! wikitext
-<div data-mw="foo" data-parsoid="bar" data-mw-someext="baz" data-ok="fred" data-ooui="xyzzy" data-bad:ns="ns">d</div>
+<div data-mw="foo" data-parsoid="bar" data-mw-someext="baz" data-ok="fred" data-object-id="123" data-ooui="xyzzy" data-bad:ns="ns">d</div>
 !! html/php
-<div data-ok="fred">d</div>
-
+<div data-ok="fred" data-object-id="123">d</div>
 !! html/parsoid
-<div data-x-data-mw="foo" data-x-data-parsoid="bar" data-x-data-mw-someext="baz" data-ok="fred" data-parsoid='{"stx":"html","a":{"data-ooui":null,"data-bad:ns":null},"sa":{"data-ooui":"xyzzy","data-bad:ns":"ns"}}'>d</div>
+<div data-x-data-mw="foo" data-x-data-parsoid="bar" data-x-data-mw-someext="baz" data-ok="fred" data-x-data-object-id="123" data-parsoid='{"stx":"html","a":{"data-ooui":null,"data-bad:ns":null},"sa":{"data-ooui":"xyzzy","data-bad:ns":"ns"}}'>d</div>
 !! end
 
 !! test
@@ -25106,7 +24722,7 @@ percent-encoding and + signs in internal links (T28410)
 !! html/parsoid
 <p><a rel="mw:WikiLink" href="./User:+%25" title="User:+%" data-parsoid='{"stx":"simple","a":{"href":"./User:+%25"},"sa":{"href":"User:+%"}}'>User:+%</a> <a rel="mw:WikiLink" href="./Page+title%25" title="Page+title%" data-parsoid='{"stx":"simple","a":{"href":"./Page+title%25"},"sa":{"href":"Page+title%"}}'>Page+title%</a>
 <a rel="mw:WikiLink" href="./%25+" title="%+" data-parsoid='{"stx":"simple","a":{"href":"./%25+"},"sa":{"href":"%+"}}'>%+</a> <a rel="mw:WikiLink" href="./%25+" title="%+" data-parsoid='{"stx":"piped","a":{"href":"./%25+"},"sa":{"href":"%+"}}'>%20</a> <a rel="mw:WikiLink" href="./%25+" title="%+" data-parsoid='{"stx":"simple","a":{"href":"./%25+"},"sa":{"href":"%+ "}}'>%+ </a> <a rel="mw:WikiLink" href="./%25+r" title="%+r" data-parsoid='{"stx":"simple","a":{"href":"./%25+r"},"sa":{"href":"%+r"}}'>%+r</a>
-<a rel="mw:WikiLink" href="./%25" title="%" data-parsoid='{"stx":"simple","a":{"href":"./%25"},"sa":{"href":"%"}}'>%</a> <a rel="mw:WikiLink" href="./+" title="+" data-parsoid='{"stx":"simple","a":{"href":"./+"},"sa":{"href":"+"}}'>+</a> <figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"bogus","ak":"foo"},{"ck":"caption","ak":"[[bar]]"}]}' data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}],"caption":"&lt;a rel=\"mw:WikiLink\" href=\"./Bar\" title=\"Bar\" data-parsoid=&#39;{\"stx\":\"simple\",\"a\":{\"href\":\"./Bar\"},\"sa\":{\"href\":\"bar\"},\"dsr\":[94,101,2,2]}&#39;>bar&lt;/a>"}'><a href="./File:%25+abc9" data-parsoid='{"a":{"href":"./File:%25+abc9"},"sa":{}}'><img resource="./File:%25+abc9" src="./Special:FilePath/%25+abc9" height="220" width="220" data-parsoid='{"a":{"resource":"./File:%25+abc9","height":"220","width":"220"},"sa":{"resource":"File:%+abc%39"}}'/></a></figure-inline>
+<a rel="mw:WikiLink" href="./%25" title="%" data-parsoid='{"stx":"simple","a":{"href":"./%25"},"sa":{"href":"%"}}'>%</a> <a rel="mw:WikiLink" href="./+" title="+" data-parsoid='{"stx":"simple","a":{"href":"./+"},"sa":{"href":"+"}}'>+</a> <figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-parsoid='{"optList":[{"ck":"bogus","ak":"foo"},{"ck":"caption","ak":"[[bar]]"}]}' data-mw='{"caption":"&lt;a rel=\"mw:WikiLink\" href=\"./Bar\" title=\"Bar\" data-parsoid=&apos;{\"stx\":\"simple\",\"a\":{\"href\":\"./Bar\"},\"sa\":{\"href\":\"bar\"},\"dsr\":[94,101,2,2]}&apos;>bar&lt;/a>","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/%25+abc9"><span resource="./File:%25+abc9" data-parsoid='{"a":{"resource":"./File:%25+abc9"},"sa":{"resource":"File:%+abc%39"}}'>File:%+abc9</span></a></figure-inline>
 <a rel="mw:WikiLink" href="./3E" title="3E" data-parsoid='{"stx":"simple","a":{"href":"./3E"},"sa":{"href":"%33%45"}}'>3E</a> <a rel="mw:WikiLink" href="./3E+" title="3E+" data-parsoid='{"stx":"simple","a":{"href":"./3E+"},"sa":{"href":"%33%45+"}}'>3E+</a></p>
 !! end
 
@@ -25120,8 +24736,8 @@ Special characters in embedded file links (T29679)
 <a href="/index.php?title=Special:Upload&amp;wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with &amp; ampersand</a>
 </p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./File:Contains_&amp;_ampersand.jpg"><img resource="./File:Contains_&amp;_ampersand.jpg" src="./Special:FilePath/Contains_&amp;_ampersand.jpg" height="220" width="220"/></a></figure-inline>
-<figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}],"caption":"Title with &amp;amp; ampersand"}'><a href="./File:Does_not_exist.jpg"><img resource="./File:Does_not_exist.jpg" src="./Special:FilePath/Does_not_exist.jpg" height="220" width="220"/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Contains_&amp;_ampersand.jpg"><span resource="./File:Contains_&amp;_ampersand.jpg" data-parsoid='{"a":{"resource":"./File:Contains_&amp;_ampersand.jpg"},"sa":{"resource":"File:Contains &amp; ampersand.jpg"}}'>File:Contains &amp; ampersand.jpg</span></a></figure-inline>
+<figure-inline class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"caption":"Title with &amp;amp; ampersand","errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./Special:FilePath/Does_not_exist.jpg"><span resource="./File:Does_not_exist.jpg" data-parsoid='{"a":{"resource":"./File:Does_not_exist.jpg"},"sa":{"resource":"File:Does not exist.jpg"}}'>File:Does not exist.jpg</span></a></figure-inline></p>
 !! end
 
 !! test
@@ -25265,7 +24881,6 @@ __TOC__
 </div>
 
 <h2><span class="mw-headline" id="Lost_episodes"><i>Lost</i> episodes</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: Lost episodes">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
 <h2 id="Lost_episodes" data-parsoid='{}'><i>Lost</i> episodes</h2>
@@ -25286,7 +24901,6 @@ __TOC__
 </div>
 
 <h2><span class="mw-headline" id="should_be_bold_then_normal_text"><b>should be bold</b> then normal text</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: should be bold then normal text">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! 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>
@@ -25307,7 +24921,6 @@ __TOC__
 </div>
 
 <h2><span class="mw-headline" id="Image">Image <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a></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: Image">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! 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>
@@ -25328,7 +24941,6 @@ __TOC__
 </div>
 
 <h2><span class="mw-headline" id="Quote"><blockquote>Quote</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/php+tidy
 <div id="toc" class="toc"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none" /><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span></div>
 <ul>
@@ -25388,7 +25000,6 @@ __TOC__
 
 <h2><span class="mw-headline" id="Foo_Bar"><i>Foo</i> <b>Bar</b></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"><i>Foo</i> <blockquote>Bar</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/php+tidy
 <div id="toc" class="toc"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none" /><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2><span class="toctogglespan"><label class="toctogglelabel" for="toctogglecheckbox"></label></span></div>
 <ul>
@@ -25427,7 +25038,6 @@ __TOC__
 
 <h2><span class="mw-headline" id="Hello"><sup class="in-h2">Hello</sup></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: Hello">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="b.22.3EEvilbye"><sup class="a"> b"&gt;Evilbye</sup></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: b&quot;&gt;Evilbye">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <meta property="mw:PageProp/toc" />
 <h2 id="Hello"><sup class="in-h2" data-parsoid='{"stx":"html"}'>Hello</sup></h2>
@@ -25464,7 +25074,6 @@ __TOC__
 <h2><span class="mw-headline" 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></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: The attributes on these span tags must be deleted from the TOC">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" 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></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: All attributes on these span tags must be deleted from the TOC">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" 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></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: Attributes after dir on these span tags must be deleted from the TOC">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! 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>
@@ -25487,7 +25096,6 @@ __TOC__
 </div>
 
 <h2><span class="mw-headline" id="test"><bdi>test</bdi></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: test">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
 <h2 id="test" data-parsoid='{}'><bdi>test</bdi></h2>
@@ -25506,7 +25114,6 @@ __TOC__
 </div>
 
 <h2><span class="mw-headline" id="test_test_test"><s>test</s> test <strike>test</strike></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: test test test">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
 <h2 id="test_test_test" data-parsoid='{}'><s>test</s> test <strike>test</strike></h2>
@@ -25527,7 +25134,6 @@ __TOC__
 </div>
 
 <h2><span class="mw-headline" id="Style"><style>.foo {}</style>Style<style>.bar {}</style></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: Style">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid="{}"/>
 <h2 id="Style" data-parsoid="{}"><style typeof="mw:Extension/style" data-mw='{"name":"style","attrs":{},"body":{"extsrc":".foo {}"}}'>.foo {}</style>Style<style typeof="mw:Extension/style" data-mw='{"name":"style","attrs":{},"body":{"extsrc":".bar {}"}}'>.bar {}</style></h2>
@@ -25548,7 +25154,6 @@ __TOC__
 </div>
 
 <h2><span class="mw-headline" id="Script"><script>alert(1);</script>Script<script>alert(1);</script></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: Script">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
 <h2 id="Script" data-parsoid='{}'><script typeof="mw:Extension/html" about="#mwt4" data-mw='{"name":"html","attrs":{},"body":{"extsrc":"&lt;script>alert(1);&lt;/script>"}}'>alert(1);</script>Script<script typeof="mw:Extension/html" about="#mwt6" data-mw='{"name":"html","attrs":{},"body":{"extsrc":"&lt;script>alert(1);&lt;/script>"}}'>alert(1);</script></h2>
@@ -25567,7 +25172,6 @@ __TOC__
 </div>
 
 <h2><span class="mw-headline" id="x">x</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: x">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <meta property="mw:PageProp/toc" data-parsoid='{}'/>
 <h2 id="x" data-parsoid='{}'>x</h2>
@@ -25587,7 +25191,6 @@ title=[[Main Page]]
 {{int:T34057}}
 !! html
 <h2><span class="mw-headline" id="Headline_text">Headline text</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: Headline text">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 !! test
@@ -25706,7 +25309,6 @@ nowiki inside link inside heading (T20295)
 ==[[foo|x<nowiki>y</nowiki>z]]==
 !! html
 <h2><span class="mw-headline" id="xyz"><a href="/wiki/Foo" title="Foo">xyz</a></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: xyz">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 !! test
@@ -25715,8 +25317,7 @@ new support for bdi element (T33817)
 <p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
 !! html
 <p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
-
-!!end
+!! end
 
 !! test
 Ignore pipe between table row attributes
@@ -25734,7 +25335,6 @@ Ignore pipe between table row attributes
 <tr id="foo" style="color: red">
 <td>bar
 </td></tr></table>
-
 !! end
 
 !!test
@@ -25863,7 +25463,6 @@ Lead
 <h2><span class="mw-headline" id="Section_3">Section 3</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Section 3">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Section_4">Section 4</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: Section 4">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
 <h2><span class="mw-headline" id="Section_5">Section 5</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: Section 5">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! end
 
 
@@ -25948,7 +25547,7 @@ parsoid=wt2html,wt2wt
 !! html/parsoid
 <p><b>foo</b></p><b><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>caption</figcaption></figure></b><p><b>bar</b></p>
 
-<small><figure class="mw-halign-right" typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300"/></a></figure></small>
+<small><figure class="mw-halign-right" typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300"/></a><figcaption></figcaption></figure></small>
 !! end
 
 !! test
@@ -25958,8 +25557,7 @@ parsoid=wt2html,wt2wt
 !! wikitext
 <small>'''foo[[File:Foobar.jpg|thumb|caption]]bar'''</small>
 !! html/php+tidy
-<p><small><b>foo</b></small></p><small><b><div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div></b></small><p><small><b>bar</b></small>
-</p>
+<p><small><b>foo</b></small></p><small><b><div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>caption</div></div></div></b></small><p><small><b>bar</b></small></p>
 !! html/parsoid
 <p><small><b>foo</b></small></p><small><b><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>caption</figcaption></figure></b></small><p><small><b>bar</b></small></p>
 !! end
@@ -25973,7 +25571,7 @@ parsoid=wt2html,wt2wt
 !! html/php+tidy
 <b><small><div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" decoding="async" width="300" height="34" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/450px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/600px-Foobar.jpg 2x" /></a></div></small></b>
 !! html/parsoid
-<b><small><figure class="mw-halign-right" typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300"/></a></figure></small></b>
+<b><small><figure class="mw-halign-right" typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300"/></a><figcaption></figcaption></figure></small></b>
 !! end
 
 #### ----------------------------------------------------------------
@@ -26129,12 +25727,12 @@ parsoid=html2wt
 <h2>=foo=</h2>
 <h3>=foo=</h3>
 
-<h1 data-parsoid=''>=foo=</h1>
-<h2 data-parsoid=''>=foo=</h2>
-<h3 data-parsoid=''>=foo=</h3>
-<h4 data-parsoid=''>=foo=</h4>
-<h5 data-parsoid=''>=foo=</h5>
-<h6 data-parsoid=''>=foo=</h6>
+<h1 data-parsoid='{}'>=foo=</h1>
+<h2 data-parsoid='{}'>=foo=</h2>
+<h3 data-parsoid='{}'>=foo=</h3>
+<h4 data-parsoid='{}'>=foo=</h4>
+<h5 data-parsoid='{}'>=foo=</h5>
+<h6 data-parsoid='{}'>=foo=</h6>
 !! wikitext
 = =foo= =
 
@@ -26148,8 +25746,7 @@ parsoid=html2wt
 ====<nowiki>=foo=</nowiki>====
 =====<nowiki>=foo=</nowiki>=====
 ======<nowiki>=foo=</nowiki>======
-
-!!end
+!! end
 
 !! test
 Headings: 2. Outside heading nest on a single line <h1>foo</h1>*bar
@@ -26260,7 +25857,6 @@ parsoid=wt2html,html2html
 <h1><span class="mw-headline" id=".3D">=</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: =">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 <h1><span class="mw-headline" id=".3D.3D">==</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: ==">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 <h2><span class="mw-headline" id=".3D_2">=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: =">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-
 !! html/parsoid
 <p>=
 ==</p>
@@ -26392,7 +25988,6 @@ new
 
 ==A==
 a
-
 !! end
 
 !! test
@@ -26405,7 +26000,6 @@ parsoid=wt2html
 ===============
 !! html/php
 <h6><span id=".3D.3D.3D"></span><span class="mw-headline" id="===">===</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: ===">edit</a><span class="mw-editsection-bracket">]</span></span></h6>
-
 !! html/parsoid
 <h6 id="==="><span id=".3D.3D.3D" typeof="mw:FallbackId"></span>===</h6>
 !! end
@@ -26749,7 +26343,6 @@ parsoid=html2wt
 </td>
 <td>a<i><div>b||c</div></i>
 </td></tr></table>
-
 !! end
 
 !! test
@@ -26761,7 +26354,6 @@ parsoid=html2wt
 <tr>
 <td>foo!!bar
 </td></tr></table>
-
 !! wikitext
 {|
 |foo!!bar
@@ -26777,7 +26369,6 @@ parsoid=html2wt
 <tr>
 <th>foo!bar
 </th></tr></table>
-
 !! wikitext
 {|
 !foo!bar
@@ -26813,7 +26404,6 @@ parsoid=html2wt
 </th>
 <th><i><span>foo!!bar</span></i>
 </th></tr></table>
-
 !! end
 
 !! test
@@ -26837,7 +26427,6 @@ parsoid=html2wt
 </th>
 <th>foo||bar
 </th></tr></table>
-
 !! end
 
 !! test
@@ -26852,7 +26441,6 @@ parsoid=html2wt
 <tr>
 <td>-bar
 </td></tr></table>
-
 !! wikitext
 {|
 !-bar
@@ -26873,7 +26461,6 @@ parsoid=html2wt
 <tr>
 <td>+bar
 </td></tr></table>
-
 !! wikitext
 {|
 !+bar
@@ -26936,7 +26523,6 @@ bar|baz
 <td>x
 <div>a|b</div>
 </td></tr></table>
-
 !! end
 
 !! test
@@ -26964,7 +26550,6 @@ parsoid=html2wt
 </td>
 <td>-2
 </td></tr></table>
-
 !! end
 
 !! test
@@ -26991,7 +26576,6 @@ parsoid=html2wt
 <td>x</td>
 <td>}
 </td></tr></table>
-
 !! end
 
 !! test
@@ -27086,7 +26670,6 @@ parsoid=html2wt
 </td>
 <td>bar&gt;
 </td></tr></table>
-
 !! end
 
 #### --------------- Links ----------------
@@ -27135,7 +26718,7 @@ parsoid=html2wt
 [[Foo|x <nowiki>[http://google.com g]</nowiki> x]]
 [[Foo|<nowiki>[[Bar]]</nowiki>]]
 [[Foo|<nowiki>x [[Bar]] x</nowiki>]]
-[[Foo|<nowiki>|Bar</nowiki>]]
+[[Foo||Bar]]
 [[Foo|<nowiki>]]bar</nowiki>]]
 [[Foo|<nowiki>[[bar</nowiki>]]
 [[Foo|<nowiki>x [[ y</nowiki>]]
@@ -27971,8 +27554,7 @@ parsoid=wt2html,html2html
 !! wikitext
 <div title="Hello world />Foo
 !! html/php+tidy
-<div title="Hello world"></div><p>Foo
-</p>
+<div title="Hello world"></div><p>Foo</p>
 !! html/parsoid
 <div title="Hello world " data-parsoid='{"stx":"html","selfClose":true}'></div><p>Foo</p>
 !! end
@@ -27990,13 +27572,11 @@ parsoid=wt2html,html2html
 <tr>
 <td title="Hello world">Foo
 </td></tr></table>
-
 !! html/parsoid
 <table>
 <tr>
 <td title="Hello world">Foo
 </td></tr></table>
-
 !! end
 
 !! test
@@ -28015,14 +27595,12 @@ parsoid=wt2html,html2html
 </td>
 <td style="color:red">Bar
 </td></tr></table>
-
 !! html/parsoid
 <table><tbody>
 <tr>
 <td title="Hello world">Foo
 </td><td style="color: red">Bar
 </td></tr></tbody></table>
-
 !! end
 
 !!test
@@ -28037,8 +27615,7 @@ Accept empty td cell attribute
 <td align="center">foo</td>
 <td>
 </td></tr></table>
-
-!!end
+!! end
 
 !!test
 Non-empty attributes in th-cells
@@ -28052,8 +27629,7 @@ Non-empty attributes in th-cells
 <th>Foo</th>
 <th style="color: red">Bar
 </th></tr></table>
-
-!!end
+!! end
 
 !!test
 Accept empty attributes in th-cells
@@ -28067,8 +27643,7 @@ Accept empty attributes in th-cells
 <th>foo</th>
 <th>bar
 </th></tr></table>
-
-!!end
+!! end
 
 !!test
 Empty table rows go away
@@ -28088,7 +27663,6 @@ Empty table rows go away
 </td></tr>
 
 </table>
-
 !! end
 
 ###
@@ -28107,7 +27681,6 @@ RT-ed inter-element separators should be valid separators
 <table>
 
 </table>
-
 !! html/parsoid
 <table>
 <tbody><tr class='mw-empty-elt' data-parsoid='{"startTagSrc":"|-","a":{"[[foo]]":null},"sa":{"[[foo]]":""},"autoInsertedEnd":true}'></tr>
@@ -28155,8 +27728,7 @@ Empty TD followed by TD with tpl-generated attribute
 </td>
 <td>foo
 </td></tr></table>
-
-!!end
+!! end
 
 !!test
 Indented table with an empty td
@@ -28174,8 +27746,7 @@ Indented table with an empty td
 </td>
 <td>foo
 </td></tr></table>
-
-!!end
+!! end
 
 !! test
 Indented table with blank lines in between (T85627)
@@ -28192,7 +27763,6 @@ Indented table with blank lines in between (T85627)
 <p><br /> 
 </p>
 </td></tr></table>
-
 !! html/parsoid
  <table>
  <tbody><tr><td>foo
@@ -28214,7 +27784,6 @@ Indented block & table
 <tr>
 <td>foo
 </td></tr></table>
-
 !! html/parsoid
  <div data-parsoid='{"stx":"html"}'>foo</div>
  <table><tbody>
@@ -28235,7 +27804,6 @@ Indent and comment before table row
 <tr>
 <td>there
 </td></tr></table>
-
 !! html/parsoid
 <table>
  <!--hi--><tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'>
@@ -28289,8 +27857,7 @@ Empty TR followed by mixed-ws-comment line should RT correctly
 <tr>
 <!--c--> </tr><!--d-->
 </tbody></table>
-
-!!end
+!! end
 
 !!test
 Multi-line image caption generated by templates with/without trailing newlines
@@ -28555,8 +28122,7 @@ parsoid=wt2wt,wt2html
 !! wikitext
 <table>{{echo|hi</table>hello}}
 !! html/php+tidy
-hi<table></table><p>hello
-</p>
+hi<table></table><p>hello</p>
 !! html/parsoid
 <p about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"fostered":true,"autoInsertedEnd":true,"autoInsertedStart":true,"firstWikitextNode":"TABLE_html","pi":[[{"k":"1"}]]}' data-mw='{"parts":["&lt;table>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"hi&lt;/table>hello"}},"i":0}}]}'>hi</p><table about="#mwt2"></table><p about="#mwt2">hello</p>
 !! end
@@ -28582,6 +28148,7 @@ parsoid=wt2html
 !! end
 
 # Parsoid only for T66747
+# (Also core doesn't define {{#if}} in default install)
 !! test
 Properly encapsulate empty-content transclusions in fosterable positions
 !! wikitext
@@ -28608,7 +28175,6 @@ hello
 {{OpenTable}}
 |}
 !! html/parsoid
-
 !! end
 
 !! test
@@ -28920,6 +28486,7 @@ parsoid={
 !! test
 Image: Modifying alt attribute of an image (T58400)
 !! options
+disabled
 parsoid={
   "modes": ["wt2wt"],
   "changes": [
@@ -28977,7 +28544,7 @@ Image: Block level image should have \n before and after
 456
 !! html/parsoid
 <p>123</p>
-<figure class="mw-halign-right" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="17" width="150"/></a></figure>
+<figure class="mw-halign-right" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="17" width="150"/></a><figcaption></figcaption></figure>
 <p>456</p>
 !! end
 
@@ -28989,7 +28556,7 @@ Image: New block level image should have \n before and after (existing content)
 456
 !! html/parsoid
 <p>123</p>
-<figure class="mw-halign-right" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"150x150px"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="17" width="150" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"17","width":"150"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></figure>
+<figure class="mw-halign-right" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"150x150px"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="17" width="150" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"17","width":"150"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption></figcaption></figure>
 <p>456</p>
 !! end
 
@@ -29071,7 +28638,7 @@ Image: Invalid title as link
 <p><a href="/wiki/File:Foobar.jpg" class="image" title="link=&lt;"><img alt="link=&lt;" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a>
 </p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"link","ak":"link=&lt;"}]}' data-mw='{"caption":"link=&amp;lt;"}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{}}'><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":"File:Foobar.jpg"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"link","ak":"link=&lt;"}]}' data-mw='{"attribs":[["link",{"txt":"&lt;"}]]}'><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"/></a></figure-inline></p>
 !! end
 
 !! test
@@ -29088,11 +28655,11 @@ Various link types in alt and link options
 </p><p><a href="http://en.wikipedia.org/wiki/Foo" title="caption"><img alt="wikipedia:Foo" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a>
 </p>
 !! html/parsoid
-<p><figure-inline class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="./Main_Page" data-parsoid='{"a":{"href":"./Main_Page"},"sa":{"href":"link=[[Main Page]]"}}'><img alt="Main Page" 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":{"alt":"Main Page","resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"alt":"alt=[[Main Page]]","resource":"File:Foobar.jpg"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt1" data-mw='{"attribs":[["alt",{"html":"alt=&lt;a rel=\"mw:WikiLink\" href=\"./Main_Page\" title=\"Main Page\" data-parsoid=&apos;{\"stx\":\"simple\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main Page\"},\"dsr\":[41,216,2,2]}&apos;>Main Page&lt;/a>","txt":"Main Page"}]],"caption":"caption"}'><a href="./Main_Page" data-parsoid='{"a":{"href":"./Main_Page"},"sa":{"href":"link=[[Main Page]]"}}'><img alt="Main Page" 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"/></a></figure-inline></p>
 
-<p><figure-inline class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="./Media:Thumb.png" data-parsoid='{"a":{"href":"./Media:Thumb.png"},"sa":{"href":"link=[[Media:Thumb.png]]"}}'><img alt="Media:Thumb.png" 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":{"alt":"Media:Thumb.png","resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"alt":"alt=[[Media:Thumb.png]]","resource":"File:Foobar.jpg"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt3" data-mw='{"attribs":[["alt",{"html":"alt=&lt;a rel=\"mw:MediaLink\" href=\"//example.com/images/e/ea/Thumb.png\" resource=\"./Media:Thumb.png\" title=\"Thumb.png\" data-parsoid=&apos;{\"a\":{\"resource\":\"./Media:Thumb.png\"},\"sa\":{\"resource\":\"Media:Thumb.png\"},\"dsr\":[113,216,null,null]}&apos;>Media:Thumb.png&lt;/a>","txt":"Media:Thumb.png"}]],"caption":"caption"}'><a href="./Media:Thumb.png" data-parsoid='{"a":{"href":"./Media:Thumb.png"},"sa":{"href":"link=[[Media:Thumb.png]]"}}'><img alt="Media:Thumb.png" 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"/></a></figure-inline></p>
 
-<p><figure-inline class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"link=[[wikipedia:Foo]]"}}'><img alt="wikipedia:Foo" 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":{"alt":"wikipedia:Foo","resource":"./File:Foobar.jpg","height":"220","width":"1941"},"sa":{"alt":"alt=[[wikipedia:Foo]]","resource":"File:Foobar.jpg"}}'/></a></figure-inline></p>
+<p><figure-inline class="mw-default-size" typeof="mw:Image mw:ExpandedAttrs" about="#mwt2" data-mw='{"attribs":[["alt",{"html":"alt=&lt;a rel=\"mw:WikiLink/Interwiki\" href=\"http://en.wikipedia.org/wiki/Foo\" title=\"wikipedia:Foo\" data-parsoid=&apos;{\"stx\":\"simple\",\"a\":{\"href\":\"http://en.wikipedia.org/wiki/Foo\"},\"sa\":{\"href\":\"wikipedia:Foo\"},\"isIW\":true,\"dsr\":[189,216,2,2]}&apos;>wikipedia:Foo&lt;/a>","txt":"wikipedia:Foo"}]],"caption":"caption"}'><a href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"link=[[wikipedia:Foo]]"}}'><img alt="wikipedia:Foo" 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"/></a></figure-inline></p>
 !! end
 
 !! test
@@ -30422,6 +29989,28 @@ parsoid= {
 |}
 !! end
 
+## Don't necessarily expect this to roundtrip, but run serialization to catch crashers
+!! test
+File in link scenarios
+!! options
+parsoid={
+  "modes": ["wt2html","html2wt"],
+  "suppressErrors": true
+}
+!! wikitext
+[http://www.google.com [[File:Foobar.jpg|123]]]
+
+[http://www.google.com [[File:Foobar.jpg|thumb|123]]]
+!! html/php+tidy
+<p><a rel="nofollow" class="external text" href="http://www.google.com"></a><a href="/wiki/File:Foobar.jpg" class="image" title="123"><img alt="123" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a>
+</p>
+<a rel="nofollow" class="external text" href="http://www.google.com"></a><div class="thumb tright"><a rel="nofollow" class="external text" href="http://www.google.com"></a><div class="thumbinner" style="width:182px;"><a rel="nofollow" class="external text" href="http://www.google.com"></a><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>123</div></div></div>
+!! html/parsoid
+<p><a rel="mw:ExtLink" class="external text" href="http://www.google.com" data-parsoid='{"targetOff":23,"contentOffsets":[23,46]}'><figure-inline class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"caption","ak":"123"}]}' data-mw='{"caption":"123"}'></figure-inline></a><a href="./File:Foobar.jpg" data-parsoid='{"misnested":true}'><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":"File:Foobar.jpg"},"misnested":true}'/></a></p>
+
+<a rel="mw:ExtLink" class="external autonumber" href="http://www.google.com" data-parsoid='{"targetOff":72,"contentOffsets":[72,101]}'></a><figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"123"}]}'><a rel="mw:ExtLink" class="external autonumber" href="http://www.google.com" data-parsoid='{"targetOff":72,"contentOffsets":[72,101]}'></a><a href="./File:Foobar.jpg" data-parsoid='{"misnested":true}'><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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"File:Foobar.jpg"},"misnested":true}'/></a><figcaption data-parsoid='{"misnested":true}'>123</figcaption></figure>
+!! end
+
 # --------------------------------------------
 # Tests spec'ing wikitext serialization norms |
 # --------------------------------------------
@@ -30752,7 +30341,6 @@ parsoid={
 
 [[foo]]
 x
-
 !! end
 
 !! test
@@ -31563,7 +31151,7 @@ Thumbnail output
 !! html/php+tidy
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Thumb.png" class="image"><img alt="Thumb.png" src="http://example.com/images/e/ea/Thumb.png" decoding="async" width="135" height="135" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Thumb.png" class="internal" title="Enlarge"></a></div></div></div></div>
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Thumb.png"><img resource="./File:Thumb.png" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Thumb.png"><img resource="./File:Thumb.png" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption></figcaption></figure>
 !! end
 
 !! test
@@ -31756,7 +31344,6 @@ Decoding of HTML entities in embedded HTML tags
 <table class="1&2&amp;3&amp;amp;4&amp;amp;amp;5"><tr><td>x</td></tr></table>
 !! html/php
 <table class="1&amp;2&amp;3&amp;amp;4&amp;amp;amp;5"><tr><td>x</td></tr></table>
-
 !! html/parsoid
 <table class="1&amp;2&amp;3&amp;amp;4&amp;amp;amp;5" data-parsoid='{"stx":"html","a":{"class":"1&amp;2&amp;3&amp;amp;4&amp;amp;amp;5"},"sa":{"class":"1&amp;2&amp;amp;3&amp;amp;amp;4&amp;amp;amp;amp;5"}}'><tbody><tr data-parsoid='{"stx":"html"}'><td data-parsoid='{"stx":"html"}'>x</td></tr></tbody></table>
 !! end
@@ -32012,6 +31599,21 @@ parsoid={
 [[stats:v2/#/fr.wikipedia.org/reading/page-views-by-country/normal%7Cmap%7C2-Year~2016060100~2018071100%7C~total|10]]
 !! end
 
+## FIXME: "gerrit" isn't in PHP's setupInterwikis
+!! test
+T199926: Hash only interwiki link
+!! wikitext
+[[meatball:Test#1/2]]
+[[gerrit:#/q/project:mediawiki/services/parsoid|Gerrit]]
+!! html/php+tidy
+<p><a href="http://www.usemod.com/cgi-bin/mb.pl?Test#1.2F2" class="extiw" title="meatball:Test">meatball:Test#1/2</a>
+<a href="/index.php?title=Gerrit:&amp;action=edit&amp;redlink=1" class="new" title="Gerrit: (page does not exist)">Gerrit</a>
+</p>
+!! html/parsoid
+<p><a rel="mw:WikiLink/Interwiki" href="http://www.usemod.com/cgi-bin/mb.pl?Test#1.2F2" title="meatball:Test" data-parsoid='{"stx":"simple","a":{"href":"http://www.usemod.com/cgi-bin/mb.pl?Test#1.2F2"},"sa":{"href":"meatball:Test#1/2"},"isIW":true}'>meatball:Test#1/2</a>
+<a rel="mw:WikiLink/Interwiki" href="https://gerrit.wikimedia.org/#/q/project:mediawiki/services/parsoid">Gerrit</a></p>
+!! end
+
 !! test
 T179544: {{anchorencode:}} output should be always usable in links
 !! config
@@ -32031,6 +31633,7 @@ wgFragmentMode=[ 'html5' ]
 !! test
 Section wrapping for well-nested sections (no leading content)
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
 
 =3=
 f
+!! html/php+tidy
+
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p>
+<h1><span class="mw-headline" id="2">2</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: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>b
+</p>
+<h2><span class="mw-headline" id="2.1">2.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: 2.1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>c
+</p>
+<h2><span class="mw-headline" id="2.2">2.2</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: 2.2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>d
+</p>
+<h3><span class="mw-headline" id="2.2.1">2.2.1</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: 2.2.1">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
+<p>e
+</p>
+<h1><span class="mw-headline" id="3">3</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: 3">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>f
+</p>
 !! 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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">3</h1>
 <p>f</p>
 
 </section>
 !! test
 Section wrapping for well-nested sections (with leading content)
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
 
 ==2.1==
 c
+!! html/php+tidy
+<p>Para 1.
+</p><p>
+Para 2 with a </p><div>nested in it</div>
+<p>Para 3.
+</p>
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p>
+<h1><span class="mw-headline" id="2">2</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: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>b
+</p>
+<h2><span class="mw-headline" id="2.1">2.1</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: 2.1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>c
+</p>
 !! 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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">2.1</h2>
 <p>c</p>
 
 </section></section>
 !! test
 Section wrapping with template-generated sections (good nesting 1)
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
 ==1.1==
 b
 }}
-
 ==1.2==
 c
 
 =2=
 d
+!! html/php+tidy
+
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p>
+<h2><span class="mw-headline" id="1.1">1.1</span></h2>
+<p>b
+</p>
+<h2><span class="mw-headline" id="1.2">1.2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: 1.2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>c
+</p>
+<h1><span class="mw-headline" id="2">2</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: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>d
+</p>
 !! 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" data-parsoid="{}">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">
 </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" data-parsoid="{}">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" data-parsoid="{}">2</h1>
 <p>d</p></section>
 !! end
 
 !! test
 Section wrapping with template-generated sections (good nesting 2)
 !! options
+notoc
 parsoid={
   "wrapSections": true,
   "modes": ["wt2html", "wt2wt"]
 }}
 =2=
 e
+!! html/php+tidy
+
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p>
+<h2><span class="mw-headline" id="1.1">1.1</span></h2>
+<p>b
+</p>
+<h3><span class="mw-headline" id="1.1.1">1.1.1</span></h3>
+<p>d
+</p>
+<h1><span class="mw-headline" id="2">2</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: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>e
+</p>
 !! html/parsoid
 <section data-mw-section-id="0"></section><section data-mw-section-id="1"><h1 id="1">1</h1>
 <p>a</p>
 !! test
 Section wrapping with template-generated sections (good nesting 3)
 !! options
+notoc
 parsoid={
   "wrapSections": true,
   "modes": ["wt2html", "wt2wt"]
 }}
 =2=
 e
+!! html/php+tidy
+
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p><p>x
+</p>
+<h2><span class="mw-headline" id="1.1">1.1</span></h2>
+<p>b
+</p>
+<h2><span class="mw-headline" id="1.2">1.2</span></h2>
+<p>c
+</p>
+<h3><span class="mw-headline" id="1.2.1">1.2.1</span></h3>
+<p>d
+</p>
+<h1><span class="mw-headline" id="2">2</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: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>e
+</p>
 !! 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>
 !! test
 Section wrapping with template-generated sections (bad nesting 1)
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
@@ -32233,24 +31921,31 @@ parsoid={
 <div>
 a
 
-{{echo|
+{{echo|1=
 =1=
 b
 }}
 
 c
 </div>
+!! html/php+tidy
+<div>
+<p>a
+</p>
+<h1><span class="mw-headline" id="1">1</span></h1>
+<p>b
+</p><p>c
+</p>
+</div>
 !! html/parsoid
 <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><p about="#mwt1">b
-</p><span about="#mwt1">
+<section data-mw-section-id="-1"><h1 about="#mwt1" typeof="mw:Transclusion" id="1" data-parsoid='{"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"=1=\nb"}},"i":0}}]}'>1</h1><span about="#mwt1">
+</span><p about="#mwt1">b</p>
 
-</span><p about="#mwt1">c</p><span about="#mwt1">
-</span></section></div></section>
+<p>c</p>
+</section></div></section>
 !! end
 
 # Because of section-wrapping and template-wrapping interactions,
 !! test
 Section wrapping with template-generated sections (bad nesting 2)
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
 
 =3=
 e
+!! html/php+tidy
+
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p>
+<h1><span class="mw-headline" id="2">2</span></h1>
+<p>b
+</p>
+<h2><span class="mw-headline" id="2.1">2.1</span></h2>
+<p>c
+</p><p>d
+</p>
+<h1><span class="mw-headline" id="3">3</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: 3">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>e
+</p>
 !! 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" data-parsoid="{}">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">
 
 </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" data-parsoid="{}">3</h1>
 <p>e</p></section>
 !! end
 
 !! test
 Section wrapping with template-generated sections (bad nesting 3)
 !! options
+notoc
 parsoid={
   "wrapSections": true,
   "modes": ["wt2html", "wt2wt"]
 
 =3=
 e
+!! html/php+tidy
+
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p>
+<h2><span class="mw-headline" id="1.2">1.2</span></h2>
+<p>b
+</p>
+<h1><span class="mw-headline" id="2">2</span></h1>
+<p>c
+</p><p>d
+</p>
+<h1><span class="mw-headline" id="3">3</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: 3">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>e
+</p>
 !! 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>
 <p>a</p>
 !! test
 Section wrapping with uneditable lead section + div wrapping multiple sections
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
 
 ==3.1==
 e
+!! html/php+tidy
+<p>foo
+</p>
+<div style="border:1px solid red;">
+
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p>
+<h2><span class="mw-headline" id="1.1">1.1</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: 1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>b
+</p>
+<h1><span class="mw-headline" id="2">2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>c
+</p>
+</div>
+<h1><span class="mw-headline" id="3">3</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: 3">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>d
+</p>
+<h2><span class="mw-headline" id="3.1">3.1</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: 3.1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>e
+</p>
 !! 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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">3.1</h2>
 <p>e</p>
 </section></section>
 !! end
 !! test
 Section wrapping with editable lead section + div overlapping multiple sections
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
 
 ==3.1==
 g
+!! html/php+tidy
+<p>foo
+</p>
+
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p>
+<div style="border:1px solid red;">
+<p>b
+</p>
+<h2><span class="mw-headline" id="1.1">1.1</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: 1.1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>c
+</p>
+<h1><span class="mw-headline" id="2">2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>d
+</p>
+</div>
+<p>e
+</p>
+<h1><span class="mw-headline" id="3">3</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: 3">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>f
+</p>
+<h2><span class="mw-headline" id="3.1">3.1</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: 3.1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>g
+</p>
 !! 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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">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" data-parsoid="{}">3.1</h2>
 <p>g</p>
 </section></section>
 !! end
 !! test
 HTML header tags should not be wrapped in section tags
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
@@ -32449,21 +32225,30 @@ foo
 <h1>c</h1>
 
 =d=
+!! html/php+tidy
+<p>foo
+</p>
+
+<h1><span class="mw-headline" id="a">a</span></h1>
+<h1><span class="mw-headline" id="b">b</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: b">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<h1><span class="mw-headline" id="c">c</span></h1>
+<h1><span class="mw-headline" id="d">d</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: d">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
 !! 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" data-parsoid="{}">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" data-parsoid="{}">d</h1></section>
 !! end
 
 !! test
 Lead section containing only whitespace and comments.
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
 
 =2=
 b
+!! html/php+tidy
+<h1><span class="mw-headline" id="1">1</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: 1">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>a
+</p>
+<h1><span class="mw-headline" id="2">2</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: 2">edit</a><span class="mw-editsection-bracket">]</span></span></h1>
+<p>b
+</p>
 !! 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" data-parsoid="{}">1</h1>
 <p>a</p>
 
-</section><section data-mw-section-id="2"><h1 id="2">2</h1>
-<p>b</p></section>
+</section><section data-mw-section-id="2"><h1 id="2" data-parsoid="{}">2</h1>
+<p>b</p>
+</section>
 !! end
 
 !! test
-Pseudo-sections emitted by templates should have id -2 
+Pseudo-sections emitted by templates should have id -2
 !! options
+notoc
 parsoid={
   "wrapSections": true
 }
@@ -32498,6 +32292,13 @@ foo
 ==b==
 </div>
 }}
+!! html/php+tidy
+<p>foo
+</p>
+<div>
+<h2><span class="mw-headline" id="a">a</span></h2>
+<h2><span class="mw-headline" id="b">b</span></h2>
+</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}}]}'>
@@ -32507,6 +32308,118 @@ foo
 </span></section>
 !! end
 
+!! test
+T213468: Transcluded sections don't get PHP section numbers
+!! options
+notoc
+parsoid={
+  "wrapSections": true
+}
+!! wikitext
+==PHP section=1==
+{{echo|1=
+== This is counted as if it were section 2 ==
+}}
+==PHP section=3==
+!! html/php+tidy
+<h2><span class="mw-headline" id="PHP_section.3D1">PHP section=1</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: PHP section=1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="This_is_counted_as_if_it_were_section_2">This is counted as if it were section 2</span></h2>
+<h2><span class="mw-headline" id="PHP_section.3D3">PHP section=3</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: PHP section=3">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+!! html/parsoid
+<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h2 id="PHP_section=1" data-parsoid="{}"><span id="PHP_section.3D1" typeof="mw:FallbackId"></span>PHP section=1</h2>
+</section><section data-mw-section-id="-1"><h2 about="#mwt1" typeof="mw:Transclusion" id="This_is_counted_as_if_it_were_section_2" data-parsoid='{"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"== This is counted as if it were section 2 =="}},"i":0}}]}'>This is counted as if it were section 2</h2>
+</section><section data-mw-section-id="3"><h2 id="PHP_section=3" data-parsoid="{}"><span id="PHP_section.3D3" typeof="mw:FallbackId"></span>PHP section=3</h2></section>
+!! end
+
+!! test
+T213468: Corner cases in edit section ID assignment in tokenizer
+!! options
+notoc
+parsoid={
+  "wrapSections": true
+}
+!! wikitext
+==PHP section=1==
+{{echo|Not a section|
+== This is counted as if it were section 2 ==
+}}
+==PHP section=3==
+{{echo3|1=
+== This is counted as if it were section 4 ==
+}}
+==PHP section=5==
+{{#tag:p|Not a section|data-ignored=
+== This is counted as if it were section 6 ==
+}}
+==PHP section=7==
+{{echo|1=Not a ==heading==}}
+==PHP section=8==
+[[File:Foobar.jpg|thumb|
+==This is section 9, even though it's in a caption==
+]]
+==PHP section=10==
+!! html/php+tidy
+
+<h2><span class="mw-headline" id="PHP_section.3D1">PHP section=1</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: PHP section=1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>Not a section
+</p>
+<h2><span class="mw-headline" id="PHP_section.3D3">PHP section=3</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: PHP section=3">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="This_is_counted_as_if_it_were_section_4">This is counted as if it were section 4</span></h2>
+<h2><span class="mw-headline" id="This_is_counted_as_if_it_were_section_4_2">This is counted as if it were section 4</span></h2>
+<h2><span class="mw-headline" id="This_is_counted_as_if_it_were_section_4_3">This is counted as if it were section 4</span></h2>
+<h2><span class="mw-headline" id="PHP_section.3D5">PHP section=5</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: PHP section=5">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p data-ignored="== This is counted as if it were section 6 ==">Not a section</p>
+<h2><span class="mw-headline" id="PHP_section.3D7">PHP section=7</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: PHP section=7">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<p>Not a ==heading==
+</p>
+<h2><span class="mw-headline" id="PHP_section.3D8">PHP section=8</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: PHP section=8">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" decoding="async" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><h2><span class="mw-headline" id="This_is_section_9.2C_even_though_it.27s_in_a_caption">This is section 9, even though it's in a caption</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: This is section 9, even though it&#039;s in a caption">edit</a><span class="mw-editsection-bracket">]</span></span></h2></div></div></div>
+<h2><span class="mw-headline" id="PHP_section.3D10">PHP section=10</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: PHP section=10">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+!! html/parsoid
+<section data-mw-section-id="0"></section><section data-mw-section-id="1"><h2 id="PHP_section=1" data-parsoid="{}"><span id="PHP_section.3D1" typeof="mw:FallbackId"></span>PHP section=1</h2>
+<p about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"},{"k":"2"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Not a section"},"2":{"wt":"\n== This is counted as if it were section 2 ==\n"}},"i":0}}]}'>Not a section</p>
+</section><section data-mw-section-id="3"><h2 id="PHP_section=3" data-parsoid="{}"><span id="PHP_section.3D3" typeof="mw:FallbackId"></span>PHP section=3</h2>
+</section><section data-mw-section-id="-1" about="#mwt5" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":["",{"template":{"target":{"wt":"echo3","href":"./Template:Echo3"},"params":{"1":{"wt":"== This is counted as if it were section 4 =="}},"i":0}},"\n"]}'><h2 about="#mwt2" typeof="mw:Transclusion" id="This_is_counted_as_if_it_were_section_4" data-parsoid='{"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo3","href":"./Template:Echo3"},"params":{"1":{"wt":"== This is counted as if it were section 4 =="}},"i":0}}]}'>This is counted as if it were section 4</h2><span about="#mwt2">
+</span></section><section data-mw-section-id="-1" about="#mwt5"><h2 about="#mwt2" id="This_is_counted_as_if_it_were_section_4_2">This is counted as if it were section 4</h2><span about="#mwt2">
+</span></section><section data-mw-section-id="-1" about="#mwt5"><h2 about="#mwt2" id="This_is_counted_as_if_it_were_section_4_3">This is counted as if it were section 4</h2>
+</section><section data-mw-section-id="5"><h2 id="PHP_section=5" data-parsoid="{}"><span id="PHP_section.3D5" typeof="mw:FallbackId"></span>PHP section=5</h2>
+<p data-ignored=" This is counted as if it were section 6 " about="#mwt3" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"},{"k":"data-ignored","named":true,"spc":["","","\n","\n"]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"#tag:p","function":"tag"},"params":{"1":{"wt":"Not a section"},"data-ignored":{"wt":"== This is counted as if it were section 6 =="}},"i":0}}]}'>Not a section</p>
+</section><section data-mw-section-id="7"><h2 id="PHP_section=7" data-parsoid="{}"><span id="PHP_section.3D7" typeof="mw:FallbackId"></span>PHP section=7</h2>
+<p about="#mwt4" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1","named":true}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Not a ==heading=="}},"i":0}}]}'>Not a ==heading==</p>
+</section><section data-mw-section-id="8"><h2 id="PHP_section=8" data-parsoid="{}"><span id="PHP_section.3D8" typeof="mw:FallbackId"></span>PHP section=8</h2>
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"caption","ak":"\n== This is counted as if it were section 9 ==\n"}]}'><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" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>
+<section data-mw-section-id="-1"><h2 id="This_is_section_9,_even_though_it's_in_a_caption" data-parsoid="{}"><span id="This_is_section_9.2C_even_though_it.27s_in_a_caption" typeof="mw:FallbackId"></span>This is section 9, even though it's in a caption</h2>
+</section></figcaption></figure>
+</section><section data-mw-section-id="10"><h2 id="PHP_section=10" data-parsoid="{}"><span id="PHP_section.3D10" typeof="mw:FallbackId" data-parsoid='{"dsr":[412,412]}'></span>PHP section=10</h2></section>
+!! end
+
+!! test
+T215628: Section numbering and <includeonly> and <noinclude> on a page
+!! options
+notoc
+parsoid={
+  "wrapSections": true
+}
+!! wikitext
+==PHP section=1==
+<noinclude>
+==PHP section=2==
+</noinclude>
+==PHP section=3==
+<includeonly>
+==This is not counted as section 4==
+</includeonly>
+==PHP section=4==
+!! html/php+tidy
+
+<h2><span class="mw-headline" id="PHP_section.3D1">PHP section=1</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: PHP section=1">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="PHP_section.3D2">PHP section=2</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: PHP section=2">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="PHP_section.3D3">PHP section=3</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: PHP section=3">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="PHP_section.3D4">PHP section=4</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: PHP section=4">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
+!! html/parsoid
+PARSOID HAS A BUG HERE: T215628
+!! end
+
 ##########################################################################
 Tests demonstrating white-space insensitivity in input wikitext
 for wikitext headings, wikitext list items, and wikitext table captions,
index 79ce634..1ef0c91 100644 (file)
@@ -130,4 +130,18 @@ trait PHPUnit4And6Compat {
                        // ->disallowMockingUnknownTypes()
                        ->getMock();
        }
+
+       /**
+        * Marks the current test as risky. This
+        * is a forward port of the markAsRisky function that
+        * was introduced in PHPUnit 5.7.6.
+        */
+       public function markAsRisky() {
+               if ( is_callable( 'parent::markAsRisky' ) ) {
+                       return parent::markAsRisky();
+               }
+
+               // "risky" tests are not supported in phpunit 4, so just ignore
+       }
+
 }
index 15c70bc..1f2b13c 100644 (file)
@@ -593,7 +593,6 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
                        ] ],
                        'revision' => [ 'revision', 'rev_user', 'rev_id', [
                                'rev_page' => 42,
-                               'rev_text_id' => 42,
                                'rev_len' => 0,
                                'rev_timestamp' => $db->timestamp(),
                        ] ],
@@ -679,7 +678,6 @@ class ActorMigrationTest extends MediaWikiLangTestCase {
                        $m->getInsertValuesWithTempTable( $this->db, 'rev_user', $userIdentity );
                $extraFields = [
                        'rev_page' => 42,
-                       'rev_text_id' => 42,
                        'rev_len' => 0,
                        'rev_timestamp' => $this->db->timestamp(),
                ] + $cFields;
index bc9bafa..438d3e7 100644 (file)
@@ -285,6 +285,48 @@ class LinkerTest extends MediaWikiLangTestCase {
                );
        }
 
+       /**
+        * @covers Linker::generateRollback
+        * @dataProvider provideCasesForRollbackGeneration
+        */
+       public function testGenerateRollback( $rollbackEnabled, $expectedModules ) {
+               $this->markTestSkippedIfDbType( 'postgres' );
+
+               $context = RequestContext::getMain();
+               $user = $context->getUser();
+               $user->setOption( 'showrollbackconfirmation', $rollbackEnabled );
+
+               $pageData = $this->insertPage( 'Rollback_Test_Page' );
+               $page = WikiPage::factory( $pageData['title'] );
+
+               $updater = $page->newPageUpdater( $user );
+               $updater->setContent( \MediaWiki\Revision\SlotRecord::MAIN,
+                       new TextContent( 'Technical Wishes 123!' )
+               );
+               $summary = CommentStoreComment::newUnsavedComment( 'Some comment!' );
+               $updater->saveRevision( $summary );
+
+               $rollbackOutput = Linker::generateRollback( $page->getRevision(), $context );
+               $modules = $context->getOutput()->getModules();
+
+               $this->assertEquals( $expectedModules, $modules );
+               $this->assertContains( 'rollback 1 edit', $rollbackOutput );
+       }
+
+       public static function provideCasesForRollbackGeneration() {
+               return [
+                       [
+                               true,
+                               [ 'mediawiki.page.rollback.confirmation' ]
+
+                       ],
+                       [
+                               false,
+                               []
+                       ]
+               ];
+       }
+
        public static function provideCasesForFormatLinksInComment() {
                // phpcs:disable Generic.Files.LineLength
                return [
index f8c75fa..097aef7 100644 (file)
@@ -1626,7 +1626,7 @@ class OutputPageTest extends MediaWikiTestCase {
                                        "<p><b>Bold</b>\n</p>",
                                ], 'No section edit links' => [
                                        [ '== Title ==' ],
-                                       "<h2><span class=\"mw-headline\" id=\"Title\">Title</span></h2>\n",
+                                       "<h2><span class=\"mw-headline\" id=\"Title\">Title</span></h2>",
                                ],
                        ],
                        'addWikiTextWithTitle' => [
@@ -1655,7 +1655,7 @@ class OutputPageTest extends MediaWikiTestCase {
                                        '<p>* Not a list</p>',
                                ], 'No section edit links' => [
                                        [ '== Title ==' ],
-                                       "<h2><span class=\"mw-headline\" id=\"Title\">Title</span></h2>\n",
+                                       "<h2><span class=\"mw-headline\" id=\"Title\">Title</span></h2>",
                                ], 'With title at start' => [
                                        [ '* {{PAGENAME}}', true, Title::newFromText( 'Talk:Some page' ) ],
                                        "<ul><li>Some page</li></ul>\n",
@@ -1671,10 +1671,10 @@ class OutputPageTest extends MediaWikiTestCase {
                                // Preferred interface: output is tidied
                                'SpecialNewimages' => [
                                        [ "<p lang='en' dir='ltr'>\nMy message" ],
-                                       '<p lang="en" dir="ltr">' . "\nMy message\n</p>"
+                                       '<p lang="en" dir="ltr">' . "\nMy message</p>"
                                ], 'List at start' => [
                                        [ '* List' ],
-                                       "<ul><li>List</li></ul>\n",
+                                       "<ul><li>List</li></ul>",
                                ], 'List not at start' => [
                                        [ '* <b>Not a list', false ],
                                        '<p>* <b>Not a list</b></p>',
@@ -1686,7 +1686,7 @@ class OutputPageTest extends MediaWikiTestCase {
                                        "<p>* Some page</p>",
                                ], 'EditPage' => [
                                        [ "<div class='mw-editintro'>{{PAGENAME}}", true, Title::newFromText( 'Talk:Some page' ) ],
-                                       '<div class="mw-editintro">' . "Some page\n</div>"
+                                       '<div class="mw-editintro">' . "Some page</div>"
                                ],
                        ],
                        'wrapWikiTextAsInterface' => [
@@ -1695,7 +1695,7 @@ class OutputPageTest extends MediaWikiTestCase {
                                        "<div class=\"wrapperClass\"><p>text\n</p></div>"
                                ], 'Spurious </div>' => [
                                        [ 'wrapperClass', 'text</div><div>more' ],
-                                       "<div class=\"wrapperClass\"><p>text</p><div>more\n</div></div>"
+                                       "<div class=\"wrapperClass\"><p>text</p><div>more</div></div>"
                                ], 'Extra newlines would break <p> wrappers' => [
                                        [ 'two classes', "1\n\n2\n\n3" ],
                                        "<div class=\"two classes\"><p>1\n</p><p>2\n</p><p>3\n</p></div>"
@@ -1969,12 +1969,12 @@ class OutputPageTest extends MediaWikiTestCase {
                return [
                        'List at start of line (content)' => [
                                [ '* List', true, false ],
-                               "<div class=\"mw-parser-output\"><ul><li>List</li></ul>\n</div>",
-                               "<ul><li>List</li></ul>\n",
+                               "<div class=\"mw-parser-output\"><ul><li>List</li></ul></div>",
+                               "<ul><li>List</li></ul>",
                        ],
                        'List at start of line (interface)' => [
                                [ '* List', true, true ],
-                               "<ul><li>List</li></ul>\n",
+                               "<ul><li>List</li></ul>",
                        ],
                        'List not at start (content)' => [
                                [ "* ''Not'' list", false, false ],
@@ -2012,9 +2012,8 @@ class OutputPageTest extends MediaWikiTestCase {
                        'No section edit links' => [
                                [ '== Header ==' ],
                                '<div class="mw-parser-output"><h2><span class="mw-headline" id="Header">' .
-                                       "Header</span></h2>\n</div>",
-                               '<h2><span class="mw-headline" id="Header">Header</span></h2>' .
-                                       "\n",
+                                       "Header</span></h2></div>",
+                               '<h2><span class="mw-headline" id="Header">Header</span></h2>',
                        ]
                ];
        }
@@ -2065,7 +2064,7 @@ class OutputPageTest extends MediaWikiTestCase {
                return [
                        'List at start of line' => [
                                [ '* List', true ],
-                               "<ul><li>List</li></ul>\n",
+                               "<ul><li>List</li></ul>",
                        ],
                        'List not at start' => [
                                [ "* ''Not'' list", false ],
@@ -2084,8 +2083,7 @@ class OutputPageTest extends MediaWikiTestCase {
                        ],
                        'No section edit links' => [
                                [ '== Header ==' ],
-                               '<h2><span class="mw-headline" id="Header">Header</span></h2>' .
-                                       "\n",
+                               '<h2><span class="mw-headline" id="Header">Header</span></h2>',
                        ]
                ];
        }
index dbd271a..0110531 100644 (file)
@@ -45,7 +45,7 @@ trait McrSchemaOverride {
                        $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'patch-slot_roles' );
                        $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'patch-content_models' );
                        $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'patch-content' );
-                       $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'patch-slots.sql' );
+                       $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'patch-slots' );
                }
 
                if ( !$this->hasPreMcrFields( $db ) ) {
index bbc1192..14d7f09 100644 (file)
@@ -165,6 +165,7 @@ class CheckBlocksSecondaryAuthenticationProviderTest extends \MediaWikiTestCase
                        $user->saveSettings();
                }
                $this->setMwGlobals( [ 'wgUser' => $user ] );
+               \RequestContext::getMain()->setUser( $user );
                $newuser = \User::newFromName( 'RandomUser' );
 
                $provider = new CheckBlocksSecondaryAuthenticationProvider(
index 7d0c839..b30c7a4 100644 (file)
@@ -3,6 +3,9 @@
 namespace MediaWiki\Logger\Monolog;
 
 /**
+ * Flay per https://phabricator.wikimedia.org/T218688.
+ *
+ * @group Broken
  * @covers \MediaWiki\Logger\Monolog\CeeFormatter
  */
 class CeeFormatterTest extends \PHPUnit\Framework\TestCase {
index ad8aa1e..1f6f4e8 100644 (file)
@@ -527,6 +527,7 @@ class SanitizerTest extends MediaWikiTestCase {
                        ],
                        [ '1<span class="<?php">2</span>3', '123' ],
                        [ '1<span class="<?">2</span>3', '123' ],
+                       [ '<th>1</th><td>2</td>', '1 2' ],
                ];
        }
 
index 164b466..642e8b4 100644 (file)
@@ -777,30 +777,36 @@ class UserTest extends MediaWikiTestCase {
         * @covers User::getBlockedStatus
         */
        public function testSoftBlockRanges() {
-               global $wgUser;
-
-               $this->setMwGlobals( [
-                       'wgSoftBlockRanges' => [ '10.0.0.0/8' ],
-                       'wgUser' => null,
-               ] );
+               $setSessionUser = function ( User $user, WebRequest $request ) {
+                       $this->setMwGlobals( 'wgUser', $user );
+                       RequestContext::getMain()->setUser( $user );
+                       RequestContext::getMain()->setRequest( $request );
+                       TestingAccessWrapper::newFromObject( $user )->mRequest = $request;
+                       $request->getSession()->setUser( $user );
+               };
+               $this->setMwGlobals( 'wgSoftBlockRanges', [ '10.0.0.0/8' ] );
 
                // IP isn't in $wgSoftBlockRanges
+               $wgUser = new User();
                $request = new FauxRequest();
                $request->setIP( '192.168.0.1' );
-               $wgUser = User::newFromSession( $request );
+               $setSessionUser( $wgUser, $request );
                $this->assertNull( $wgUser->getBlock() );
 
                // IP is in $wgSoftBlockRanges
+               $wgUser = new User();
                $request = new FauxRequest();
                $request->setIP( '10.20.30.40' );
-               $wgUser = User::newFromSession( $request );
+               $setSessionUser( $wgUser, $request );
                $block = $wgUser->getBlock();
                $this->assertInstanceOf( Block::class, $block );
                $this->assertSame( 'wgSoftBlockRanges', $block->getSystemBlockType() );
 
                // Make sure the block is really soft
-               $request->getSession()->setUser( $this->getTestUser()->getUser() );
-               $wgUser = User::newFromSession( $request );
+               $wgUser = $this->getTestUser()->getUser();
+               $request = new FauxRequest();
+               $request->setIP( '10.20.30.40' );
+               $setSessionUser( $wgUser, $request );
                $this->assertFalse( $wgUser->isAnon(), 'sanity check' );
                $this->assertNull( $wgUser->getBlock() );
        }
index 6a383a2..20dbedb 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 use MediaWiki\MediaWikiServices;
+use Wikimedia\TestingAccessWrapper;
 
 /**
  * @author Addshore
@@ -199,19 +200,28 @@ class WatchedItemStoreIntegrationTest extends MediaWikiTestCase {
 
                // setNotificationTimestampsForUser specifying a title
                $this->assertTrue(
-                       $store->setNotificationTimestampsForUser( $user, '20200202020202', [ $title ] )
+                       $store->setNotificationTimestampsForUser( $user, '20100202020202', [ $title ] )
                );
                $this->assertEquals(
-                       '20200202020202',
+                       '20100202020202',
                        $store->getWatchedItem( $user, $title )->getNotificationTimestamp()
                );
 
                // setNotificationTimestampsForUser not specifying a title
+               // This will try to use a DeferredUpdate; disable that
+               $mockCallback = function ( $callback ) {
+                       $callback();
+               };
+               $scopedOverride = $store->overrideDeferredUpdatesAddCallableUpdateCallback( $mockCallback );
                $this->assertTrue(
-                       $store->setNotificationTimestampsForUser( $user, '20210202020202' )
+                       $store->setNotificationTimestampsForUser( $user, '20110202020202' )
                );
+               // Because the operation above is normally deferred, it doesn't clear the cache
+               // Clear the cache manually
+               $wrappedStore = TestingAccessWrapper::newFromObject( $store );
+               $wrappedStore->uncacheUser( $user );
                $this->assertEquals(
-                       '20210202020202',
+                       '20110202020202',
                        $store->getWatchedItem( $user, $title )->getNotificationTimestamp()
                );
        }
index 6249c49..a6b2162 100644 (file)
@@ -120,6 +120,9 @@ class WatchedItemStoreUnitTest extends MediaWikiTestCase {
                $mock->expects( $this->any() )
                        ->method( 'getId' )
                        ->will( $this->returnValue( $id ) );
+               $mock->expects( $this->any() )
+                       ->method( 'getUserPage' )
+                       ->will( $this->returnValue( Title::makeTitle( NS_USER, 'MockUser' ) ) );
                return $mock;
        }
 
@@ -2628,59 +2631,46 @@ class WatchedItemStoreUnitTest extends MediaWikiTestCase {
                $user = $this->getMockNonAnonUserWithId( 1 );
                $timestamp = '20100101010101';
 
-               $mockDb = $this->getMockDb();
-               $mockDb->expects( $this->once() )
-                       ->method( 'update' )
-                       ->with(
-                               'watchlist',
-                               [ 'wl_notificationtimestamp' => 'TS' . $timestamp . 'TS' ],
-                               [ 'wl_user' => 1 ]
-                       )
-                       ->will( $this->returnValue( true ) );
-               $mockDb->expects( $this->exactly( 1 ) )
-                       ->method( 'timestamp' )
-                       ->will( $this->returnCallback( function ( $value ) {
-                               return 'TS' . $value . 'TS';
-                       } ) );
-
                $store = $this->newWatchedItemStore(
-                       $this->getMockLBFactory( $mockDb ),
+                       $this->getMockLBFactory( $this->getMockDb() ),
                        $this->getMockJobQueueGroup(),
                        $this->getMockCache(),
                        $this->getMockReadOnlyMode()
                );
 
+               // Note: This does not actually assert the job is correct
+               $callableCallCounter = 0;
+               $mockCallback = function ( $callable ) use ( &$callableCallCounter ) {
+                       $callableCallCounter++;
+                       $this->assertInternalType( 'callable', $callable );
+               };
+               $scopedOverride = $store->overrideDeferredUpdatesAddCallableUpdateCallback( $mockCallback );
+
                $this->assertTrue(
                        $store->setNotificationTimestampsForUser( $user, $timestamp )
                );
+               $this->assertEquals( 1, $callableCallCounter );
        }
 
        public function testSetNotificationTimestampsForUser_nullTimestamp() {
                $user = $this->getMockNonAnonUserWithId( 1 );
                $timestamp = null;
 
-               $mockDb = $this->getMockDb();
-               $mockDb->expects( $this->once() )
-                       ->method( 'update' )
-                       ->with(
-                               'watchlist',
-                               [ 'wl_notificationtimestamp' => null ],
-                               [ 'wl_user' => 1 ]
-                       )
-                       ->will( $this->returnValue( true ) );
-               $mockDb->expects( $this->exactly( 0 ) )
-                       ->method( 'timestamp' )
-                       ->will( $this->returnCallback( function ( $value ) {
-                               return 'TS' . $value . 'TS';
-                       } ) );
-
                $store = $this->newWatchedItemStore(
-                       $this->getMockLBFactory( $mockDb ),
+                       $this->getMockLBFactory( $this->getMockDb() ),
                        $this->getMockJobQueueGroup(),
                        $this->getMockCache(),
                        $this->getMockReadOnlyMode()
                );
 
+               // Note: This does not actually assert the job is correct
+               $callableCallCounter = 0;
+               $mockCallback = function ( $callable ) use ( &$callableCallCounter ) {
+                       $callableCallCounter++;
+                       $this->assertInternalType( 'callable', $callable );
+               };
+               $scopedOverride = $store->overrideDeferredUpdatesAddCallableUpdateCallback( $mockCallback );
+
                $this->assertTrue(
                        $store->setNotificationTimestampsForUser( $user, $timestamp )
                );
@@ -2697,7 +2687,7 @@ class WatchedItemStoreUnitTest extends MediaWikiTestCase {
                        ->with(
                                'watchlist',
                                [ 'wl_notificationtimestamp' => 'TS' . $timestamp . 'TS' ],
-                               [ 'wl_user' => 1, 0 => 'makeWhereFrom2d return value' ]
+                               [ 'wl_user' => 1, 'wl_namespace' => 0, 'wl_title' => [ 'Foo', 'Bar' ] ]
                        )
                        ->will( $this->returnValue( true ) );
                $mockDb->expects( $this->exactly( 1 ) )
@@ -2706,13 +2696,8 @@ class WatchedItemStoreUnitTest extends MediaWikiTestCase {
                                return 'TS' . $value . 'TS';
                        } ) );
                $mockDb->expects( $this->once() )
-                       ->method( 'makeWhereFrom2d' )
-                       ->with(
-                               [ [ 'Foo' => 1, 'Bar' => 1 ] ],
-                               $this->isType( 'string' ),
-                               $this->isType( 'string' )
-                       )
-                       ->will( $this->returnValue( 'makeWhereFrom2d return value' ) );
+                       ->method( 'affectedRows' )
+                       ->will( $this->returnValue( 2 ) );
 
                $store = $this->newWatchedItemStore(
                        $this->getMockLBFactory( $mockDb ),
diff --git a/tests/phpunit/maintenance/DumpAsserter.php b/tests/phpunit/maintenance/DumpAsserter.php
new file mode 100644 (file)
index 0000000..5b4c6ef
--- /dev/null
@@ -0,0 +1,347 @@
+<?php
+
+namespace MediaWiki\Tests\Maintenance;
+
+use PHPUnit\Framework\Assert;
+use XMLReader;
+
+/**
+ * Helper for asserting the structure of an XML dump stream.
+ */
+class DumpAsserter {
+
+       /**
+        * Holds the XMLReader used for analyzing an XML dump
+        *
+        * @var XMLReader|null
+        */
+       protected $xml = null;
+
+       /**
+        * XML dump schema version
+        *
+        * @var string
+        */
+       protected $schemaVersion;
+
+       /**
+        * DumpAsserts constructor.
+        *
+        * @param string $schemaVersion see XML_DUMP_SCHEMA_VERSION_XX
+        */
+       public function __construct( $schemaVersion ) {
+               $this->schemaVersion = $schemaVersion;
+       }
+
+       /**
+        * Step the current XML reader until node end of given name is found.
+        *
+        * @param string $name Name of the closing element to look for
+        *   (e.g.: "mediawiki" when looking for </mediawiki>)
+        *
+        * @return bool True if the end node could be found. false otherwise.
+        */
+       public function skipToNodeEnd( $name ) {
+               while ( $this->xml->read() ) {
+                       if ( $this->xml->nodeType == XMLReader::END_ELEMENT &&
+                               $this->xml->name == $name
+                       ) {
+                               return true;
+                       }
+               }
+
+               return false;
+       }
+
+       /**
+        * Step the current XML reader to the first element start after the node
+        * end of a given name.
+        *
+        * @param string $name Name of the closing element to look for
+        *   (e.g.: "mediawiki" when looking for </mediawiki>)
+        *
+        * @return bool True if new element after the closing of $name could be
+        *   found. false otherwise.
+        */
+       public function skipPastNodeEnd( $name ) {
+               Assert::assertTrue( $this->skipToNodeEnd( $name ),
+                       "Skipping to end of $name" );
+               while ( $this->xml->read() ) {
+                       if ( $this->xml->nodeType == XMLReader::ELEMENT ) {
+                               return true;
+                       }
+               }
+
+               return false;
+       }
+
+       /**
+        * Opens an XML file to analyze and optionally skips past siteinfo.
+        *
+        * @param string $fname Name of file to analyze
+        * @param bool $skip_siteinfo (optional) If true, step the xml reader
+        *   to the first element after </siteinfo>
+        */
+       public function assertDumpStart( $fname, $skip_siteinfo = true ) {
+               $this->xml = new XMLReader();
+
+               Assert::assertTrue( $this->xml->open( $fname ),
+                       "Opening temporary file $fname via XMLReader failed" );
+               if ( $skip_siteinfo ) {
+                       Assert::assertTrue( $this->skipPastNodeEnd( "siteinfo" ),
+                               "Skipping past end of siteinfo" );
+               }
+       }
+
+       /**
+        * Asserts that the xml reader is at the final closing tag of an xml file and
+        * closes the reader.
+        *
+        * @param string $name (optional) the name of the final tag
+        *   (e.g.: "mediawiki" for </mediawiki>)
+        */
+       public function assertDumpEnd( $name = "mediawiki" ) {
+               $this->assertNodeEnd( $name, false );
+               if ( $this->xml->read() ) {
+                       $this->skipWhitespace();
+               }
+               Assert::assertEquals( $this->xml->nodeType, XMLReader::NONE,
+                       "No proper entity left to parse" );
+               $this->xml->close();
+       }
+
+       /**
+        * Steps the xml reader over white space
+        */
+       public function skipWhitespace() {
+               $cont = true;
+               while ( $cont && ( ( $this->xml->nodeType == XMLReader::WHITESPACE )
+                       || ( $this->xml->nodeType == XMLReader::SIGNIFICANT_WHITESPACE ) ) ) {
+                       $cont = $this->xml->read();
+               }
+       }
+
+       /**
+        * Asserts that the xml reader is at an element of given name, and optionally
+        * skips past it.
+        *
+        * @param string $name The name of the element to check for
+        *   (e.g.: "mediawiki" for <mediawiki>)
+        * @param bool $skip (optional) if true, skip past the found element
+        */
+       public function assertNodeStart( $name, $skip = true ) {
+               Assert::assertEquals( $name, $this->xml->name, "Node name" );
+               Assert::assertEquals( XMLReader::ELEMENT, $this->xml->nodeType, "Node type" );
+               if ( $skip ) {
+                       Assert::assertTrue( $this->xml->read(), "Skipping past start tag" );
+               }
+       }
+
+       /**
+        * Asserts that the xml reader is at an closing element of given name, and optionally
+        * skips past it.
+        *
+        * @param string $name The name of the closing element to check for
+        *   (e.g.: "mediawiki" for </mediawiki>)
+        * @param bool $skip (optional) if true, skip past the found element
+        */
+       public function assertNodeEnd( $name, $skip = true ) {
+               Assert::assertEquals( $name, $this->xml->name, "Node name" );
+               Assert::assertEquals( XMLReader::END_ELEMENT, $this->xml->nodeType, "Node type" );
+               if ( $skip ) {
+                       Assert::assertTrue( $this->xml->read(), "Skipping past end tag" );
+               }
+       }
+
+       /**
+        * Asserts that the xml reader is at an element of given tag that contains a given text,
+        * and skips over the element.
+        *
+        * @param string $name The name of the element to check for
+        *   (e.g.: "mediawiki" for <mediawiki>...</mediawiki>)
+        * @param string|bool $text If string, check if it equals the elements text.
+        *   If false, ignore the element's text
+        * @param bool $skip_ws (optional) if true, skip past white spaces that trail the
+        *   closing element.
+        */
+       public function assertTextNode( $name, $text, $skip_ws = true ) {
+               $this->assertNodeStart( $name );
+
+               if ( $text !== false ) {
+                       Assert::assertEquals( $text, $this->xml->value, "Text of node " . $name );
+               }
+               Assert::assertTrue( $this->xml->read(), "Skipping past processed text of " . $name );
+               $this->assertNodeEnd( $name );
+
+               if ( $skip_ws ) {
+                       $this->skipWhitespace();
+               }
+       }
+
+       /**
+        * Asserts that the xml reader is at the start of a page element and skips over the first
+        * tags, after checking them.
+        *
+        * Besides the opening page element, this function also checks for and skips over the
+        * title, ns, and id tags. Hence after this function, the xml reader is at the first
+        * revision of the current page.
+        *
+        * @param int $id Id of the page to assert
+        * @param int $ns Number of namespage to assert
+        * @param string $name Title of the current page
+        */
+       public function assertPageStart( $id, $ns, $name ) {
+               $this->assertNodeStart( "page" );
+               $this->skipWhitespace();
+
+               $this->assertTextNode( "title", $name );
+               $this->assertTextNode( "ns", $ns );
+               $this->assertTextNode( "id", $id );
+       }
+
+       /**
+        * Asserts that the xml reader is at the page's closing element and skips to the next
+        * element.
+        */
+       public function assertPageEnd() {
+               $this->assertNodeEnd( "page" );
+               $this->skipWhitespace();
+       }
+
+       /**
+        * Asserts that the xml reader is at a revision and checks its representation before
+        * skipping over it.
+        *
+        * @param int $id Id of the revision
+        * @param string $summary Summary of the revision
+        * @param int $text_id Id of the revision's text
+        * @param int $text_bytes Number of bytes in the revision's text
+        * @param string $text_sha1 The base36 SHA-1 of the revision's text
+        * @param string|bool $text (optional) The revision's string, or false to check for a
+        *            revision stub
+        * @param int|bool $parentid (optional) id of the parent revision
+        * @param string $model The expected content model id (default: CONTENT_MODEL_WIKITEXT)
+        * @param string $format The expected format model id (default: CONTENT_FORMAT_WIKITEXT)
+        */
+       public function assertRevision( $id, $summary, $text_id, $text_bytes,
+               $text_sha1, $text = false, $parentid = false,
+               $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT
+       ) {
+               $this->assertNodeStart( "revision" );
+               $this->skipWhitespace();
+
+               $this->assertTextNode( "id", $id );
+               if ( $parentid !== false ) {
+                       $this->assertTextNode( "parentid", $parentid );
+               }
+               $this->assertTextNode( "timestamp", false );
+
+               $this->assertNodeStart( "contributor" );
+               $this->skipWhitespace();
+               $this->assertTextNode( "ip", false );
+               $this->assertNodeEnd( "contributor" );
+               $this->skipWhitespace();
+
+               $this->assertTextNode( "comment", $summary );
+               $this->skipWhitespace();
+
+               $this->assertTextNode( "model", $model );
+               $this->skipWhitespace();
+
+               $this->assertTextNode( "format", $format );
+               $this->skipWhitespace();
+
+               if ( $this->xml->name == "text" ) {
+                       // note: <text> tag may occur here or at the very end.
+                       $text_found = true;
+                       $this->assertText( $id, $text_id, $text_bytes, $text );
+               } else {
+                       $text_found = false;
+               }
+
+               $this->assertTextNode( "sha1", $text_sha1 );
+
+               if ( !$text_found ) {
+                       $this->assertText( $id, $text_id, $text_bytes, $text );
+               }
+
+               $this->assertNodeEnd( "revision" );
+               $this->skipWhitespace();
+       }
+
+       public function assertText( $id, $text_id, $text_bytes, $text ) {
+               $this->assertNodeStart( "text", false );
+               if ( $text_bytes !== false ) {
+                       Assert::assertEquals( $this->xml->getAttribute( "bytes" ), $text_bytes,
+                               "Attribute 'bytes' of revision " . $id );
+               }
+
+               if ( $text === false ) {
+                       // Testing for a stub
+                       Assert::assertEquals( $this->xml->getAttribute( "id" ), $text_id,
+                               "Text id of revision " . $id );
+                       Assert::assertFalse( $this->xml->hasValue, "Revision has text" );
+                       Assert::assertTrue( $this->xml->read(), "Skipping text start tag" );
+                       if ( ( $this->xml->nodeType == XMLReader::END_ELEMENT )
+                               && ( $this->xml->name == "text" )
+                       ) {
+                               $this->xml->read();
+                       }
+                       $this->skipWhitespace();
+               } else {
+                       // Testing for a real dump
+                       Assert::assertTrue( $this->xml->read(), "Skipping text start tag" );
+                       Assert::assertEquals( $text, $this->xml->value, "Text of revision " . $id );
+                       Assert::assertTrue( $this->xml->read(), "Skipping past text" );
+                       $this->assertNodeEnd( "text" );
+                       $this->skipWhitespace();
+               }
+       }
+
+       /**
+        * asserts that the xml reader is at the beginning of a log entry and skips over
+        * it while analyzing it.
+        *
+        * @param int $id Id of the log entry
+        * @param string $user_name User name of the log entry's performer
+        * @param int $user_id User id of the log entry 's performer
+        * @param string|null $comment Comment of the log entry. If null, the comment text is ignored.
+        * @param string $type Type of the log entry
+        * @param string $subtype Subtype of the log entry
+        * @param string $title Title of the log entry's target
+        * @param array $parameters (optional) unserialized data accompanying the log entry
+        */
+       public function assertLogItem( $id, $user_name, $user_id, $comment, $type,
+               $subtype, $title, $parameters = []
+       ) {
+               $this->assertNodeStart( "logitem" );
+               $this->skipWhitespace();
+
+               $this->assertTextNode( "id", $id );
+               $this->assertTextNode( "timestamp", false );
+
+               $this->assertNodeStart( "contributor" );
+               $this->skipWhitespace();
+               $this->assertTextNode( "username", $user_name );
+               $this->assertTextNode( "id", $user_id );
+               $this->assertNodeEnd( "contributor" );
+               $this->skipWhitespace();
+
+               if ( $comment !== null ) {
+                       $this->assertTextNode( "comment", $comment );
+               }
+               $this->assertTextNode( "type", $type );
+               $this->assertTextNode( "action", $subtype );
+               $this->assertTextNode( "logtitle", $title );
+
+               $this->assertNodeStart( "params" );
+               $parameters_xml = unserialize( $this->xml->value );
+               Assert::assertEquals( $parameters, $parameters_xml );
+               Assert::assertTrue( $this->xml->read(), "Skipping past processed text of params" );
+               $this->assertNodeEnd( "params" );
+               $this->skipWhitespace();
+
+               $this->assertNodeEnd( "logitem" );
+               $this->skipWhitespace();
+       }
+}
index 4b7a7eb..eebc201 100644 (file)
@@ -3,11 +3,12 @@
 namespace MediaWiki\Tests\Maintenance;
 
 use ContentHandler;
+use DOMDocument;
 use ExecutableFinder;
 use MediaWikiLangTestCase;
-use Page;
 use User;
-use XMLReader;
+use WikiExporter;
+use WikiPage;
 use MWException;
 
 /**
@@ -28,13 +29,6 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         */
        protected $exceptionFromAddDBData = null;
 
-       /**
-        * Holds the XMLReader used for analyzing an XML dump
-        *
-        * @var XMLReader|null
-        */
-       protected $xml = null;
-
        /** @var bool|null Whether the 'gzip' utility is available */
        protected static $hasGzip = null;
 
@@ -58,7 +52,7 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
        /**
         * Adds a revision to a page, while returning the resuting revision's id
         *
-        * @param Page $page Page to add the revision to
+        * @param WikiPage $page Page to add the revision to
         * @param string $text Revisions text
         * @param string $summary Revisions summary
         * @param string $model The model ID (defaults to wikitext)
@@ -66,7 +60,12 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * @throws MWException
         * @return array
         */
-       protected function addRevision( Page $page, $text, $summary, $model = CONTENT_MODEL_WIKITEXT ) {
+       protected function addRevision(
+               WikiPage $page,
+               $text,
+               $summary,
+               $model = CONTENT_MODEL_WIKITEXT
+       ) {
                $status = $page->doEditContent(
                        ContentHandler::makeContent( $text, $page->getTitle(), $model ),
                        $summary
@@ -108,6 +107,36 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                );
        }
 
+       public static function setUpBeforeClass() {
+               parent::setUpBeforeClass();
+
+               if ( !function_exists( 'libxml_set_external_entity_loader' ) ) {
+                       return;
+               }
+
+               // The W3C is intentionally slow about returning schema files,
+               // see <https://www.w3.org/Help/Webmaster#slowdtd>.
+               // To work around that, we keep our own copies of the relevant schema files.
+               libxml_set_external_entity_loader(
+                       function ( $public, $system, $context ) {
+                               switch ( $system ) {
+                                       // if more schema files are needed, add them here.
+                                       case 'http://www.w3.org/2001/xml.xsd':
+                                               $file = __DIR__ . '/xml.xsd';
+                                               break;
+                                       default:
+                                               if ( is_file( $system ) ) {
+                                                       $file = $system;
+                                               } else {
+                                                       return null;
+                                               }
+                               }
+
+                               return $file;
+                       }
+               );
+       }
+
        /**
         * Default set up function.
         *
@@ -125,6 +154,21 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                $this->setMwGlobals( 'wgUser', new User() );
        }
 
+       /**
+        * Returns the path to the XML schema file for the given schema version.
+        *
+        * @param string|null $schemaVersion
+        *
+        * @return string
+        */
+       protected function getXmlSchemaPath( $schemaVersion = null ) {
+               global $IP;
+
+               $schemaVersion = $schemaVersion ?: '0.10';
+
+               return "$IP/docs/export-$schemaVersion.xsd";
+       }
+
        /**
         * Checks for test output consisting only of lines containing ETA announcements
         */
@@ -152,266 +196,62 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
        }
 
        /**
-        * Step the current XML reader until node end of given name is found.
-        *
-        * @param string $name Name of the closing element to look for
-        *   (e.g.: "mediawiki" when looking for </mediawiki>)
+        * @param null|string $schemaVersion
         *
-        * @return bool True if the end node could be found. false otherwise.
+        * @return DumpAsserter
         */
-       protected function skipToNodeEnd( $name ) {
-               while ( $this->xml->read() ) {
-                       if ( $this->xml->nodeType == XMLReader::END_ELEMENT &&
-                               $this->xml->name == $name
-                       ) {
-                               return true;
-                       }
-               }
-
-               return false;
+       protected function getDumpAsserter( $schemaVersion = null ) {
+               $schemaVersion = $schemaVersion ?: WikiExporter::schemaVersion();
+               return new DumpAsserter( $schemaVersion );
        }
 
        /**
-        * Step the current XML reader to the first element start after the node
-        * end of a given name.
-        *
-        * @param string $name Name of the closing element to look for
-        *   (e.g.: "mediawiki" when looking for </mediawiki>)
-        *
-        * @return bool True if new element after the closing of $name could be
-        *   found. false otherwise.
+        * Checks an XML file against an XSD schema.
         */
-       protected function skipPastNodeEnd( $name ) {
-               $this->assertTrue( $this->skipToNodeEnd( $name ),
-                       "Skipping to end of $name" );
-               while ( $this->xml->read() ) {
-                       if ( $this->xml->nodeType == XMLReader::ELEMENT ) {
-                               return true;
-                       }
+       protected function assertDumpSchema( $fname, $schemaFile ) {
+               if ( !function_exists( 'libxml_use_internal_errors' ) ) {
+                       // Would be nice to leave a warning somehow.
+                       // We don't want to skip all of the test case that calls this, though.
+                       $this->markAsRisky();
+                       return;
                }
-
-               return false;
-       }
-
-       /**
-        * Opens an XML file to analyze and optionally skips past siteinfo.
-        *
-        * @param string $fname Name of file to analyze
-        * @param bool $skip_siteinfo (optional) If true, step the xml reader
-        *   to the first element after </siteinfo>
-        */
-       protected function assertDumpStart( $fname, $skip_siteinfo = true ) {
-               $this->xml = new XMLReader();
-               $this->assertTrue( $this->xml->open( $fname ),
-                       "Opening temporary file $fname via XMLReader failed" );
-               if ( $skip_siteinfo ) {
-                       $this->assertTrue( $this->skipPastNodeEnd( "siteinfo" ),
-                               "Skipping past end of siteinfo" );
+               if ( defined( 'HHVM_VERSION' ) ) {
+                       // In HHVM, loading a schema from a file is disabled per default.
+                       // This is controlled by hhvm.libxml.ext_entity_whitelist which
+                       // cannot be read with ini_get(), see
+                       // <https://docs.hhvm.com/hhvm/configuration/INI-settings#xml>.
+                       // Would be nice to leave a warning somehow.
+                       // We don't want to skip all of the test case that calls this, though.
+                       $this->markAsRisky();
+                       return;
                }
-       }
 
-       /**
-        * Asserts that the xml reader is at the final closing tag of an xml file and
-        * closes the reader.
-        *
-        * @param string $name (optional) the name of the final tag
-        *   (e.g.: "mediawiki" for </mediawiki>)
-        */
-       protected function assertDumpEnd( $name = "mediawiki" ) {
-               $this->assertNodeEnd( $name, false );
-               if ( $this->xml->read() ) {
-                       $this->skipWhitespace();
-               }
-               $this->assertEquals( $this->xml->nodeType, XMLReader::NONE,
-                       "No proper entity left to parse" );
-               $this->xml->close();
-       }
+               $xml = new DOMDocument();
+               $this->assertTrue( $xml->load( $fname ),
+                       "Opening temporary file $fname via DOMDocument failed" );
 
-       /**
-        * Steps the xml reader over white space
-        */
-       protected function skipWhitespace() {
-               $cont = true;
-               while ( $cont && ( ( $this->xml->nodeType == XMLReader::WHITESPACE )
-                       || ( $this->xml->nodeType == XMLReader::SIGNIFICANT_WHITESPACE ) ) ) {
-                       $cont = $this->xml->read();
-               }
-       }
+               // Don't throw
+               $oldLibXmlInternalErrors = libxml_use_internal_errors( true );
 
-       /**
-        * Asserts that the xml reader is at an element of given name, and optionally
-        * skips past it.
-        *
-        * @param string $name The name of the element to check for
-        *   (e.g.: "mediawiki" for <mediawiki>)
-        * @param bool $skip (optional) if true, skip past the found element
-        */
-       protected function assertNodeStart( $name, $skip = true ) {
-               $this->assertEquals( $name, $this->xml->name, "Node name" );
-               $this->assertEquals( XMLReader::ELEMENT, $this->xml->nodeType, "Node type" );
-               if ( $skip ) {
-                       $this->assertTrue( $this->xml->read(), "Skipping past start tag" );
-               }
-       }
-
-       /**
-        * Asserts that the xml reader is at an closing element of given name, and optionally
-        * skips past it.
-        *
-        * @param string $name The name of the closing element to check for
-        *   (e.g.: "mediawiki" for </mediawiki>)
-        * @param bool $skip (optional) if true, skip past the found element
-        */
-       protected function assertNodeEnd( $name, $skip = true ) {
-               $this->assertEquals( $name, $this->xml->name, "Node name" );
-               $this->assertEquals( XMLReader::END_ELEMENT, $this->xml->nodeType, "Node type" );
-               if ( $skip ) {
-                       $this->assertTrue( $this->xml->read(), "Skipping past end tag" );
-               }
-       }
-
-       /**
-        * Asserts that the xml reader is at an element of given tag that contains a given text,
-        * and skips over the element.
-        *
-        * @param string $name The name of the element to check for
-        *   (e.g.: "mediawiki" for <mediawiki>...</mediawiki>)
-        * @param string|bool $text If string, check if it equals the elements text.
-        *   If false, ignore the element's text
-        * @param bool $skip_ws (optional) if true, skip past white spaces that trail the
-        *   closing element.
-        */
-       protected function assertTextNode( $name, $text, $skip_ws = true ) {
-               $this->assertNodeStart( $name );
-
-               if ( $text !== false ) {
-                       $this->assertEquals( $text, $this->xml->value, "Text of node " . $name );
-               }
-               $this->assertTrue( $this->xml->read(), "Skipping past processed text of " . $name );
-               $this->assertNodeEnd( $name );
-
-               if ( $skip_ws ) {
-                       $this->skipWhitespace();
-               }
-       }
-
-       /**
-        * Asserts that the xml reader is at the start of a page element and skips over the first
-        * tags, after checking them.
-        *
-        * Besides the opening page element, this function also checks for and skips over the
-        * title, ns, and id tags. Hence after this function, the xml reader is at the first
-        * revision of the current page.
-        *
-        * @param int $id Id of the page to assert
-        * @param int $ns Number of namespage to assert
-        * @param string $name Title of the current page
-        */
-       protected function assertPageStart( $id, $ns, $name ) {
-               $this->assertNodeStart( "page" );
-               $this->skipWhitespace();
-
-               $this->assertTextNode( "title", $name );
-               $this->assertTextNode( "ns", $ns );
-               $this->assertTextNode( "id", $id );
-       }
+               // NOTE: if this reports "Invalid Schema", the schema may be referencing an external
+               // entity (typically, another schema) that needs to be mapped in the
+               // libxml_set_external_entity_loader callback defined in setUpBeforeClass() above!
+               // Or $schemaFile doesn't point to a schema file, or the schema is indeed just broken.
+               if ( !$xml->schemaValidate( $schemaFile ) ) {
+                       $errorText = '';
 
-       /**
-        * Asserts that the xml reader is at the page's closing element and skips to the next
-        * element.
-        */
-       protected function assertPageEnd() {
-               $this->assertNodeEnd( "page" );
-               $this->skipWhitespace();
-       }
-
-       /**
-        * Asserts that the xml reader is at a revision and checks its representation before
-        * skipping over it.
-        *
-        * @param int $id Id of the revision
-        * @param string $summary Summary of the revision
-        * @param int $text_id Id of the revision's text
-        * @param int $text_bytes Number of bytes in the revision's text
-        * @param string $text_sha1 The base36 SHA-1 of the revision's text
-        * @param string|bool $text (optional) The revision's string, or false to check for a
-        *            revision stub
-        * @param int|bool $parentid (optional) id of the parent revision
-        * @param string $model The expected content model id (default: CONTENT_MODEL_WIKITEXT)
-        * @param string $format The expected format model id (default: CONTENT_FORMAT_WIKITEXT)
-        */
-       protected function assertRevision( $id, $summary, $text_id, $text_bytes,
-               $text_sha1, $text = false, $parentid = false,
-               $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT
-       ) {
-               $this->assertNodeStart( "revision" );
-               $this->skipWhitespace();
-
-               $this->assertTextNode( "id", $id );
-               if ( $parentid !== false ) {
-                       $this->assertTextNode( "parentid", $parentid );
-               }
-               $this->assertTextNode( "timestamp", false );
-
-               $this->assertNodeStart( "contributor" );
-               $this->skipWhitespace();
-               $this->assertTextNode( "ip", false );
-               $this->assertNodeEnd( "contributor" );
-               $this->skipWhitespace();
-
-               $this->assertTextNode( "comment", $summary );
-               $this->skipWhitespace();
-
-               $this->assertTextNode( "model", $model );
-               $this->skipWhitespace();
-
-               $this->assertTextNode( "format", $format );
-               $this->skipWhitespace();
-
-               if ( $this->xml->name == "text" ) {
-                       // note: <text> tag may occur here or at the very end.
-                       $text_found = true;
-                       $this->assertText( $id, $text_id, $text_bytes, $text );
-               } else {
-                       $text_found = false;
-               }
+                       foreach ( libxml_get_errors() as $error ) {
+                               $errorText .= "\nline {$error->line}: {$error->message}";
+                       }
 
-               $this->assertTextNode( "sha1", $text_sha1 );
+                       libxml_clear_errors();
 
-               if ( !$text_found ) {
-                       $this->assertText( $id, $text_id, $text_bytes, $text );
+                       $this->fail(
+                               "Failed asserting that $fname conforms to the schema in $schemaFile:\n$errorText"
+                       );
                }
 
-               $this->assertNodeEnd( "revision" );
-               $this->skipWhitespace();
+               libxml_use_internal_errors( $oldLibXmlInternalErrors );
        }
 
-       protected function assertText( $id, $text_id, $text_bytes, $text ) {
-               $this->assertNodeStart( "text", false );
-               if ( $text_bytes !== false ) {
-                       $this->assertEquals( $this->xml->getAttribute( "bytes" ), $text_bytes,
-                               "Attribute 'bytes' of revision " . $id );
-               }
-
-               if ( $text === false ) {
-                       // Testing for a stub
-                       $this->assertEquals( $this->xml->getAttribute( "id" ), $text_id,
-                               "Text id of revision " . $id );
-                       $this->assertFalse( $this->xml->hasValue, "Revision has text" );
-                       $this->assertTrue( $this->xml->read(), "Skipping text start tag" );
-                       if ( ( $this->xml->nodeType == XMLReader::END_ELEMENT )
-                               && ( $this->xml->name == "text" )
-                       ) {
-                               $this->xml->read();
-                       }
-                       $this->skipWhitespace();
-               } else {
-                       // Testing for a real dump
-                       $this->assertTrue( $this->xml->read(), "Skipping text start tag" );
-                       $this->assertEquals( $text, $this->xml->value, "Text of revision " . $id );
-                       $this->assertTrue( $this->xml->read(), "Skipping past text" );
-                       $this->assertNodeEnd( "text" );
-                       $this->skipWhitespace();
-               }
-       }
 }
index 38a513e..0d4bc56 100644 (file)
@@ -130,45 +130,46 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT );
 
                // Checking for correctness of the dumped data
-               $this->assertDumpStart( $nameFull );
+               $asserter = $this->getDumpAsserter();
+               $asserter->assertDumpStart( $nameFull );
 
                // Page 1
-               $this->assertPageStart( $this->pageId1, NS_MAIN, "BackupDumperTestP1" );
-               $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
+               $asserter->assertPageStart( $this->pageId1, NS_MAIN, "BackupDumperTestP1" );
+               $asserter->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
                        $this->textId1_1, false, "0bolhl6ol7i6x0e7yq91gxgaan39j87",
                        "BackupDumperTestP1Text1" );
-               $this->assertPageEnd();
+               $asserter->assertPageEnd();
 
                // Page 2
-               $this->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" );
-               $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1",
+               $asserter->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" );
+               $asserter->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1",
                        $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2",
                        "BackupDumperTestP2Text1" );
-               $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2",
+               $asserter->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2",
                        $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95",
                        "BackupDumperTestP2Text2", $this->revId2_1 );
-               $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3",
+               $asserter->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3",
                        $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r",
                        "BackupDumperTestP2Text3", $this->revId2_2 );
-               $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
+               $asserter->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
                        $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv",
                        "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 );
-               $this->assertPageEnd();
+               $asserter->assertPageEnd();
 
                // Page 3
                // -> Page is marked deleted. Hence not visible
 
                // Page 4
-               $this->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" );
-               $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
+               $asserter->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" );
+               $asserter->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
                        $this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe",
                        "TALK ABOUT BACKUPDUMPERTESTP1 TEXT1",
                        false,
                        "BackupTextPassTestModel",
                        "text/plain" );
-               $this->assertPageEnd();
+               $asserter->assertPageEnd();
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
        }
 
        function testPrefetchPlain() {
@@ -202,49 +203,50 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT );
 
                // Checking for correctness of the dumped data
-               $this->assertDumpStart( $nameFull );
+               $asserter = $this->getDumpAsserter();
+               $asserter->assertDumpStart( $nameFull );
 
                // Page 1
-               $this->assertPageStart( $this->pageId1, NS_MAIN, "BackupDumperTestP1" );
+               $asserter->assertPageStart( $this->pageId1, NS_MAIN, "BackupDumperTestP1" );
                // Prefetch kicks in. This is still the SHA-1 of the original text,
                // But the actual text (with different SHA-1) comes from prefetch.
-               $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
+               $asserter->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
                        $this->textId1_1, false, "0bolhl6ol7i6x0e7yq91gxgaan39j87",
                        "Prefetch_________1Text1" );
-               $this->assertPageEnd();
+               $asserter->assertPageEnd();
 
                // Page 2
-               $this->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" );
-               $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1",
+               $asserter->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" );
+               $asserter->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1",
                        $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2",
                        "BackupDumperTestP2Text1" );
-               $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2",
+               $asserter->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2",
                        $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95",
                        "BackupDumperTestP2Text2", $this->revId2_1 );
                // Prefetch kicks in. This is still the SHA-1 of the original text,
                // But the actual text (with different SHA-1) comes from prefetch.
-               $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3",
+               $asserter->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3",
                        $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r",
                        "Prefetch_________2Text3", $this->revId2_2 );
-               $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
+               $asserter->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
                        $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv",
                        "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 );
-               $this->assertPageEnd();
+               $asserter->assertPageEnd();
 
                // Page 3
                // -> Page is marked deleted. Hence not visible
 
                // Page 4
-               $this->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" );
-               $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
+               $asserter->assertPageStart( $this->pageId4, NS_TALK, "Talk:BackupDumperTestP1" );
+               $asserter->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
                        $this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe",
                        "TALK ABOUT BACKUPDUMPERTESTP1 TEXT1",
                        false,
                        "BackupTextPassTestModel",
                        "text/plain" );
-               $this->assertPageEnd();
+               $asserter->assertPageEnd();
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
        }
 
        /**
@@ -329,6 +331,8 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                $lookingForPage = 1;
                $checkpointFiles = 0;
 
+               $asserter = $this->getDumpAsserter();
+
                // Each run of the following loop body tries to handle exactly 1 /page/ (not
                // iteration of stub content). $i is only increased after having treated page 4.
                for ( $i = 0; $i < $iterations; ) {
@@ -346,7 +350,7 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                                if ( $checkpointFormat == "gzip" ) {
                                        $this->gunzip( $nameOutputDir . "/" . $fname );
                                }
-                               $this->assertDumpStart( $nameOutputDir . "/" . $fname );
+                               $asserter->assertDumpStart( $nameOutputDir . "/" . $fname );
                                $fileOpened = true;
                                $checkpointFiles++;
                        }
@@ -355,51 +359,90 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                        switch ( $lookingForPage ) {
                                case 1:
                                        // Page 1
-                                       $this->assertPageStart( $this->pageId1 + $i * self::$numOfPages, NS_MAIN,
-                                               "BackupDumperTestP1" );
-                                       $this->assertRevision( $this->revId1_1 + $i * self::$numOfRevs, "BackupDumperTestP1Summary1",
-                                               $this->textId1_1, false, "0bolhl6ol7i6x0e7yq91gxgaan39j87",
-                                               "BackupDumperTestP1Text1" );
-                                       $this->assertPageEnd();
+                                       $asserter->assertPageStart(
+                                               $this->pageId1 + $i * self::$numOfPages,
+                                               NS_MAIN,
+                                               "BackupDumperTestP1"
+                                       );
+                                       $asserter->assertRevision(
+                                               $this->revId1_1 + $i * self::$numOfRevs,
+                                               "BackupDumperTestP1Summary1",
+                                               $this->textId1_1,
+                                               false,
+                                               "0bolhl6ol7i6x0e7yq91gxgaan39j87",
+                                               "BackupDumperTestP1Text1"
+                                       );
+                                       $asserter->assertPageEnd();
 
                                        $lookingForPage = 2;
                                        break;
 
                                case 2:
                                        // Page 2
-                                       $this->assertPageStart( $this->pageId2 + $i * self::$numOfPages, NS_MAIN,
-                                               "BackupDumperTestP2" );
-                                       $this->assertRevision( $this->revId2_1 + $i * self::$numOfRevs, "BackupDumperTestP2Summary1",
-                                               $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2",
-                                               "BackupDumperTestP2Text1" );
-                                       $this->assertRevision( $this->revId2_2 + $i * self::$numOfRevs, "BackupDumperTestP2Summary2",
-                                               $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95",
-                                               "BackupDumperTestP2Text2", $this->revId2_1 + $i * self::$numOfRevs );
-                                       $this->assertRevision( $this->revId2_3 + $i * self::$numOfRevs, "BackupDumperTestP2Summary3",
-                                               $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r",
-                                               "BackupDumperTestP2Text3", $this->revId2_2 + $i * self::$numOfRevs );
-                                       $this->assertRevision( $this->revId2_4 + $i * self::$numOfRevs,
+                                       $asserter->assertPageStart(
+                                               $this->pageId2 + $i * self::$numOfPages,
+                                               NS_MAIN,
+                                               "BackupDumperTestP2"
+                                       );
+                                       $asserter->assertRevision(
+                                               $this->revId2_1 + $i * self::$numOfRevs,
+                                               "BackupDumperTestP2Summary1",
+                                               $this->textId2_1,
+                                               false,
+                                               "jprywrymfhysqllua29tj3sc7z39dl2",
+                                               "BackupDumperTestP2Text1"
+                                       );
+                                       $asserter->assertRevision(
+                                               $this->revId2_2 + $i * self::$numOfRevs,
+                                               "BackupDumperTestP2Summary2",
+                                               $this->textId2_2,
+                                               false,
+                                               "b7vj5ks32po5m1z1t1br4o7scdwwy95",
+                                               "BackupDumperTestP2Text2",
+                                               $this->revId2_1 + $i * self::$numOfRevs
+                                       );
+                                       $asserter->assertRevision(
+                                               $this->revId2_3 + $i * self::$numOfRevs,
+                                               "BackupDumperTestP2Summary3",
+                                               $this->textId2_3,
+                                               false,
+                                               "jfunqmh1ssfb8rs43r19w98k28gg56r",
+                                               "BackupDumperTestP2Text3",
+                                               $this->revId2_2 + $i * self::$numOfRevs
+                                       );
+                                       $asserter->assertRevision(
+                                               $this->revId2_4 + $i * self::$numOfRevs,
                                                "BackupDumperTestP2Summary4 extra",
-                                               $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv",
+                                               $this->textId2_4,
+                                               false,
+                                               "6o1ciaxa6pybnqprmungwofc4lv00wv",
                                                "BackupDumperTestP2Text4 some additional Text",
-                                               $this->revId2_3 + $i * self::$numOfRevs );
-                                       $this->assertPageEnd();
+                                               $this->revId2_3 + $i * self::$numOfRevs
+                                       );
+                                       $asserter->assertPageEnd();
 
                                        $lookingForPage = 4;
                                        break;
 
                                case 4:
                                        // Page 4
-                                       $this->assertPageStart( $this->pageId4 + $i * self::$numOfPages, NS_TALK,
-                                               "Talk:BackupDumperTestP1" );
-                                       $this->assertRevision( $this->revId4_1 + $i * self::$numOfRevs,
+                                       $asserter->assertPageStart(
+                                               $this->pageId4 + $i * self::$numOfPages,
+                                               NS_TALK,
+                                               "Talk:BackupDumperTestP1"
+                                       );
+                                       $asserter->assertRevision(
+                                               $this->revId4_1 + $i * self::$numOfRevs,
                                                "Talk BackupDumperTestP1 Summary1",
-                                               $this->textId4_1, false, "nktofwzd0tl192k3zfepmlzxoax1lpe",
+                                               $this->textId4_1,
+                                               false,
+                                               "nktofwzd0tl192k3zfepmlzxoax1lpe",
                                                "TALK ABOUT BACKUPDUMPERTESTP1 TEXT1",
                                                false,
                                                "BackupTextPassTestModel",
-                                               "text/plain" );
-                                       $this->assertPageEnd();
+                                               "text/plain"
+                                       );
+                                       $asserter->assertPageEnd();
 
                                        $lookingForPage = 1;
 
@@ -415,7 +458,7 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                        if ( $this->xml->nodeType == XMLReader::END_ELEMENT
                                && $this->xml->name == "mediawiki"
                        ) {
-                               $this->assertDumpEnd();
+                               $asserter->assertDumpEnd();
                                $fileOpened = false;
                        }
                }
index 9357451..811f1ee 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace MediaWiki\Tests\Maintenance;
 
+use Exception;
 use MediaWiki\MediaWikiServices;
 use DumpBackup;
 use ManualLogEntry;
@@ -98,53 +99,6 @@ class BackupDumperLoggerTest extends DumpTestCase {
                }
        }
 
-       /**
-        * asserts that the xml reader is at the beginning of a log entry and skips over
-        * it while analyzing it.
-        *
-        * @param int $id Id of the log entry
-        * @param string $user_name User name of the log entry's performer
-        * @param int $user_id User id of the log entry 's performer
-        * @param string|null $comment Comment of the log entry. If null, the comment text is ignored.
-        * @param string $type Type of the log entry
-        * @param string $subtype Subtype of the log entry
-        * @param string $title Title of the log entry's target
-        * @param array $parameters (optional) unserialized data accompanying the log entry
-        */
-       private function assertLogItem( $id, $user_name, $user_id, $comment, $type,
-               $subtype, $title, $parameters = []
-       ) {
-               $this->assertNodeStart( "logitem" );
-               $this->skipWhitespace();
-
-               $this->assertTextNode( "id", $id );
-               $this->assertTextNode( "timestamp", false );
-
-               $this->assertNodeStart( "contributor" );
-               $this->skipWhitespace();
-               $this->assertTextNode( "username", $user_name );
-               $this->assertTextNode( "id", $user_id );
-               $this->assertNodeEnd( "contributor" );
-               $this->skipWhitespace();
-
-               if ( $comment !== null ) {
-                       $this->assertTextNode( "comment", $comment );
-               }
-               $this->assertTextNode( "type", $type );
-               $this->assertTextNode( "action", $subtype );
-               $this->assertTextNode( "logtitle", $title );
-
-               $this->assertNodeStart( "params" );
-               $parameters_xml = unserialize( $this->xml->value );
-               $this->assertEquals( $parameters, $parameters_xml );
-               $this->assertTrue( $this->xml->read(), "Skipping past processed text of params" );
-               $this->assertNodeEnd( "params" );
-               $this->skipWhitespace();
-
-               $this->assertNodeEnd( "logitem" );
-               $this->skipWhitespace();
-       }
-
        function testPlain() {
                // Preparing the dump
                $fname = $this->getNewTempFile();
@@ -159,9 +113,12 @@ class BackupDumperLoggerTest extends DumpTestCase {
                $dumper->dump( WikiExporter::LOGS, WikiExporter::TEXT );
 
                // Analyzing the dumped data
-               $this->assertDumpStart( $fname );
+               $this->assertDumpSchema( $fname, $this->getXmlSchemaPath() );
+
+               $asserter = $this->getDumpAsserter();
+               $asserter->assertDumpStart( $fname );
 
-               $this->assertLogItem( $this->logId1, "BackupDumperLogUserA",
+               $asserter->assertLogItem( $this->logId1, "BackupDumperLogUserA",
                        $this->userId1, null, "type", "subtype", "PageA" );
 
                $contLang = MediaWikiServices::getInstance()->getContentLanguage();
@@ -169,15 +126,15 @@ class BackupDumperLoggerTest extends DumpTestCase {
                $namespace = $contLang->getNsText( NS_TALK );
                $this->assertInternalType( 'string', $namespace );
                $this->assertGreaterThan( 0, strlen( $namespace ) );
-               $this->assertLogItem( $this->logId2, "BackupDumperLogUserB",
+               $asserter->assertLogItem( $this->logId2, "BackupDumperLogUserB",
                        $this->userId2, "SomeComment", "supress", "delete",
                        $namespace . ":PageB" );
 
-               $this->assertLogItem( $this->logId3, "BackupDumperLogUserB",
+               $asserter->assertLogItem( $this->logId3, "BackupDumperLogUserB",
                        $this->userId2, "SomeOtherComment", "move", "delete",
                        "PageA", [ 'key1' => 1, 3 => 'value3' ] );
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
        }
 
        function testXmlDumpsBackupUseCaseLogging() {
@@ -211,9 +168,12 @@ class BackupDumperLoggerTest extends DumpTestCase {
                // Analyzing the dumped data
                $this->gunzip( $fname );
 
-               $this->assertDumpStart( $fname );
+               $this->assertDumpSchema( $fname, $this->getXmlSchemaPath() );
+
+               $asserter = $this->getDumpAsserter();
+               $asserter->assertDumpStart( $fname );
 
-               $this->assertLogItem( $this->logId1, "BackupDumperLogUserA",
+               $asserter->assertLogItem( $this->logId1, "BackupDumperLogUserA",
                        $this->userId1, null, "type", "subtype", "PageA" );
 
                $contLang = MediaWikiServices::getInstance()->getContentLanguage();
@@ -221,15 +181,15 @@ class BackupDumperLoggerTest extends DumpTestCase {
                $namespace = $contLang->getNsText( NS_TALK );
                $this->assertInternalType( 'string', $namespace );
                $this->assertGreaterThan( 0, strlen( $namespace ) );
-               $this->assertLogItem( $this->logId2, "BackupDumperLogUserB",
+               $asserter->assertLogItem( $this->logId2, "BackupDumperLogUserB",
                        $this->userId2, "SomeComment", "supress", "delete",
                        $namespace . ":PageB" );
 
-               $this->assertLogItem( $this->logId3, "BackupDumperLogUserB",
+               $asserter->assertLogItem( $this->logId3, "BackupDumperLogUserB",
                        $this->userId2, "SomeOtherComment", "move", "delete",
                        "PageA", [ 'key1' => 1, 3 => 'value3' ] );
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
 
                // Currently, no reporting is implemented. Alert via failure, once
                // this changes.
index 000b50f..afe8c4b 100644 (file)
@@ -3,8 +3,14 @@
 namespace MediaWiki\Tests\Maintenance;
 
 use DumpBackup;
+use Exception;
+use MediaWiki\MediaWikiServices;
+use MediaWikiTestCase;
+use MWException;
 use Title;
 use WikiExporter;
+use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\LoadBalancer;
 use WikiPage;
 
 /**
@@ -27,6 +33,11 @@ class BackupDumperPageTest extends DumpTestCase {
        private $revId4_1, $textId4_1;
        private $namespace, $talk_namespace;
 
+       /**
+        * @var LoadBalancer|null
+        */
+       private $streamingLoadBalancer = null;
+
        function addDBData() {
                // be sure, titles created here using english namespace names
                $this->setContentLang( 'en' );
@@ -101,154 +112,357 @@ class BackupDumperPageTest extends DumpTestCase {
                        "Page ids increasing without holes" );
        }
 
-       function testFullTextPlain() {
+       function tearDown() {
+               parent::tearDown();
+
+               if ( isset( $this->streamingLoadBalancer ) ) {
+                       $this->streamingLoadBalancer->closeAll();
+               }
+       }
+
+       /**
+        * Returns a new database connection which is separate from the conenctions returned
+        * by the default LoadBalancer instance.
+        *
+        * @return IDatabase
+        */
+       private function newStreamingDBConnection() {
+               // Create a *new* LoadBalancer, so no connections are shared
+               if ( !$this->streamingLoadBalancer ) {
+                       $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+
+                       $this->streamingLoadBalancer = $lbFactory->newMainLB();
+               }
+
+               $db = $this->streamingLoadBalancer->getConnection( DB_REPLICA );
+
+               // Make sure the DB connection has the fake table clones and the fake table prefix
+               MediaWikiTestCase::setupDatabaseWithTestPrefix( $db );
+
+               // Make sure the DB connection has all the test data
+               $this->copyTestData( $this->db, $db );
+
+               return $db;
+       }
+
+       /**
+        * @param array $argv
+        * @param int $startId
+        * @param int $endId
+        *
+        * @return DumpBackup
+        */
+       private function newDumpBackup( $argv, $startId, $endId ) {
+               $dumper = new DumpBackup( $argv );
+               $dumper->startId = $startId;
+               $dumper->endId = $endId;
+               $dumper->reporting = false;
+
+               // NOTE: The copyTestData() method used by newStreamingDBConnection()
+               // doesn't work with SQLite (T217607).
+               // But DatabaseSqlite doesn't support streaming anyway, so just skip that part.
+               if ( $this->db->getType() === 'sqlite' ) {
+                       $dumper->setDB( $this->db );
+               } else {
+                       $dumper->setDB( $this->newStreamingDBConnection() );
+               }
+
+               return $dumper;
+       }
+
+       public function schemaVersionProvider() {
+               yield [ '0.10' ];
+       }
+
+       /**
+        * @dataProvider schemaVersionProvider
+        */
+       function testFullTextPlain( $schemaVersion ) {
                // Preparing the dump
                $fname = $this->getNewTempFile();
 
-               $dumper = new DumpBackup();
-               $dumper->loadWithArgv( [ '--full', '--quiet', '--output', 'file:' . $fname ] );
-               $dumper->startId = $this->pageId1;
-               $dumper->endId = $this->pageId4 + 1;
-               $dumper->setDB( $this->db );
+               $dumper = $this->newDumpBackup(
+                       [ '--full', '--quiet', '--output', 'file:' . $fname, '--schema-version', $schemaVersion ],
+                       $this->pageId1,
+                       $this->pageId4 + 1
+               );
 
                // Performing the dump
                $dumper->execute();
 
                // Checking the dumped data
-               $this->assertDumpStart( $fname );
+               $this->assertDumpSchema( $fname, $this->getXmlSchemaPath( $schemaVersion ) );
+               $asserter = $this->getDumpAsserter( $schemaVersion );
+
+               $asserter->assertDumpStart( $fname );
 
                // Page 1
-               $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() );
-               $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
-                       $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87",
-                       "BackupDumperTestP1Text1" );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId1,
+                       $this->namespace,
+                       $this->pageTitle1->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId1_1,
+                       "BackupDumperTestP1Summary1",
+                       $this->textId1_1,
+                       23,
+                       "0bolhl6ol7i6x0e7yq91gxgaan39j87",
+                       "BackupDumperTestP1Text1"
+               );
+               $asserter->assertPageEnd();
 
                // Page 2
-               $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() );
-               $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1",
-                       $this->textId2_1, 23, "jprywrymfhysqllua29tj3sc7z39dl2",
-                       "BackupDumperTestP2Text1" );
-               $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2",
-                       $this->textId2_2, 23, "b7vj5ks32po5m1z1t1br4o7scdwwy95",
-                       "BackupDumperTestP2Text2", $this->revId2_1 );
-               $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3",
-                       $this->textId2_3, 23, "jfunqmh1ssfb8rs43r19w98k28gg56r",
-                       "BackupDumperTestP2Text3", $this->revId2_2 );
-               $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
-                       $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv",
-                       "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId2,
+                       $this->namespace,
+                       $this->pageTitle2->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId2_1,
+                       "BackupDumperTestP2Summary1",
+                       $this->textId2_1,
+                       23,
+                       "jprywrymfhysqllua29tj3sc7z39dl2",
+                       "BackupDumperTestP2Text1"
+               );
+               $asserter->assertRevision(
+                       $this->revId2_2,
+                       "BackupDumperTestP2Summary2",
+                       $this->textId2_2,
+                       23,
+                       "b7vj5ks32po5m1z1t1br4o7scdwwy95",
+                       "BackupDumperTestP2Text2",
+                       $this->revId2_1
+               );
+               $asserter->assertRevision(
+                       $this->revId2_3,
+                       "BackupDumperTestP2Summary3",
+                       $this->textId2_3,
+                       23,
+                       "jfunqmh1ssfb8rs43r19w98k28gg56r",
+                       "BackupDumperTestP2Text3",
+                       $this->revId2_2
+               );
+               $asserter->assertRevision(
+                       $this->revId2_4,
+                       "BackupDumperTestP2Summary4 extra",
+                       $this->textId2_4,
+                       44,
+                       "6o1ciaxa6pybnqprmungwofc4lv00wv",
+                       "BackupDumperTestP2Text4 some additional Text",
+                       $this->revId2_3
+               );
+               $asserter->assertPageEnd();
 
                // Page 3
                // -> Page is marked deleted. Hence not visible
 
                // Page 4
-               $this->assertPageStart(
+               $asserter->assertPageStart(
                        $this->pageId4,
                        $this->talk_namespace,
                        $this->pageTitle4->getPrefixedText()
                );
-               $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
-                       $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe",
-                       "Talk about BackupDumperTestP1 Text1" );
-               $this->assertPageEnd();
+               $asserter->assertRevision(
+                       $this->revId4_1,
+                       "Talk BackupDumperTestP1 Summary1",
+                       $this->textId4_1,
+                       35,
+                       "nktofwzd0tl192k3zfepmlzxoax1lpe",
+                       "Talk about BackupDumperTestP1 Text1",
+                       false,
+                       CONTENT_MODEL_WIKITEXT,
+                       CONTENT_FORMAT_WIKITEXT,
+                       $schemaVersion
+               );
+               $asserter->assertPageEnd();
+
+               $asserter->assertDumpEnd();
 
-               $this->assertDumpEnd();
+               // FIXME: add multi-slot test case!
        }
 
-       function testFullStubPlain() {
+       /**
+        * @dataProvider schemaVersionProvider
+        */
+       function testFullStubPlain( $schemaVersion ) {
                // Preparing the dump
                $fname = $this->getNewTempFile();
 
-               $dumper = new DumpBackup();
-               $dumper->loadWithArgv( [ '--full', '--quiet', '--output', 'file:' . $fname, '--stub' ] );
-               $dumper->startId = $this->pageId1;
-               $dumper->endId = $this->pageId4 + 1;
-               $dumper->setDB( $this->db );
+               $dumper = $this->newDumpBackup(
+                       [
+                               '--full',
+                               '--quiet',
+                               '--output',
+                               'file:' . $fname,
+                               '--stub',
+                               '--schema-version', $schemaVersion,
+                       ],
+                       $this->pageId1,
+                       $this->pageId4 + 1
+               );
 
                // Performing the dump
                $dumper->execute();
 
                // Checking the dumped data
-               $this->assertDumpStart( $fname );
+               $this->assertDumpSchema( $fname, $this->getXmlSchemaPath( $schemaVersion ) );
+               $asserter = $this->getDumpAsserter( $schemaVersion );
+
+               $asserter->assertDumpStart( $fname );
 
                // Page 1
-               $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() );
-               $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
-                       $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId1,
+                       $this->namespace,
+                       $this->pageTitle1->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId1_1,
+                       "BackupDumperTestP1Summary1",
+                       $this->textId1_1,
+                       23,
+                       "0bolhl6ol7i6x0e7yq91gxgaan39j87"
+               );
+               $asserter->assertPageEnd();
 
                // Page 2
-               $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() );
-               $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1",
-                       $this->textId2_1, 23, "jprywrymfhysqllua29tj3sc7z39dl2" );
-               $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2",
-                       $this->textId2_2, 23, "b7vj5ks32po5m1z1t1br4o7scdwwy95", false, $this->revId2_1 );
-               $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3",
-                       $this->textId2_3, 23, "jfunqmh1ssfb8rs43r19w98k28gg56r", false, $this->revId2_2 );
-               $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
-                       $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId2,
+                       $this->namespace,
+                       $this->pageTitle2->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId2_1,
+                       "BackupDumperTestP2Summary1",
+                       $this->textId2_1,
+                       23,
+                       "jprywrymfhysqllua29tj3sc7z39dl2"
+               );
+               $asserter->assertRevision(
+                       $this->revId2_2,
+                       "BackupDumperTestP2Summary2",
+                       $this->textId2_2,
+                       23,
+                       "b7vj5ks32po5m1z1t1br4o7scdwwy95",
+                       false,
+                       $this->revId2_1
+               );
+               $asserter->assertRevision(
+                       $this->revId2_3,
+                       "BackupDumperTestP2Summary3",
+                       $this->textId2_3,
+                       23,
+                       "jfunqmh1ssfb8rs43r19w98k28gg56r",
+                       false,
+                       $this->revId2_2
+               );
+               $asserter->assertRevision(
+                       $this->revId2_4,
+                       "BackupDumperTestP2Summary4 extra",
+                       $this->textId2_4,
+                       44,
+                       "6o1ciaxa6pybnqprmungwofc4lv00wv",
+                       false,
+                       $this->revId2_3
+               );
+               $asserter->assertPageEnd();
 
                // Page 3
                // -> Page is marked deleted. Hence not visible
 
                // Page 4
-               $this->assertPageStart(
+               $asserter->assertPageStart(
                        $this->pageId4,
                        $this->talk_namespace,
                        $this->pageTitle4->getPrefixedText()
                );
-               $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
-                       $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" );
-               $this->assertPageEnd();
+               $asserter->assertRevision(
+                       $this->revId4_1,
+                       "Talk BackupDumperTestP1 Summary1",
+                       $this->textId4_1,
+                       35,
+                       "nktofwzd0tl192k3zfepmlzxoax1lpe"
+               );
+               $asserter->assertPageEnd();
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
        }
 
-       function testCurrentStubPlain() {
+       /**
+        * @dataProvider schemaVersionProvider
+        */
+       function testCurrentStubPlain( $schemaVersion ) {
                // Preparing the dump
                $fname = $this->getNewTempFile();
 
-               $dumper = new DumpBackup( [ '--output', 'file:' . $fname ] );
-               $dumper->startId = $this->pageId1;
-               $dumper->endId = $this->pageId4 + 1;
-               $dumper->reporting = false;
-               $dumper->setDB( $this->db );
+               $dumper = $this->newDumpBackup(
+                       [ '--output', 'file:' . $fname, '--schema-version', $schemaVersion ],
+                       $this->pageId1,
+                       $this->pageId4 + 1
+               );
 
                // Performing the dump
                $dumper->dump( WikiExporter::CURRENT, WikiExporter::STUB );
 
                // Checking the dumped data
-               $this->assertDumpStart( $fname );
+               $this->assertDumpSchema( $fname, $this->getXmlSchemaPath( $schemaVersion ) );
+
+               $asserter = $this->getDumpAsserter( $schemaVersion );
+               $asserter->assertDumpStart( $fname );
 
                // Page 1
-               $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() );
-               $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
-                       $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId1,
+                       $this->namespace,
+                       $this->pageTitle1->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId1_1,
+                       "BackupDumperTestP1Summary1",
+                       $this->textId1_1,
+                       23,
+                       "0bolhl6ol7i6x0e7yq91gxgaan39j87"
+               );
+               $asserter->assertPageEnd();
 
                // Page 2
-               $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() );
-               $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
-                       $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId2,
+                       $this->namespace,
+                       $this->pageTitle2->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId2_4,
+                       "BackupDumperTestP2Summary4 extra",
+                       $this->textId2_4,
+                       44,
+                       "6o1ciaxa6pybnqprmungwofc4lv00wv",
+                       false,
+                       $this->revId2_3
+               );
+               $asserter->assertPageEnd();
 
                // Page 3
                // -> Page is marked deleted. Hence not visible
 
                // Page 4
-               $this->assertPageStart(
+               $asserter->assertPageStart(
                        $this->pageId4,
                        $this->talk_namespace,
                        $this->pageTitle4->getPrefixedText()
                );
-               $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
-                       $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" );
-               $this->assertPageEnd();
+               $asserter->assertRevision(
+                       $this->revId4_1,
+                       "Talk BackupDumperTestP1 Summary1",
+                       $this->textId4_1,
+                       35,
+                       "nktofwzd0tl192k3zfepmlzxoax1lpe"
+               );
+               $asserter->assertPageEnd();
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
        }
 
        function testCurrentStubGzip() {
@@ -257,45 +471,67 @@ class BackupDumperPageTest extends DumpTestCase {
                // Preparing the dump
                $fname = $this->getNewTempFile();
 
-               $dumper = new DumpBackup( [ '--output', 'gzip:' . $fname ] );
-               $dumper->startId = $this->pageId1;
-               $dumper->endId = $this->pageId4 + 1;
-               $dumper->reporting = false;
-               $dumper->setDB( $this->db );
+               $dumper = $this->newDumpBackup(
+                       [ '--output', 'gzip:' . $fname ],
+                       $this->pageId1,
+                       $this->pageId4 + 1
+               );
 
                // Performing the dump
                $dumper->dump( WikiExporter::CURRENT, WikiExporter::STUB );
 
                // Checking the dumped data
                $this->gunzip( $fname );
-               $this->assertDumpStart( $fname );
+
+               $asserter = $this->getDumpAsserter();
+               $asserter->assertDumpStart( $fname );
 
                // Page 1
-               $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() );
-               $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
-                       $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId1,
+                       $this->namespace,
+                       $this->pageTitle1->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId1_1,
+                       "BackupDumperTestP1Summary1",
+                       $this->textId1_1,
+                       23,
+                       "0bolhl6ol7i6x0e7yq91gxgaan39j87"
+               );
+               $asserter->assertPageEnd();
 
                // Page 2
-               $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() );
-               $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
-                       $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId2,
+                       $this->namespace,
+                       $this->pageTitle2->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId2_4,
+                       "BackupDumperTestP2Summary4 extra",
+                       $this->textId2_4,
+                       44,
+                       "6o1ciaxa6pybnqprmungwofc4lv00wv",
+                       false,
+                       $this->revId2_3
+               );
+               $asserter->assertPageEnd();
 
                // Page 3
                // -> Page is marked deleted. Hence not visible
 
                // Page 4
-               $this->assertPageStart(
+               $asserter->assertPageStart(
                        $this->pageId4,
                        $this->talk_namespace,
                        $this->pageTitle4->getPrefixedText()
                );
-               $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
+               $asserter->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
                        $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" );
-               $this->assertPageEnd();
+               $asserter->assertPageEnd();
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
        }
 
        /**
@@ -308,22 +544,27 @@ class BackupDumperPageTest extends DumpTestCase {
         *
         * We reproduce such a setup with our mini fixture, although we omit
         * chunks, and all the other gimmicks of xmldumps-backup.
+        *
+        * @dataProvider schemaVersionProvider
         */
-       function testXmlDumpsBackupUseCase() {
+       function testXmlDumpsBackupUseCase( $schemaVersion ) {
                $this->checkHasGzip();
 
                $fnameMetaHistory = $this->getNewTempFile();
                $fnameMetaCurrent = $this->getNewTempFile();
                $fnameArticles = $this->getNewTempFile();
 
-               $dumper = new DumpBackup( [ "--full", "--stub", "--output=gzip:" . $fnameMetaHistory,
-                       "--output=gzip:" . $fnameMetaCurrent, "--filter=latest",
-                       "--output=gzip:" . $fnameArticles, "--filter=latest",
-                       "--filter=notalk", "--filter=namespace:!NS_USER",
-                       "--reporting=1000" ] );
-               $dumper->startId = $this->pageId1;
-               $dumper->endId = $this->pageId4 + 1;
-               $dumper->setDB( $this->db );
+               $dumper = $this->newDumpBackup(
+                       [ "--full", "--stub", "--output=gzip:" . $fnameMetaHistory,
+                               "--output=gzip:" . $fnameMetaCurrent, "--filter=latest",
+                               "--output=gzip:" . $fnameArticles, "--filter=latest",
+                               "--filter=notalk", "--filter=namespace:!NS_USER",
+                               "--reporting=1000", '--schema-version', $schemaVersion
+                       ],
+                       $this->pageId1,
+                       $this->pageId4 + 1
+               );
+               $dumper->reporting = true;
 
                // xmldumps-backup uses reporting. We will not check the exact reported
                // message, as they are dependent on the processing power of the used
@@ -342,89 +583,187 @@ class BackupDumperPageTest extends DumpTestCase {
                // Checking meta-history -------------------------------------------------
 
                $this->gunzip( $fnameMetaHistory );
-               $this->assertDumpStart( $fnameMetaHistory );
+               $this->assertDumpSchema( $fnameMetaHistory, $this->getXmlSchemaPath( $schemaVersion ) );
+
+               $asserter = $this->getDumpAsserter( $schemaVersion );
+               $asserter->assertDumpStart( $fnameMetaHistory );
 
                // Page 1
-               $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() );
-               $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
-                       $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId1,
+                       $this->namespace,
+                       $this->pageTitle1->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId1_1,
+                       "BackupDumperTestP1Summary1",
+                       $this->textId1_1,
+                       23,
+                       "0bolhl6ol7i6x0e7yq91gxgaan39j87"
+               );
+               $asserter->assertPageEnd();
 
                // Page 2
-               $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() );
-               $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1",
-                       $this->textId2_1, 23, "jprywrymfhysqllua29tj3sc7z39dl2" );
-               $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2",
-                       $this->textId2_2, 23, "b7vj5ks32po5m1z1t1br4o7scdwwy95", false, $this->revId2_1 );
-               $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3",
-                       $this->textId2_3, 23, "jfunqmh1ssfb8rs43r19w98k28gg56r", false, $this->revId2_2 );
-               $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
-                       $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId2,
+                       $this->namespace,
+                       $this->pageTitle2->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId2_1,
+                       "BackupDumperTestP2Summary1",
+                       $this->textId2_1,
+                       23,
+                       "jprywrymfhysqllua29tj3sc7z39dl2"
+               );
+               $asserter->assertRevision(
+                       $this->revId2_2,
+                       "BackupDumperTestP2Summary2",
+                       $this->textId2_2,
+                       23,
+                       "b7vj5ks32po5m1z1t1br4o7scdwwy95",
+                       false,
+                       $this->revId2_1
+               );
+               $asserter->assertRevision(
+                       $this->revId2_3,
+                       "BackupDumperTestP2Summary3",
+                       $this->textId2_3,
+                       23,
+                       "jfunqmh1ssfb8rs43r19w98k28gg56r",
+                       false,
+                       $this->revId2_2
+               );
+               $asserter->assertRevision(
+                       $this->revId2_4,
+                       "BackupDumperTestP2Summary4 extra",
+                       $this->textId2_4,
+                       44,
+                       "6o1ciaxa6pybnqprmungwofc4lv00wv",
+                       false,
+                       $this->revId2_3
+               );
+               $asserter->assertPageEnd();
 
                // Page 3
                // -> Page is marked deleted. Hence not visible
 
                // Page 4
-               $this->assertPageStart(
+               $asserter->assertPageStart(
                        $this->pageId4,
                        $this->talk_namespace,
-                       $this->pageTitle4->getPrefixedText()
+                       $this->pageTitle4->getPrefixedText( $schemaVersion )
                );
-               $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
-                       $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" );
-               $this->assertPageEnd();
+               $asserter->assertRevision(
+                       $this->revId4_1,
+                       "Talk BackupDumperTestP1 Summary1",
+                       $this->textId4_1,
+                       35,
+                       "nktofwzd0tl192k3zfepmlzxoax1lpe"
+               );
+               $asserter->assertPageEnd();
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
 
                // Checking meta-current -------------------------------------------------
 
                $this->gunzip( $fnameMetaCurrent );
-               $this->assertDumpStart( $fnameMetaCurrent );
+               $this->assertDumpSchema( $fnameMetaCurrent, $this->getXmlSchemaPath( $schemaVersion ) );
+
+               $asserter = $this->getDumpAsserter( $schemaVersion );
+               $asserter->assertDumpStart( $fnameMetaCurrent );
 
                // Page 1
-               $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() );
-               $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
-                       $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId1,
+                       $this->namespace,
+                       $this->pageTitle1->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId1_1,
+                       "BackupDumperTestP1Summary1",
+                       $this->textId1_1,
+                       23,
+                       "0bolhl6ol7i6x0e7yq91gxgaan39j87"
+               );
+               $asserter->assertPageEnd();
 
                // Page 2
-               $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() );
-               $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
-                       $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId2,
+                       $this->namespace,
+                       $this->pageTitle2->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId2_4,
+                       "BackupDumperTestP2Summary4 extra",
+                       $this->textId2_4,
+                       44,
+                       "6o1ciaxa6pybnqprmungwofc4lv00wv",
+                       false,
+                       $this->revId2_3
+               );
+               $asserter->assertPageEnd();
 
                // Page 3
                // -> Page is marked deleted. Hence not visible
 
                // Page 4
-               $this->assertPageStart(
+               $asserter->assertPageStart(
                        $this->pageId4,
                        $this->talk_namespace,
                        $this->pageTitle4->getPrefixedText()
                );
-               $this->assertRevision( $this->revId4_1, "Talk BackupDumperTestP1 Summary1",
-                       $this->textId4_1, 35, "nktofwzd0tl192k3zfepmlzxoax1lpe" );
-               $this->assertPageEnd();
+               $asserter->assertRevision(
+                       $this->revId4_1,
+                       "Talk BackupDumperTestP1 Summary1",
+                       $this->textId4_1,
+                       35,
+                       "nktofwzd0tl192k3zfepmlzxoax1lpe"
+               );
+               $asserter->assertPageEnd();
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
 
                // Checking articles -------------------------------------------------
 
                $this->gunzip( $fnameArticles );
-               $this->assertDumpStart( $fnameArticles );
+               $this->assertDumpSchema( $fnameArticles, $this->getXmlSchemaPath( $schemaVersion ) );
+
+               $asserter = $this->getDumpAsserter( $schemaVersion );
+               $asserter->assertDumpStart( $fnameArticles );
 
                // Page 1
-               $this->assertPageStart( $this->pageId1, $this->namespace, $this->pageTitle1->getPrefixedText() );
-               $this->assertRevision( $this->revId1_1, "BackupDumperTestP1Summary1",
-                       $this->textId1_1, 23, "0bolhl6ol7i6x0e7yq91gxgaan39j87" );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId1,
+                       $this->namespace,
+                       $this->pageTitle1->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId1_1,
+                       "BackupDumperTestP1Summary1",
+                       $this->textId1_1,
+                       23,
+                       "0bolhl6ol7i6x0e7yq91gxgaan39j87"
+               );
+               $asserter->assertPageEnd();
 
                // Page 2
-               $this->assertPageStart( $this->pageId2, $this->namespace, $this->pageTitle2->getPrefixedText() );
-               $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra",
-                       $this->textId2_4, 44, "6o1ciaxa6pybnqprmungwofc4lv00wv", false, $this->revId2_3 );
-               $this->assertPageEnd();
+               $asserter->assertPageStart(
+                       $this->pageId2,
+                       $this->namespace,
+                       $this->pageTitle2->getPrefixedText()
+               );
+               $asserter->assertRevision(
+                       $this->revId2_4,
+                       "BackupDumperTestP2Summary4 extra",
+                       $this->textId2_4,
+                       44,
+                       "6o1ciaxa6pybnqprmungwofc4lv00wv",
+                       false,
+                       $this->revId2_3
+               );
+               $asserter->assertPageEnd();
 
                // Page 3
                // -> Page is marked deleted. Hence not visible
@@ -432,7 +771,7 @@ class BackupDumperPageTest extends DumpTestCase {
                // Page 4
                // -> Page is not in $this->namespace. Hence not visible
 
-               $this->assertDumpEnd();
+               $asserter->assertDumpEnd();
 
                $this->expectETAOutput();
        }
index 7cbda3c..8eadb0e 100644 (file)
@@ -4,6 +4,7 @@ namespace MediaWiki\Tests\Maintenance;
 
 use ContentHandler;
 use FetchText;
+use MediaWiki\Storage\RevisionRecord;
 use MediaWikiTestCase;
 use MWException;
 use Title;
@@ -104,12 +105,12 @@ class FetchTextTest extends MediaWikiTestCase {
        private $fetchText;
 
        /**
-        * Adds a revision to a page, while returning the resuting text's id
+        * Adds a revision to a page and returns the main slot's blob address
         *
         * @param WikiPage $page The page to add the revision to
         * @param string $text The revisions text
         * @param string $summary The revisions summare
-        * @return int
+        * @return string
         * @throws MWException
         */
        private function addRevision( $page, $text, $summary ) {
@@ -120,15 +121,14 @@ class FetchTextTest extends MediaWikiTestCase {
 
                if ( $status->isGood() ) {
                        $value = $status->getValue();
-                       $revision = $value['revision'];
-                       $id = $revision->getTextId();
 
-                       if ( $id > 0 ) {
-                               return $id;
-                       }
+                       /** @var RevisionRecord $revision */
+                       $revision = $value['revision-record'];
+                       $address = $revision->getSlot( 'main' )->getAddress();
+                       return $address;
                }
 
-               throw new MWException( "Could not determine text id" );
+               throw new MWException( "Could not create revision" );
        }
 
        function addDBDataOnce() {
@@ -211,6 +211,11 @@ class FetchTextTest extends MediaWikiTestCase {
                        self::$textId2 . "\n23\nFetchTextTestPage2Text1" );
        }
 
+       function testExistingInteger() {
+               $this->assertFilter( (int)preg_replace( '/^tt:/', '', self::$textId2 ),
+                       self::$textId2 . "\n23\nFetchTextTestPage2Text1" );
+       }
+
        function testExistingSeveral() {
                $this->assertFilter(
                        implode( "\n", [
@@ -233,36 +238,52 @@ class FetchTextTest extends MediaWikiTestCase {
        }
 
        function testNonExisting() {
-               $this->assertFilter( self::$textId5 + 10, ( self::$textId5 + 10 ) . "\n-1\n" );
+               \Wikimedia\suppressWarnings();
+               $this->assertFilter( 'tt:77889911', 'tt:77889911' . "\n-1\n" );
+               \Wikimedia\suppressWarnings( true );
+       }
+
+       function testNonExistingInteger() {
+               \Wikimedia\suppressWarnings();
+               $this->assertFilter( '77889911', 'tt:77889911' . "\n-1\n" );
+               \Wikimedia\suppressWarnings( true );
+       }
+
+       function testBadBlobAddressWithColon() {
+               $this->assertFilter( 'foo:bar', 'foo:bar' . "\n-1\n" );
        }
 
        function testNegativeInteger() {
-               $this->assertFilter( "-42", "-42\n-1\n" );
+               $this->assertFilter( "-42", "tt:-42\n-1\n" );
        }
 
        function testFloatingPointNumberExisting() {
-               // float -> int -> revision
-               $this->assertFilter( self::$textId3 + 0.14159,
+               // float -> int -> address -> revision
+               $id = intval( preg_replace( '/^tt:/', '', self::$textId3 ) ) + 0.14159;
+               $this->assertFilter( 'tt:' . intval( $id ),
                        self::$textId3 . "\n23\nFetchTextTestPage2Text2" );
        }
 
        function testFloatingPointNumberNonExisting() {
-               $this->assertFilter( self::$textId5 + 3.14159,
-                       ( self::$textId5 + 3 ) . "\n-1\n" );
+               \Wikimedia\suppressWarnings();
+               $id = intval( preg_replace( '/^tt:/', '', self::$textId5 ) ) + 3.14159;
+               $this->assertFilter( $id, 'tt:' . intval( $id ) . "\n-1\n" );
+               \Wikimedia\suppressWarnings( true );
        }
 
        function testCharacters() {
-               $this->assertFilter( "abc", "0\n-1\n" );
+               $this->assertFilter( "abc", "abc\n-1\n" );
        }
 
        function testMix() {
-               $this->assertFilter( "ab\n" . self::$textId4 . ".5cd\n\nefg\n" . self::$textId2
+               $this->assertFilter( "ab\n" . self::$textId4 . ".5cd\n\nefg\nfoo:bar\n" . self::$textId2
                                . "\n" . self::$textId3,
                        implode( "", [
-                               "0\n-1\n",
-                               self::$textId4 . "\n23\nFetchTextTestPage2Text3",
-                               "0\n-1\n",
-                               "0\n-1\n",
+                               "ab\n-1\n",
+                               self::$textId4 . ".5cd\n-1\n",
+                               "\n-1\n",
+                               "efg\n-1\n",
+                               "foo:bar\n-1\n",
                                self::$textId2 . "\n23\nFetchTextTestPage2Text1",
                                self::$textId3 . "\n23\nFetchTextTestPage2Text2"
                        ] ) );
diff --git a/tests/phpunit/maintenance/xml.xsd b/tests/phpunit/maintenance/xml.xsd
new file mode 100644 (file)
index 0000000..aea7d0d
--- /dev/null
@@ -0,0 +1,287 @@
+<?xml version='1.0'?>
+<?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns   ="http://www.w3.org/1999/xhtml"
+  xml:lang="en">
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+    <h1>About the XML namespace</h1>
+
+    <div class="bodytext">
+     <p>
+      This schema document describes the XML namespace, in a form
+      suitable for import by other schema documents.
+     </p>
+     <p>
+      See <a href="http://www.w3.org/XML/1998/namespace.html">
+      http://www.w3.org/XML/1998/namespace.html</a> and
+      <a href="http://www.w3.org/TR/REC-xml">
+      http://www.w3.org/TR/REC-xml</a> for information 
+      about this namespace.
+     </p>
+     <p>
+      Note that local names in this namespace are intended to be
+      defined only by the World Wide Web Consortium or its subgroups.
+      The names currently defined in this namespace are listed below.
+      They should not be used with conflicting semantics by any Working
+      Group, specification, or document instance.
+     </p>
+     <p>   
+      See further below in this document for more information about <a
+      href="#usage">how to refer to this schema document from your own
+      XSD schema documents</a> and about <a href="#nsversioning">the
+      namespace-versioning policy governing this schema document</a>.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>lang (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       is a language code for the natural language of the content of
+       any element; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML specification.</p>
+     
+    </div>
+    <div>
+     <h4>Notes</h4>
+     <p>
+      Attempting to install the relevant ISO 2- and 3-letter
+      codes as the enumerated possible values is probably never
+      going to be a realistic possibility.  
+     </p>
+     <p>
+      See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
+       http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
+      and the IANA language subtag registry at
+      <a href="http://www.iana.org/assignments/language-subtag-registry">
+       http://www.iana.org/assignments/language-subtag-registry</a>
+      for further information.
+     </p>
+     <p>
+      The union allows for the 'un-declaration' of xml:lang with
+      the empty string.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:union memberTypes="xs:language">
+    <xs:simpleType>    
+     <xs:restriction base="xs:string">
+      <xs:enumeration value=""/>
+     </xs:restriction>
+    </xs:simpleType>
+   </xs:union>
+  </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>space (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose
+       value is a keyword indicating what whitespace processing
+       discipline is intended for the content of the element; its
+       value is inherited.  This name is reserved by virtue of its
+       definition in the XML specification.</p>
+     
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:restriction base="xs:NCName">
+    <xs:enumeration value="default"/>
+    <xs:enumeration value="preserve"/>
+   </xs:restriction>
+  </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>base (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       provides a URI to be used as the base for interpreting any
+       relative URIs in the scope of the element on which it
+       appears; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML Base specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="id" type="xs:ID">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>id (as an attribute name)</h3> 
+      <p>
+       denotes an attribute whose value
+       should be interpreted as if declared to be of type ID.
+       This name is reserved by virtue of its definition in the
+       xml:id specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+  <xs:attribute ref="xml:base"/>
+  <xs:attribute ref="xml:lang"/>
+  <xs:attribute ref="xml:space"/>
+  <xs:attribute ref="xml:id"/>
+ </xs:attributeGroup>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+   
+    <h3>Father (in any context at all)</h3> 
+
+    <div class="bodytext">
+     <p>
+      denotes Jon Bosak, the chair of 
+      the original XML Working Group.  This name is reserved by 
+      the following decision of the W3C XML Plenary and 
+      XML Coordination groups:
+     </p>
+     <blockquote>
+       <p>
+       In appreciation for his vision, leadership and
+       dedication the W3C XML Plenary on this 10th day of
+       February, 2000, reserves for Jon Bosak in perpetuity
+       the XML name "xml:Father".
+       </p>
+     </blockquote>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div xml:id="usage" id="usage">
+    <h2><a name="usage">About this schema document</a></h2>
+
+    <div class="bodytext">
+     <p>
+      This schema defines attributes and an attribute group suitable
+      for use by schemas wishing to allow <code>xml:base</code>,
+      <code>xml:lang</code>, <code>xml:space</code> or
+      <code>xml:id</code> attributes on elements they define.
+     </p>
+     <p>
+      To enable this, such a schema must import this schema for
+      the XML namespace, e.g. as follows:
+     </p>
+     <pre>
+          &lt;schema . . .>
+           . . .
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     </pre>
+     <p>
+      or
+     </p>
+     <pre>
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     </pre>
+     <p>
+      Subsequently, qualified reference to any of the attributes or the
+      group defined below will have the desired effect, e.g.
+     </p>
+     <pre>
+          &lt;type . . .>
+           . . .
+           &lt;attributeGroup ref="xml:specialAttrs"/>
+     </pre>
+     <p>
+      will define a type which will schema-validate an instance element
+      with any of those attributes.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div id="nsversioning" xml:id="nsversioning">
+    <h2><a name="nsversioning">Versioning policy for this schema document</a></h2>
+    <div class="bodytext">
+     <p>
+      In keeping with the XML Schema WG's standard versioning
+      policy, this schema document will persist at
+      <a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd</a>.
+     </p>
+     <p>
+      At the date of issue it can also be found at
+      <a href="http://www.w3.org/2001/xml.xsd">
+       http://www.w3.org/2001/xml.xsd</a>.
+     </p>
+     <p>
+      The schema document at that URI may however change in the future,
+      in order to remain compatible with the latest version of XML
+      Schema itself, or with the XML namespace itself.  In other words,
+      if the XML Schema or XML namespaces change, the version of this
+      document at <a href="http://www.w3.org/2001/xml.xsd">
+       http://www.w3.org/2001/xml.xsd 
+      </a> 
+      will change accordingly; the version at 
+      <a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd 
+      </a> 
+      will not change.
+     </p>
+     <p>
+      Previous dated (and unchanging) versions of this schema 
+      document are at:
+     </p>
+     <ul>
+      <li><a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2007/08/xml.xsd">
+       http://www.w3.org/2007/08/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2004/10/xml.xsd">
+       http://www.w3.org/2004/10/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2001/03/xml.xsd">
+       http://www.w3.org/2001/03/xml.xsd</a></li>
+     </ul>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+</xs:schema>
+
index 38cd062..dd766c8 100644 (file)
@@ -7,7 +7,8 @@
                "mocha": true
        },
        "globals": {
-               "browser": false
+               "browser": false,
+               "mw": false
        },
        "rules": {
                "no-console": 0
index acaf3ea..6b45e66 100644 (file)
@@ -1,11 +1,40 @@
-const Page = require( 'wdio-mediawiki/Page' );
+const Page = require( 'wdio-mediawiki/Page' ),
+       Api = require( 'wdio-mediawiki/Api' );
 
 class HistoryPage extends Page {
+       get heading() { return browser.element( '#firstHeading' ); }
+       get headingText() { return browser.getText( '#firstHeading' ); }
        get comment() { return browser.element( '#pagehistory .comment' ); }
+       get rollback() { return browser.element( '.mw-rollback-link' ); }
+       get rollbackConfirmable() { return browser.element( '.mw-rollback-link .jquery-confirmable-text' ); }
+       get rollbackConfirmableYes() { return browser.element( '.mw-rollback-link .jquery-confirmable-button-yes' ); }
+       get rollbackConfirmableNo() { return browser.element( '.mw-rollback-link .jquery-confirmable-button-no' ); }
 
        open( title ) {
                super.openTitle( title, { action: 'history' } );
        }
+
+       vandalizePage( name, content ) {
+               let vandalUsername = 'Evil_' + browser.options.username;
+
+               browser.call( function () {
+                       return Api.edit( name, content );
+               } );
+
+               browser.call( function () {
+                       return Api.createAccount(
+                               vandalUsername, browser.options.password
+                       );
+               } );
+
+               browser.call( function () {
+                       Api.edit(
+                               name,
+                               'Vandalized: ' + content,
+                               vandalUsername
+                       );
+               } );
+       }
 }
 
 module.exports = new HistoryPage();
index 3b24298..d35843b 100644 (file)
@@ -5,7 +5,7 @@ const assert = require( 'assert' ),
        EditPage = require( '../pageobjects/edit.page' ),
        HistoryPage = require( '../pageobjects/history.page' ),
        UndoPage = require( '../pageobjects/undo.page' ),
-       UserLoginPage = require( '../pageobjects/userlogin.page' ),
+       UserLoginPage = require( 'wdio-mediawiki/LoginPage' ),
        Util = require( 'wdio-mediawiki/Util' );
 
 describe( 'Page', function () {
@@ -91,7 +91,7 @@ describe( 'Page', function () {
 
                // check
                HistoryPage.open( name );
-               assert.strictEqual( HistoryPage.comment.getText(), `(Created page with "${content}")` );
+               assert.strictEqual( HistoryPage.comment.getText(), `(Created or updated page with "${content}")` );
        } );
 
        it( 'should be deletable', function () {
diff --git a/tests/selenium/specs/rollback.js b/tests/selenium/specs/rollback.js
new file mode 100644 (file)
index 0000000..c52eca1
--- /dev/null
@@ -0,0 +1,114 @@
+const assert = require( 'assert' ),
+       HistoryPage = require( '../pageobjects/history.page' ),
+       UserLoginPage = require( 'wdio-mediawiki/LoginPage' ),
+       Util = require( 'wdio-mediawiki/Util' );
+
+describe( 'Rollback with confirmation', function () {
+       var content,
+               name;
+
+       before( function () {
+               // disable VisualEditor welcome dialog
+               browser.deleteCookie();
+               UserLoginPage.open();
+               browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } );
+
+               // Enable rollback confirmation for admin user
+               // Requires user to log in again, handled by deleteCookie() call in beforeEach function
+               UserLoginPage.loginAdmin();
+
+               browser.pause( 300 );
+               browser.execute( function () {
+                       return ( new mw.Api() ).saveOption(
+                               'showrollbackconfirmation',
+                               '1'
+                       );
+               } );
+       } );
+
+       beforeEach( function () {
+               browser.deleteCookie();
+
+               content = Util.getTestString( 'beforeEach-content-' );
+               name = Util.getTestString( 'BeforeEach-name-' );
+
+               HistoryPage.vandalizePage( name, content );
+
+               UserLoginPage.loginAdmin();
+               HistoryPage.open( name );
+       } );
+
+       it( 'should offer rollback options for admin users', function () {
+               assert.strictEqual( HistoryPage.rollback.getText(), 'rollback 1 edit' );
+
+               HistoryPage.rollback.click();
+
+               assert.strictEqual( HistoryPage.rollbackConfirmable.getText(), 'Rollback of one edit?' );
+               assert.strictEqual( HistoryPage.rollbackConfirmableYes.getText(), 'Rollback' );
+               assert.strictEqual( HistoryPage.rollbackConfirmableNo.getText(), 'Cancel' );
+       } );
+
+       it( 'should offer a way to cancel rollbacks', function () {
+               HistoryPage.rollback.click();
+               HistoryPage.rollbackConfirmableNo.click();
+
+               browser.pause( 500 );
+
+               assert.strictEqual( HistoryPage.heading.getText(), 'Revision history of "' + name + '"' );
+       } );
+
+       it( 'should perform rollbacks after confirming intention', function () {
+               HistoryPage.rollback.click();
+               HistoryPage.rollbackConfirmableYes.click();
+
+               // waitUntil indirectly asserts that the content we are looking for is present
+               browser.waitUntil( function () {
+                       return browser.getText( '#firstHeading' ) === 'Action complete';
+               }, 5000, 'Expected rollback page to appear.' );
+       } );
+} );
+
+describe( 'Rollback without confirmation', function () {
+       var content,
+               name;
+
+       before( function () {
+               // disable VisualEditor welcome dialog
+               browser.deleteCookie();
+               UserLoginPage.open();
+               browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } );
+
+               // Disable rollback confirmation for admin user
+               // Requires user to log in again, handled by deleteCookie() call in beforeEach function
+               UserLoginPage.loginAdmin();
+
+               browser.pause( 300 );
+               browser.execute( function () {
+                       return ( new mw.Api() ).saveOption(
+                               'showrollbackconfirmation',
+                               '0'
+                       );
+               } );
+       } );
+
+       beforeEach( function () {
+               browser.deleteCookie();
+
+               content = Util.getTestString( 'beforeEach-content-' );
+               name = Util.getTestString( 'BeforeEach-name-' );
+
+               HistoryPage.vandalizePage( name, content );
+
+               UserLoginPage.loginAdmin();
+               HistoryPage.open( name );
+       } );
+
+       it( 'should perform rollback without asking the user to confirm', function () {
+               HistoryPage.rollback.click();
+
+               // waitUntil indirectly asserts that the content we are looking for is present
+               browser.waitUntil( function () {
+                       return HistoryPage.headingText === 'Action complete';
+               }, 5000, 'Expected rollback page to appear.' );
+       } );
+} );
index f68fee9..7947ff5 100644 (file)
@@ -5,22 +5,31 @@ const MWBot = require( 'mwbot' );
 module.exports = {
        /**
         * Shortcut for `MWBot#edit( .. )`.
+        * Default username, password and base URL is used unless specified
         *
         * @since 1.0.0
         * @see <https://www.mediawiki.org/wiki/API:Edit>
         * @param {string} title
         * @param {string} content
+        * @param {string} username - Optional
+        * @param {string} password - Optional
+        * @param {baseUrl} baseUrl - Optional
         * @return {Object} Promise for API action=edit response data.
         */
-       edit( title, content ) {
+       edit( title,
+               content,
+               username = browser.options.username,
+               password = browser.options.password,
+               baseUrl = browser.options.baseUrl
+       ) {
                let bot = new MWBot();
 
                return bot.loginGetEditToken( {
-                       apiUrl: `${browser.options.baseUrl}/api.php`,
-                       username: browser.options.username,
-                       password: browser.options.password
+                       apiUrl: `${baseUrl}/api.php`,
+                       username: username,
+                       password: password
                } ).then( function () {
-                       return bot.edit( title, content, `Created page with "${content}"` );
+                       return bot.edit( title, content, `Created or updated page with "${content}"` );
                } );
        },