diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:31:04 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-06-04 07:58:39 +0200 |
commit | f6d65e533c62f6deb21342d4901ece24497b433e (patch) | |
tree | f28adf0362d14bcd448f7b65a7aaf38650f923aa /tests | |
parent | c27b2e832fe25651ef2410fae85b41072aae7519 (diff) |
Update to MediaWiki 1.25.1
Diffstat (limited to 'tests')
335 files changed, 17240 insertions, 5582 deletions
diff --git a/tests/TestsAutoLoader.php b/tests/TestsAutoLoader.php index 2e8fed44..def23dad 100644 --- a/tests/TestsAutoLoader.php +++ b/tests/TestsAutoLoader.php @@ -44,18 +44,18 @@ $wgAutoloadClasses += array( 'ResourceLoaderTestCase' => "$testDir/phpunit/ResourceLoaderTestCase.php", 'ResourceLoaderTestModule' => "$testDir/phpunit/ResourceLoaderTestCase.php", 'ResourceLoaderFileModuleTestModule' => "$testDir/phpunit/ResourceLoaderTestCase.php", - 'ResourceLoaderWikiModuleTestModule' => "$testDir/phpunit/ResourceLoaderTestCase.php", 'TestUser' => "$testDir/phpunit/includes/TestUser.php", 'LessFileCompilationTest' => "$testDir/phpunit/LessFileCompilationTest.php", # tests/phpunit/includes - 'BlockTest' => "$testDir/phpunit/includes/BlockTest.php", - 'RevisionStorageTest' => "$testDir/phpunit/includes/RevisionStorageTest.php", - 'WikiPageTest' => "$testDir/phpunit/includes/WikiPageTest.php", + 'TestingAccessWrapper' => "$testDir/phpunit/includes/TestingAccessWrapper.php", # tests/phpunit/includes/api 'ApiFormatTestBase' => "$testDir/phpunit/includes/api/format/ApiFormatTestBase.php", + 'ApiQueryTestBase' => "$testDir/phpunit/includes/api/query/ApiQueryTestBase.php", + 'ApiQueryContinueTestBase' => "$testDir/phpunit/includes/api/query/ApiQueryContinueTestBase.php", 'ApiTestCase' => "$testDir/phpunit/includes/api/ApiTestCase.php", + 'ApiTestCaseUpload' => "$testDir/phpunit/includes/api/ApiTestCaseUpload.php", 'ApiTestContext' => "$testDir/phpunit/includes/api/ApiTestContext.php", 'MockApi' => "$testDir/phpunit/includes/api/MockApi.php", 'MockApiQueryBase' => "$testDir/phpunit/includes/api/MockApiQueryBase.php", @@ -79,9 +79,16 @@ $wgAutoloadClasses += array( 'PageORMTableForTesting' => "$testDir/phpunit/includes/db/ORMTableTest.php", 'DatabaseTestHelper' => "$testDir/phpunit/includes/db/DatabaseTestHelper.php", - # tests/phpunit/includes/passwords + # tests/phpunit/includes/diff + 'FakeDiffOp' => "$testDir/phpunit/includes/diff/FakeDiffOp.php", + + # tests/phpunit/includes/password 'PasswordTestCase' => "$testDir/phpunit/includes/password/PasswordTestCase.php", + # tests/phpunit/includes/resourceloader + 'ResourceLoaderImageModuleTest' => "$testDir/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php", + 'ResourceLoaderImageModuleTestable' => "$testDir/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php", + # tests/phpunit/languages 'LanguageClassesTestCase' => "$testDir/phpunit/languages/LanguageClassesTestCase.php", @@ -112,4 +119,7 @@ $wgAutoloadClasses += array( # tests/phpunit/includes/site 'SiteTest' => "$testDir/phpunit/includes/site/SiteTest.php", 'TestSites' => "$testDir/phpunit/includes/site/TestSites.php", + + # tests/phpunit/includes/specialpage + 'SpecialPageTestHelper' => "$testDir/phpunit/includes/specialpage/SpecialPageTestHelper.php", ); diff --git a/tests/browser/Gemfile.lock b/tests/browser/Gemfile.lock deleted file mode 100644 index 1ea4eb55..00000000 --- a/tests/browser/Gemfile.lock +++ /dev/null @@ -1,82 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - builder (3.2.2) - childprocess (0.5.3) - ffi (~> 1.0, >= 1.0.11) - cucumber (1.3.16) - builder (>= 2.1.2) - diff-lcs (>= 1.1.3) - gherkin (~> 2.12) - multi_json (>= 1.7.5, < 2.0) - multi_test (>= 0.1.1) - data_magic (0.19) - faker (>= 1.1.2) - yml_reader (>= 0.3) - diff-lcs (1.2.5) - domain_name (0.5.20) - unf (>= 0.0.5, < 1.0.0) - faker (1.4.3) - i18n (~> 0.5) - faraday (0.9.0) - multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.6) - faraday (>= 0.7.4) - http-cookie (~> 1.0.0) - ffi (1.9.3) - gherkin (2.12.2) - multi_json (~> 1.3) - headless (1.0.2) - http-cookie (1.0.2) - domain_name (~> 0.5) - i18n (0.6.11) - json (1.8.1) - mediawiki_api (0.2.1) - faraday (~> 0.9, >= 0.9.0) - faraday-cookie_jar (~> 0.0, >= 0.0.6) - mediawiki_selenium (0.3.2) - cucumber (~> 1.3, >= 1.3.10) - headless (~> 1.0, >= 1.0.1) - json (~> 1.8, >= 1.8.1) - mediawiki_api (~> 0.2, >= 0.2.1) - page-object (~> 1.0) - rest-client (~> 1.6, >= 1.6.7) - rspec-expectations (~> 2.14, >= 2.14.4) - syntax (~> 1.2, >= 1.2.0) - mime-types (2.3) - multi_json (1.10.1) - multi_test (0.1.1) - multipart-post (2.0.0) - netrc (0.7.7) - page-object (1.0.2) - page_navigation (>= 0.9) - selenium-webdriver (>= 2.42.0) - watir-webdriver (>= 0.6.9) - page_navigation (0.9) - data_magic (>= 0.14) - rest-client (1.7.2) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - rspec-expectations (2.99.2) - diff-lcs (>= 1.1.3, < 2.0) - rubyzip (1.1.6) - selenium-webdriver (2.42.0) - childprocess (>= 0.5.0) - multi_json (~> 1.0) - rubyzip (~> 1.0) - websocket (~> 1.0.4) - syntax (1.2.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.6) - watir-webdriver (0.6.10) - selenium-webdriver (>= 2.18.0) - websocket (1.0.7) - yml_reader (0.3) - -PLATFORMS - ruby - -DEPENDENCIES - mediawiki_api - mediawiki_selenium diff --git a/tests/browser/environment_variables b/tests/browser/environment_variables deleted file mode 100644 index 25c45775..00000000 --- a/tests/browser/environment_variables +++ /dev/null @@ -1,5 +0,0 @@ -export MEDIAWIKI_URL=http://localhost/wiki/ -export MEDIAWIKI_API_URL=http://localhost/w/api.php -export MEDIAWIKI_USER=Selenium_user -export MEDIAWIKI_PASSWORD=Selenium_password -export BROWSER=firefox diff --git a/tests/browser/environments.yml b/tests/browser/environments.yml new file mode 100644 index 00000000..8f8381ed --- /dev/null +++ b/tests/browser/environments.yml @@ -0,0 +1,35 @@ +# Customize this configuration as necessary to provide defaults for various +# test environments. +# +# The set of defaults to use is determined by the MEDIAWIKI_ENVIRONMENT +# environment variable. +# +# export MEDIAWIKI_ENVIRONMENT=mw-vagrant-host +# bundle exec cucumber +# +# Additional variables set by the environment will override the corresponding +# defaults defined here. +# +# export MEDIAWIKI_ENVIRONMENT=mw-vagrant-host +# export MEDIAWIKI_USER=Selenium_user2 +# bundle exec cucumber +# +mw-vagrant-host: + mediawiki_url: http://127.0.0.1:8080/wiki/ + mediawiki_user: Selenium_user + mediawiki_password: vagrant + +mw-vagrant-guest: + mediawiki_url: http://127.0.0.1/wiki/ + mediawiki_user: Selenium_user + mediawiki_password: vagrant + +beta: + mediawiki_url: http://en.wikipedia.beta.wmflabs.org/wiki/ + mediawiki_user: Selenium_user + # mediawiki_password: SET THIS IN THE ENVIRONMENT! + +test2: + mediawiki_url: http://test2.wikipedia.org/wiki/ + mediawiki_user: Selenium_user + # mediawiki_password: SET THIS IN THE ENVIRONMENT! diff --git a/tests/browser/features/file.feature b/tests/browser/features/file.feature index 0bd36ed6..35a6675d 100644 --- a/tests/browser/features/file.feature +++ b/tests/browser/features/file.feature @@ -1,14 +1,3 @@ -# -# This file is subject to the license terms in the LICENSE file found in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of -# qa-browsertests, including this file, may be copied, modified, propagated, or -# distributed except according to the terms contained in the LICENSE file. -# -# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS -# @chrome @clean @firefox @internet_explorer_6 @internet_explorer_7 @internet_explorer_8 @internet_explorer_9 @internet_explorer_10 @phantomjs Feature: File diff --git a/tests/browser/features/login.feature b/tests/browser/features/login.feature index c34d23d3..2cb63564 100644 --- a/tests/browser/features/login.feature +++ b/tests/browser/features/login.feature @@ -1,14 +1,3 @@ -# -# This file is subject to the license terms in the LICENSE file found in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of -# qa-browsertests, including this file, may be copied, modified, propagated, or -# distributed except according to the terms contained in the LICENSE file. -# -# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS -# @chrome @clean @firefox @internet_explorer_6 @internet_explorer_7 @internet_explorer_8 @internet_explorer_9 @internet_explorer_10 @phantomjs Feature: Log in diff --git a/tests/browser/features/preferences.feature b/tests/browser/features/preferences.feature index 9e3abfde..9fed9cf4 100644 --- a/tests/browser/features/preferences.feature +++ b/tests/browser/features/preferences.feature @@ -1,14 +1,3 @@ -# -# This file is subject to the license terms in the LICENSE file found in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of -# qa-browsertests, including this file, may be copied, modified, propagated, or -# distributed except according to the terms contained in the LICENSE file. -# -# Copyright 2012-2014 by the Mediawiki developers. See the CREDITS file in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS -# @chrome @clean @firefox @internet_explorer_6 @internet_explorer_7 @internet_explorer_8 @internet_explorer_9 @internet_explorer_10 @login @phantomjs Feature: Preferences diff --git a/tests/browser/features/step_definitions/create_account_steps.rb b/tests/browser/features/step_definitions/create_account_steps.rb index 7fa29843..03bff66f 100644 --- a/tests/browser/features/step_definitions/create_account_steps.rb +++ b/tests/browser/features/step_definitions/create_account_steps.rb @@ -10,9 +10,9 @@ # https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS # Given(/^I go to Create account page at (.+)$/) do |path| - visit(CreateAccountPage, :using_params => {:page_title => path}) + visit(CreateAccountPage, using_params: { page_title: path }) end Then(/^form has Create account button$/) do - on(CreateAccountPage).create_account_element.should exist + expect(on(CreateAccountPage).create_account_element).to exist end diff --git a/tests/browser/features/step_definitions/create_and_follow_wiki_link_steps.rb b/tests/browser/features/step_definitions/create_and_follow_wiki_link_steps.rb index ba41f7fb..504d3454 100644 --- a/tests/browser/features/step_definitions/create_and_follow_wiki_link_steps.rb +++ b/tests/browser/features/step_definitions/create_and_follow_wiki_link_steps.rb @@ -1,28 +1,26 @@ Given(/^I go to the "(.+)" page with content "(.+)"$/) do |page_title, page_content| @wikitext = page_content - on(APIPage).create page_title, page_content + api.create_page page_title, page_content step "I am on the #{page_title} page" end Given(/^I am on the (.+) page$/) do |article| article = article.gsub(/ /, '_') - visit(ZtargetPage, :using_params => {:article_name => article}) + visit(ZtargetPage, using_params: { article_name: article }) end Given(/^I create page "(.*?)" with content "(.*?)"$/) do |page_title, page_content| - on(APIPage).create page_title, page_content + api.create_page page_title, page_content end - When(/^I click the Link Target link$/) do on(ZtargetPage).link_target_page_link end Then(/^I should be on the Link Target Test Page$/) do - @browser.url.should match /Link_Target_Test_Page/ + expect(@browser.url).to match /Link_Target_Test_Page/ end Then(/^the page content should contain "(.*?)"$/) do |content| - on(ZtargetPage).page_content.should match content + expect(on(ZtargetPage).page_content).to match content end - diff --git a/tests/browser/features/step_definitions/edit_page_steps.rb b/tests/browser/features/step_definitions/edit_page_steps.rb index 5ab02bec..0e0aeb17 100644 --- a/tests/browser/features/step_definitions/edit_page_steps.rb +++ b/tests/browser/features/step_definitions/edit_page_steps.rb @@ -19,6 +19,5 @@ When(/^I save the edit$/) do end Then(/^the edited page content should contain "(.*?)"$/) do |content| - on(MainPage).page_content.should match(content + @random_string) + expect(on(MainPage).page_content).to match(content + @random_string) end - diff --git a/tests/browser/features/step_definitions/file_steps.rb b/tests/browser/features/step_definitions/file_steps.rb index a2ed1bfc..a80ca504 100644 --- a/tests/browser/features/step_definitions/file_steps.rb +++ b/tests/browser/features/step_definitions/file_steps.rb @@ -10,9 +10,9 @@ # https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS # Given(/^I am at file that does not exist$/) do - visit(FileDoesNotExistPage, using_params: {page_name: @random_string}) + visit(FileDoesNotExistPage, using_params: { page_name: @random_string }) end Then(/^page should show that no such file exists$/) do - on(FileDoesNotExistPage).file_does_not_exist_message_element.should be_visible + expect(on(FileDoesNotExistPage).file_does_not_exist_message_element).to be_visible end diff --git a/tests/browser/features/step_definitions/login_steps.rb b/tests/browser/features/step_definitions/login_steps.rb index b654b2d3..bff5bddd 100644 --- a/tests/browser/features/step_definitions/login_steps.rb +++ b/tests/browser/features/step_definitions/login_steps.rb @@ -14,52 +14,52 @@ Given(/^I am at Log in page$/) do end When(/^I log in with incorrect password$/) do - on(LoginPage).login_with(ENV["MEDIAWIKI_USER"], "incorrect password", false) + on(LoginPage).login_with(user, 'incorrect password', false) end When(/^I log in with incorrect username$/) do - on(LoginPage).login_with("incorrect username", ENV["MEDIAWIKI_PASSWORD"], false) + on(LoginPage).login_with('incorrect username', password, false) end When(/^I log in without entering credentials$/) do - on(LoginPage).login_with("", "", false) + on(LoginPage).login_with('', '', false) end When(/^I log in without entering password$/) do - on(LoginPage).login_with(ENV["MEDIAWIKI_USER"], "", false) + on(LoginPage).login_with(user, '', false) end Then(/^error box should be visible$/) do - on(LoginErrorPage).error_box_element.should be_visible + expect(on(LoginErrorPage).error_box_element).to be_visible end Then(/^error box should not be visible$/) do - on(LoginErrorPage).error_box_element.should_not be_visible + expect(on(LoginErrorPage).error_box_element).not_to be_visible end Then(/^feedback should be (.+)$/) do |feedback| on(LoginPage) do |page| page.feedback_element.when_present.click - page.feedback.should match Regexp.escape(feedback) + expect(page.feedback).to match Regexp.escape(feedback) end end Then(/^Log in element should be there$/) do - on(LoginPage).login_element.should exist + expect(on(LoginPage).login_element).to exist end Then(/^main page should open$/) do - @browser.url.should == on(MainPage).class.url + expect(@browser.url).to eq on(MainPage).class.url end Then(/^Password element should be there$/) do - on(LoginPage).password_element.should exist + expect(on(LoginPage).password_element).to exist end Then(/^there should be a link to (.+)$/) do |text| - on(LoginPage).username_displayed_element.when_present.text.should == text + expect(on(LoginPage).username_displayed_element.when_present.text).to eq text end Then(/^Username element should be there$/) do - on(LoginPage).username_element.should exist + expect(on(LoginPage).username_element).to exist end diff --git a/tests/browser/features/step_definitions/main_page_links_steps.rb b/tests/browser/features/step_definitions/main_page_links_steps.rb index c76fd2ba..7f588c05 100644 --- a/tests/browser/features/step_definitions/main_page_links_steps.rb +++ b/tests/browser/features/step_definitions/main_page_links_steps.rb @@ -3,45 +3,45 @@ Given(/^I open the main wiki URL$/) do end Then(/^I should see a link for View History$/) do - on(MainPage).view_history_link_element.should be_visible + expect(on(MainPage).view_history_link_element).to be_visible end Then(/^I should see a link for Edit$/) do - on(MainPage).edit_link_element.should be_visible + expect(on(MainPage).edit_link_element).to be_visible end Then(/^I should see a link for Recent changes$/) do - on(MainPage).recent_changes_link_element.should be_visible + expect(on(MainPage).recent_changes_link_element).to be_visible end Then(/^I should see a link for Random page$/) do - on(MainPage).random_page_link_element.should be_visible + expect(on(MainPage).random_page_link_element).to be_visible end Then(/^I should see a link for Help$/) do - on(MainPage).help_link_element.should be_visible + expect(on(MainPage).help_link_element).to be_visible end Then(/^I should see a link for What links here$/) do - on(MainPage).what_links_here_link_element.should be_visible + expect(on(MainPage).what_links_here_link_element).to be_visible end Then(/^I should see a link for Related changes$/) do - on(MainPage).related_changes_link_element.should be_visible + expect(on(MainPage).related_changes_link_element).to be_visible end Then(/^I should see a link for Special pages$/) do - on(MainPage).special_pages_link_element.should be_visible + expect(on(MainPage).special_pages_link_element).to be_visible end Then(/^I should see a link for Printable version$/) do - on(MainPage).printable_version_link_element.should be_visible + expect(on(MainPage).printable_version_link_element).to be_visible end Then(/^I should see a link for Permanent link$/) do - on(MainPage).permanent_link_link_element.should be_visible + expect(on(MainPage).permanent_link_link_element).to be_visible end Then(/^I should see a link for Page information$/) do - on(MainPage).page_information_link_element.should be_visible + expect(on(MainPage).page_information_link_element).to be_visible end diff --git a/tests/browser/features/step_definitions/preferences_appearance_steps.rb b/tests/browser/features/step_definitions/preferences_appearance_steps.rb index 0046af69..133eec3b 100644 --- a/tests/browser/features/step_definitions/preferences_appearance_steps.rb +++ b/tests/browser/features/step_definitions/preferences_appearance_steps.rb @@ -18,68 +18,66 @@ When(/^I navigate to Preferences$/) do end Then(/^I can click Save$/) do - on(PreferencesPage).save_button_element.should exist + expect(on(PreferencesPage).save_button_element).to exist end Then(/^I can restore default settings$/) do - on(PreferencesAppearancePage).restore_default_link_element.should exist + expect(on(PreferencesAppearancePage).restore_default_link_element).to exist end Then(/^I can see local time$/) do - on(PreferencesAppearancePage).local_time_span_element.should exist + expect(on(PreferencesAppearancePage).local_time_span_element).to exist end Then(/^I can see time offset section$/) do - on(PreferencesAppearancePage).time_offset_table_element.should be_visible + expect(on(PreferencesAppearancePage).time_offset_table_element).to be_visible end Then(/^I can select date format$/) do on(PreferencesAppearancePage) do |page| - page.no_preference_radio_element.should exist - page.mo_day_year_radio_element.should exist - page.day_mo_year_radio_element.should exist - page.year_mo_day_radio_element.should exist - page.iso_8601_radio_element.should exist + expect(page.no_preference_radio_element).to exist + expect(page.mo_day_year_radio_element).to exist + expect(page.day_mo_year_radio_element).to exist + expect(page.year_mo_day_radio_element).to exist + expect(page.iso_8601_radio_element).to exist end end Then(/^I can select image size$/) do - on(PreferencesAppearancePage).size_select_element.should exist + expect(on(PreferencesAppearancePage).size_select_element).to exist end Then(/^I can select my time zone$/) do on(PreferencesAppearancePage) do |page| - page.time_offset_select_element.should exist - page.other_offset_element.should exist + expect(page.time_offset_select_element).to exist + expect(page.other_offset_element).to exist end end Then(/^I can select skins$/) do on(PreferencesAppearancePage) do |page| - page.cologne_blue_element.should exist - page.modern_element.should exist - page.monobook_element.should exist - page.vector_element.should exist + expect(page.cologne_blue_element).to exist + expect(page.modern_element).to exist + expect(page.monobook_element).to exist + expect(page.vector_element).to exist end end Then(/^I can select Threshold for stub link$/) do - on(PreferencesAppearancePage).threshold_select_element.should exist + expect(on(PreferencesAppearancePage).threshold_select_element).to exist end Then(/^I can select thumbnail size$/) do - on(PreferencesAppearancePage).thumb_select_element.should exist + expect(on(PreferencesAppearancePage).thumb_select_element).to exist end Then(/^I can select underline preferences$/) do - on(PreferencesAppearancePage).underline_select_element.should exist + expect(on(PreferencesAppearancePage).underline_select_element).to exist end Then(/^I have advanced options checkboxes$/) do on(PreferencesAppearancePage) do |page| - page.hidden_categories_check_element.should exist - page.auto_number_check_element.should exist + expect(page.hidden_categories_check_element).to exist + expect(page.auto_number_check_element).to exist end end - - diff --git a/tests/browser/features/step_definitions/preferences_editing_steps.rb b/tests/browser/features/step_definitions/preferences_editing_steps.rb index ad29a745..0a98e889 100644 --- a/tests/browser/features/step_definitions/preferences_editing_steps.rb +++ b/tests/browser/features/step_definitions/preferences_editing_steps.rb @@ -14,41 +14,41 @@ When(/^I click Editing$/) do end Then(/^I can select edit area font style$/) do - on(PreferencesEditingPage).edit_area_font_style_select_element.when_present.should exist + expect(on(PreferencesEditingPage).edit_area_font_style_select_element.when_present).to exist end Then(/^I can select live preview$/) do - on(PreferencesEditingPage).live_preview_check_element.when_present.should exist + expect(on(PreferencesEditingPage).live_preview_check_element.when_present).to exist end Then(/^I can select section editing by double clicking$/) do - on(PreferencesEditingPage).edit_section_double_click_check_element.when_present.should exist + expect(on(PreferencesEditingPage).edit_section_double_click_check_element.when_present).to exist end Then(/^I can select section editing by right clicking$/) do - on(PreferencesEditingPage).edit_section_right_click_check_element.when_present.should exist + expect(on(PreferencesEditingPage).edit_section_right_click_check_element.when_present).to exist end Then(/^I can select section editing via edit links$/) do - on(PreferencesEditingPage).edit_section_edit_link_element.when_present.should exist + expect(on(PreferencesEditingPage).edit_section_edit_link_element.when_present).to exist end Then(/^I can select show edit toolbar$/) do - on(PreferencesEditingPage).show_edit_toolbar_check_element.when_present.should exist + expect(on(PreferencesEditingPage).show_edit_toolbar_check_element.when_present).to exist end Then(/^I can select show preview before edit box$/) do - on(PreferencesEditingPage).preview_on_top_check_element.when_present.should exist + expect(on(PreferencesEditingPage).preview_on_top_check_element.when_present).to exist end Then(/^I can select show preview on first edit$/) do - on(PreferencesEditingPage).preview_on_first_check_element.when_present.should exist + expect(on(PreferencesEditingPage).preview_on_first_check_element.when_present).to exist end Then(/^I can select to prompt me when entering a blank edit summary$/) do - on(PreferencesEditingPage).forced_edit_summary_check_element.when_present.should exist + expect(on(PreferencesEditingPage).forced_edit_summary_check_element.when_present).to exist end Then(/^I can select to warn me when I leave an edit page with unsaved changes$/) do - on(PreferencesEditingPage).unsaved_changes_check_element.when_present.should exist + expect(on(PreferencesEditingPage).unsaved_changes_check_element.when_present).to exist end diff --git a/tests/browser/features/step_definitions/preferences_user_profile_steps.rb b/tests/browser/features/step_definitions/preferences_user_profile_steps.rb index 529af66d..9c65db83 100644 --- a/tests/browser/features/step_definitions/preferences_user_profile_steps.rb +++ b/tests/browser/features/step_definitions/preferences_user_profile_steps.rb @@ -15,29 +15,28 @@ end Then(/^I can change my gender$/) do on(PreferencesUserProfilePage) do |page| - page.gender_undefined_radio_element.should exist - page.gender_male_radio_element.should exist - page.gender_female_radio_element.should exist + expect(page.gender_undefined_radio_element).to exist + expect(page.gender_male_radio_element).to exist + expect(page.gender_female_radio_element).to exist end end Then(/^I can change my language$/) do - on(PreferencesUserProfilePage).lang_select_element.should exist + expect(on(PreferencesUserProfilePage).lang_select_element).to exist end Then(/^I can change my signature$/) do - on(PreferencesUserProfilePage).signature_field_element.should exist + expect(on(PreferencesUserProfilePage).signature_field_element).to exist end Then(/^I can see my Basic informations$/) do - on(PreferencesUserProfilePage).basic_info_table_element.should exist + expect(on(PreferencesUserProfilePage).basic_info_table_element).to exist end Then(/^I can see my email$/) do - on(PreferencesUserProfilePage).email_table_element.should exist + expect(on(PreferencesUserProfilePage).email_table_element).to exist end Then(/^I can see my signature$/) do - on(PreferencesUserProfilePage).signature_table_element.should exist + expect(on(PreferencesUserProfilePage).signature_table_element).to exist end - diff --git a/tests/browser/features/step_definitions/view_history_steps.rb b/tests/browser/features/step_definitions/view_history_steps.rb index 1ecc0085..d9b93817 100644 --- a/tests/browser/features/step_definitions/view_history_steps.rb +++ b/tests/browser/features/step_definitions/view_history_steps.rb @@ -3,6 +3,5 @@ When(/^I click View History$/) do end Then(/^I should see a link to a previous version of the page$/) do - on(ViewHistoryPage).old_version_link_element.should be_visible + expect(on(ViewHistoryPage).old_version_link_element).to be_visible end - diff --git a/tests/browser/features/support/env.rb b/tests/browser/features/support/env.rb index 7c122366..5eff4ce5 100644 --- a/tests/browser/features/support/env.rb +++ b/tests/browser/features/support/env.rb @@ -1,2 +1,4 @@ -require "mediawiki_api" -require "mediawiki_selenium" +require 'mediawiki_selenium' + +require 'mediawiki_selenium/support' +require 'mediawiki_selenium/step_definitions' diff --git a/tests/browser/features/support/modules/url_module.rb b/tests/browser/features/support/modules/url_module.rb deleted file mode 100644 index 6c329e87..00000000 --- a/tests/browser/features/support/modules/url_module.rb +++ /dev/null @@ -1,10 +0,0 @@ -module URL - def self.url(name) - if ENV["MEDIAWIKI_URL"] - mediawiki_url = ENV["MEDIAWIKI_URL"] - else - mediawiki_url = "http://127.0.0.1:80/w/index.php" - end - "#{mediawiki_url}#{name}" - end -end diff --git a/tests/browser/features/support/pages/create_account_page.rb b/tests/browser/features/support/pages/create_account_page.rb index 380bccbc..98b893a6 100644 --- a/tests/browser/features/support/pages/create_account_page.rb +++ b/tests/browser/features/support/pages/create_account_page.rb @@ -12,8 +12,7 @@ class CreateAccountPage include PageObject - include URL - page_url URL.url("<%=params[:page_title]%>") + page_url '<%=params[:page_title]%>' - button(:create_account, id: "wpCreateaccount") + button(:create_account, id: 'wpCreateaccount') end diff --git a/tests/browser/features/support/pages/edit_page.rb b/tests/browser/features/support/pages/edit_page.rb index b619c342..b0f6bffe 100644 --- a/tests/browser/features/support/pages/edit_page.rb +++ b/tests/browser/features/support/pages/edit_page.rb @@ -1,8 +1,8 @@ class EditPage include PageObject - text_area(:edit_page_content, id: "wpTextbox1") - button(:preview_button, id: "wpPreview") - button(:show_changes_button, id: "wpDiff") - button(:save_button, id: "wpSave") -end
\ No newline at end of file + text_area(:edit_page_content, id: 'wpTextbox1') + button(:preview_button, id: 'wpPreview') + button(:show_changes_button, id: 'wpDiff') + button(:save_button, id: 'wpSave') +end diff --git a/tests/browser/features/support/pages/file_does_not_exist_page.rb b/tests/browser/features/support/pages/file_does_not_exist_page.rb index c8491f3b..90762d22 100644 --- a/tests/browser/features/support/pages/file_does_not_exist_page.rb +++ b/tests/browser/features/support/pages/file_does_not_exist_page.rb @@ -12,8 +12,7 @@ class FileDoesNotExistPage include PageObject - include URL - page_url URL.url("File:<%=params[:page_name]%>") + page_url 'File:<%=params[:page_name]%>' - div(:file_does_not_exist_message, id: "mw-imagepage-nofile") + div(:file_does_not_exist_message, id: 'mw-imagepage-nofile') end diff --git a/tests/browser/features/support/pages/login_error_page.rb b/tests/browser/features/support/pages/login_error_page.rb index 4fc9ca7f..9a1805f3 100644 --- a/tests/browser/features/support/pages/login_error_page.rb +++ b/tests/browser/features/support/pages/login_error_page.rb @@ -1,5 +1,5 @@ class LoginErrorPage include PageObject - div(:error_box, class: "errorbox") -end
\ No newline at end of file + div(:error_box, class: 'errorbox') +end diff --git a/tests/browser/features/support/pages/main_page.rb b/tests/browser/features/support/pages/main_page.rb index 7d96c2b2..6d76b01c 100644 --- a/tests/browser/features/support/pages/main_page.rb +++ b/tests/browser/features/support/pages/main_page.rb @@ -1,19 +1,18 @@ class MainPage include PageObject - include URL - page_url URL.url("") + page_url '' a(:edit_link, href: /action=edit/) - li(:help_link, id: "n-help") - div(:page_content, id: "content") - li(:page_information_link, id: "t-info") - li(:permanent_link_link, id: "t-permalink") + li(:help_link, id: 'n-help') + div(:page_content, id: 'content') + li(:page_information_link, id: 't-info') + li(:permanent_link_link, id: 't-permalink') a(:printable_version_link, href: /printable=yes/) - li(:random_page_link, id: "n-randompage") - li(:recent_changes_link, id: "n-recentchanges") - li(:related_changes_link, id: "t-recentchangeslinked") - li(:special_pages_link, id: "t-specialpages") + li(:random_page_link, id: 'n-randompage') + li(:recent_changes_link, id: 'n-recentchanges') + li(:related_changes_link, id: 't-recentchangeslinked') + li(:special_pages_link, id: 't-specialpages') a(:view_history_link, href: /action=history/) - li(:what_links_here_link, id: "t-whatlinkshere") -end
\ No newline at end of file + li(:what_links_here_link, id: 't-whatlinkshere') +end diff --git a/tests/browser/features/support/pages/preferences_appearance_page.rb b/tests/browser/features/support/pages/preferences_appearance_page.rb index c24e3862..83c3952f 100644 --- a/tests/browser/features/support/pages/preferences_appearance_page.rb +++ b/tests/browser/features/support/pages/preferences_appearance_page.rb @@ -12,30 +12,28 @@ class PreferencesAppearancePage include PageObject - include URL - page_url URL.url("Special:Preferences#mw-prefsection-rendering") + page_url 'Special:Preferences#mw-prefsection-rendering' - checkbox(:auto_number_check, id: "mw-input-wpnumberheadings") - radio_button(:cologne_blue, id: "mw-input-wpskin-cologneblue") - radio_button(:day_mo_year_radio, id: "mw-input-wpdate-dmy") - checkbox(:dont_show_aft_check, id: "mw-input-wparticlefeedback-disable") - checkbox(:exclude_from_experiments_check, id: "mw-input-wpvector-noexperiments") - checkbox(:hidden_categories_check, id: "mw-input-wpshowhiddencats") - radio_button(:iso_8601_radio, id: "mw-input-wpdate-ISO_8601") - span(:local_time_span, id: "wpLocalTime") - radio_button(:mo_day_year_radio, id: "mw-input-wpdate-mdy") - radio_button(:modern, id: "mw-input-wpskin-modern") - radio_button(:monobook, id: "mw-input-wpskin-monobook") - radio_button(:no_preference_radio, id: "mw-input-wpdate-default") - text_field(:other_offset, id: "mw-input-wptimecorrection-other") + checkbox(:auto_number_check, id: 'mw-input-wpnumberheadings') + radio_button(:cologne_blue, id: 'mw-input-wpskin-cologneblue') + radio_button(:day_mo_year_radio, id: 'mw-input-wpdate-dmy') + checkbox(:dont_show_aft_check, id: 'mw-input-wparticlefeedback-disable') + checkbox(:exclude_from_experiments_check, id: 'mw-input-wpvector-noexperiments') + checkbox(:hidden_categories_check, id: 'mw-input-wpshowhiddencats') + radio_button(:iso_8601_radio, id: 'mw-input-wpdate-ISO_8601') + span(:local_time_span, id: 'wpLocalTime') + radio_button(:mo_day_year_radio, id: 'mw-input-wpdate-mdy') + radio_button(:modern, id: 'mw-input-wpskin-modern') + radio_button(:monobook, id: 'mw-input-wpskin-monobook') + radio_button(:no_preference_radio, id: 'mw-input-wpdate-default') + text_field(:other_offset, id: 'mw-input-wptimecorrection-other') a(:restore_default_link, href: /reset/) - select_list(:size_select, id: "mw-input-wpimagesize") - select_list(:threshold_select, id: "mw-input-wpstubthreshold") - select_list(:time_offset_select, id: "mw-input-wptimecorrection") - table(:time_offset_table, id: "mw-htmlform-timeoffset") - select_list(:thumb_select, id: "mw-input-wpthumbsize") - select_list(:underline_select, id: "mw-input-wpunderline") - radio_button(:vector, id: "mw-input-wpskin-vector") - radio_button(:year_mo_day_radio, id: "mw-input-wpdate-ymd") + select_list(:size_select, id: 'mw-input-wpimagesize') + select_list(:threshold_select, id: 'mw-input-wpstubthreshold') + select_list(:time_offset_select, id: 'mw-input-wptimecorrection') + table(:time_offset_table, id: 'mw-htmlform-timeoffset') + select_list(:thumb_select, id: 'mw-input-wpthumbsize') + select_list(:underline_select, id: 'mw-input-wpunderline') + radio_button(:vector, id: 'mw-input-wpskin-vector') + radio_button(:year_mo_day_radio, id: 'mw-input-wpdate-ymd') end - diff --git a/tests/browser/features/support/pages/preferences_editing_page.rb b/tests/browser/features/support/pages/preferences_editing_page.rb index aed9c41d..25c384f7 100644 --- a/tests/browser/features/support/pages/preferences_editing_page.rb +++ b/tests/browser/features/support/pages/preferences_editing_page.rb @@ -12,17 +12,16 @@ class PreferencesEditingPage include PageObject - include URL - page_url URL.url("Special:Preferences#mw-prefsection-rendering") + page_url 'Special:Preferences#mw-prefsection-rendering' - select_list(:edit_area_font_style_select, id: "mw-input-wpeditfont") - checkbox(:edit_section_double_click_check, id: "mw-input-wpeditondblclick") - checkbox(:edit_section_edit_link, id: "mw-input-wpeditsectiononrightclick") - checkbox(:edit_section_right_click_check, id: "mw-input-wpeditsectiononrightclick") - checkbox(:forced_edit_summary_check, id: "mw-input-wpforceeditsummary") - checkbox(:live_preview_check, id: "mw-input-wpuselivepreview") - checkbox(:preview_on_first_check, id: "mw-input-wppreviewonfirst") - checkbox(:preview_on_top_check, id: "mw-input-wppreviewontop") - checkbox(:show_edit_toolbar_check, id: "mw-input-wpshowtoolbar") - checkbox(:unsaved_changes_check, id: "mw-input-wpuseeditwarning") + select_list(:edit_area_font_style_select, id: 'mw-input-wpeditfont') + checkbox(:edit_section_double_click_check, id: 'mw-input-wpeditondblclick') + checkbox(:edit_section_edit_link, id: 'mw-input-wpeditsectiononrightclick') + checkbox(:edit_section_right_click_check, id: 'mw-input-wpeditsectiononrightclick') + checkbox(:forced_edit_summary_check, id: 'mw-input-wpforceeditsummary') + checkbox(:live_preview_check, id: 'mw-input-wpuselivepreview') + checkbox(:preview_on_first_check, id: 'mw-input-wppreviewonfirst') + checkbox(:preview_on_top_check, id: 'mw-input-wppreviewontop') + checkbox(:show_edit_toolbar_check, id: 'mw-input-wpshowtoolbar') + checkbox(:unsaved_changes_check, id: 'mw-input-wpuseeditwarning') end diff --git a/tests/browser/features/support/pages/preferences_page.rb b/tests/browser/features/support/pages/preferences_page.rb index 919ba27f..b305ee2c 100644 --- a/tests/browser/features/support/pages/preferences_page.rb +++ b/tests/browser/features/support/pages/preferences_page.rb @@ -12,11 +12,10 @@ class PreferencesPage include PageObject - include URL - page_url URL.url("Special:Preferences") + page_url 'Special:Preferences' - a(:appearance_link, id: "preftab-rendering") - a(:editing_link, id: "preftab-editing") - a(:user_profile_link, id: "preftab-personal") - button(:save_button, id: "prefcontrol") + a(:appearance_link, id: 'preftab-rendering') + a(:editing_link, id: 'preftab-editing') + a(:user_profile_link, id: 'preftab-personal') + button(:save_button, id: 'prefcontrol') end diff --git a/tests/browser/features/support/pages/preferences_user_profile_page.rb b/tests/browser/features/support/pages/preferences_user_profile_page.rb index 28e10b97..9e95eb5a 100644 --- a/tests/browser/features/support/pages/preferences_user_profile_page.rb +++ b/tests/browser/features/support/pages/preferences_user_profile_page.rb @@ -12,17 +12,16 @@ class PreferencesUserProfilePage include PageObject - include URL - page_url URL.url("Special:Preferences#mw-prefsection-personal") + page_url 'Special:Preferences#mw-prefsection-personal' - table(:basic_info_table, id: "mw-htmlform-info") - link(:change_password_link, text: "Change password") - table(:email_table, id: "mw-htmlform-email") - radio_button(:gender_female_radio, id: "mw-input-wpgender-male") - radio_button(:gender_male_radio, id: "mw-input-wpgender-female") - radio_button(:gender_undefined_radio, id: "mw-input-wpgender-unknown") - select_list(:lang_select, id: "mw-input-wplanguage") - checkbox(:remember_password_check, id: "mw-input-wprememberpassword") - text_field(:signature_field, id: "mw-input-wpnickname") - table(:signature_table, id: "mw-htmlform-signature") + table(:basic_info_table, id: 'mw-htmlform-info') + link(:change_password_link, text: 'Change password') + table(:email_table, id: 'mw-htmlform-email') + radio_button(:gender_female_radio, id: 'mw-input-wpgender-male') + radio_button(:gender_male_radio, id: 'mw-input-wpgender-female') + radio_button(:gender_undefined_radio, id: 'mw-input-wpgender-unknown') + select_list(:lang_select, id: 'mw-input-wplanguage') + checkbox(:remember_password_check, id: 'mw-input-wprememberpassword') + text_field(:signature_field, id: 'mw-input-wpnickname') + table(:signature_table, id: 'mw-htmlform-signature') end diff --git a/tests/browser/features/support/pages/view_history_page.rb b/tests/browser/features/support/pages/view_history_page.rb index 66895986..bb9c5862 100644 --- a/tests/browser/features/support/pages/view_history_page.rb +++ b/tests/browser/features/support/pages/view_history_page.rb @@ -3,5 +3,4 @@ class ViewHistoryPage a(:view_history_link, href: /action=history/) a(:old_version_link, href: /oldid=/) - -end
\ No newline at end of file +end diff --git a/tests/browser/features/support/pages/ztargetpage.rb b/tests/browser/features/support/pages/ztargetpage.rb index c1f46eca..da789e5e 100644 --- a/tests/browser/features/support/pages/ztargetpage.rb +++ b/tests/browser/features/support/pages/ztargetpage.rb @@ -1,7 +1,7 @@ class ZtargetPage < MainPage - include URL - page_url URL.url("<%=params[:article_name]%>") include PageObject - a(:link_target_page_link, text: "link to the test target page") -end
\ No newline at end of file + page_url '<%=params[:article_name]%>' + + a(:link_target_page_link, text: 'link to the test target page') +end diff --git a/tests/parser/ParserTestResult.php b/tests/parser/ParserTestResult.php index 7d9415a2..a7b36721 100644 --- a/tests/parser/ParserTestResult.php +++ b/tests/parser/ParserTestResult.php @@ -1,10 +1,9 @@ <?php /** + * @file + * * @copyright Copyright © 2013, Antoine Musso * @copyright Copyright © 2013, Wikimedia Foundation Inc. - * @license GNU GPL v2 - * - * @file */ /** diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index a9df6832..1cffa20c 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -559,7 +559,7 @@ class ParserTest { $parser->setTransparentTagHook( $tag, $callback ); } - wfRunHooks( 'ParserTestParser', array( &$parser ) ); + Hooks::run( 'ParserTestParser', array( &$parser ) ); return $parser; } @@ -593,6 +593,14 @@ class ParserTest { } } + if ( isset( $opts['tidy'] ) ) { + if ( !$this->tidySupport->isEnabled() ) { + return $this->showSkipped(); + } else { + $options->setTidy( true ); + } + } + if ( isset( $opts['title'] ) ) { $titleText = $opts['title']; } else { @@ -624,10 +632,6 @@ class ParserTest { $output->setTOCEnabled( !isset( $opts['notoc'] ) ); $out = $output->getText(); if ( isset( $opts['tidy'] ) ) { - if ( !$this->tidySupport->isEnabled() ) { - return $this->showSkipped(); - } - $out = MWTidy::tidy( $out ); $out = preg_replace( '/\s+$/', '', $out ); } @@ -639,6 +643,14 @@ class ParserTest { $out = "$title\n$out"; } + if ( isset( $opts['showindicators'] ) ) { + $indicators = ''; + foreach ( $output->getIndicators() as $id => $content ) { + $indicators .= "$id=$content\n"; + } + $out = $indicators . $out; + } + if ( isset( $opts['ill'] ) ) { $out = implode( ' ', $output->getLanguageLinks() ); } elseif ( isset( $opts['cat'] ) ) { @@ -877,10 +889,7 @@ class ParserTest { 'wgDisableLangConversion' => false, 'wgDisableTitleConversion' => false, // Tidy options. - // We always set 'wgUseTidy' to false when parsing, but certain - // test-running modes still use tidy if available, so ensure - // that the tidy-related options are all set to their defaults. - 'wgUseTidy' => false, + 'wgUseTidy' => isset( $opts['tidy'] ), 'wgAlwaysUseTidy' => false, 'wgDebugTidy' => false, 'wgTidyConf' => $IP . '/includes/tidy.conf', @@ -901,7 +910,7 @@ class ParserTest { $this->savedGlobals = array(); /** @since 1.20 */ - wfRunHooks( 'ParserTestGlobals', array( &$settings ) ); + Hooks::run( 'ParserTestGlobals', array( &$settings ) ); foreach ( $settings as $var => $val ) { if ( array_key_exists( $var, $GLOBALS ) ) { @@ -941,7 +950,7 @@ class ParserTest { $tables = array( 'user', 'user_properties', 'user_former_groups', 'page', 'page_restrictions', 'protected_titles', 'revision', 'text', 'pagelinks', 'imagelinks', 'categorylinks', 'templatelinks', 'externallinks', 'langlinks', 'iwlinks', - 'site_stats', 'hitcounter', 'ipblocks', 'image', 'oldimage', + 'site_stats', 'ipblocks', 'image', 'oldimage', 'recentchanges', 'watchlist', 'interwiki', 'logging', 'querycache', 'objectcache', 'job', 'l10n_cache', 'redirect', 'querycachetwo', 'archive', 'user_groups', 'page_props', 'category', 'msg_resource', 'msg_resource_links' @@ -954,7 +963,7 @@ class ParserTest { // Allow extensions to add to the list of tables to duplicate; // may be necessary if they hook into page save or other code // which will require them while running tests. - wfRunHooks( 'ParserTestTables', array( &$tables ) ); + Hooks::run( 'ParserTestTables', array( &$tables ) ); return $tables; } @@ -1493,8 +1502,10 @@ class ParserTest { * Insert a temporary test article * @param string $name The title, including any prefix * @param string $text The article text - * @param int $line The input line number, for reporting errors - * @param bool $ignoreDuplicate Whether to silently ignore duplicate pages + * @param int|string $line The input line number, for reporting errors + * @param bool|string $ignoreDuplicate Whether to silently ignore duplicate pages + * @throws Exception + * @throws MWException */ public static function addArticle( $name, $text, $line = 'unknown', $ignoreDuplicate = '' ) { global $wgCapitalLinks; diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index f915922f..e9653529 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -16,7 +16,7 @@ # cat add category links # ill add inter-language links # subpage enable subpages (disabled by default) -# noxml don't check for XML well formdness +# noxml don't check for XML well-formedness # title=[[XXX]] run test using article title XXX # language=XXX set content language to XXX for this test # variant=XXX set the variant of language for this test (eg zh-tw) @@ -26,6 +26,7 @@ # php php-only test (not run by the parsoid parser unless # the test includes an html/parsoid section) # showtitle make the first line the title +# showindicators make the first lines the page status indicators # comment run through Linker::formatComment() instead of main parser # local format section links in edit comment text as local links # notoc disable table of contents @@ -69,6 +70,12 @@ Template:pipe | !! endarticle +!! article +Template:= +!! text +<nowiki>=</nowiki> +!! endarticle + !!article MediaWiki:bad image list !!text @@ -112,22 +119,50 @@ Template:echo_with_div !! endarticle !! article -Template:attr_str +Template:table_attribs !! text -{{{1}}}="{{{2}}}" +<noinclude> +|</noinclude>style="color:red;"|Foo !! endarticle !! article -Template:table_attribs +Template:table_attribs_2 +!! text +<noinclude> +|</noinclude>style="color:red;"|Foo +|Bar||Baz +!! endarticle + +!! article +Template:table_attribs_3 +!! text +<noinclude> +|</noinclude>style{{=}}"background:#f9f9f9;"|Foo +!! endarticle + +!! article +Template:table_attribs_4 +!! text +| style="background-color:#DC241f;" width="10px" | +!! endarticle + +!! article +Template:table_attribs_5 !! text <noinclude> -|</noinclude>style="color: red"| Foo +|</noinclude>style="color:red;"||Bar +!! endarticle + +!! article +Template:table_header_cells +!! text +{{table_attribs}}!!style='color:red;'|''Bar''||style='color:brown;'|''Foo'' and Baz !! endarticle !! article Template:table_cells !! text -{{table_attribs}} || Bar || Baz +{{table_attribs}}||style='color:red;'|''Bar''||style='color:brown;'|''Foo'' and Baz !! endarticle !! article @@ -137,6 +172,22 @@ Template:image_attribs [[File:foobar.jpg|</noinclude>right|Caption text<noinclude>]]</noinclude> !! endarticle +## See T48811 for details +!! article +Template:mixed_attr_content_template +!! text +style="color:red;" title="T48811" +|- +|foo +!! endarticle + +!! article +Template:definition_list +!! text +one +::two +!! endarticle + !! article A?b !! text @@ -155,6 +206,39 @@ Template:OpenTable {| !!endarticle +!!article +Template:EmptyLITest +!!text +*a +* +* +*b +!!endarticle + +!!article +Template:EmptyTRTest +!!text +{| +|- +|- +|foo +|- +|- +|bar +|} +!!endarticle + +!!article +Template:EmptyTRWithHTMLAttrTest +!!text +<table> +<tr align="center"></tr> +<tr><td>foo</td></tr> +<tr align="center"></tr> +<tr><td>bar</td></tr> +</table> +!!endarticle + ### ### Basic tests ### @@ -505,11 +589,8 @@ Italics and bold: 2-quote opening sequence: (2,2) </p> !!end - !! test Italics and bold: 2-quote opening sequence: (2,3) -!! options -parsoid=wt2html !! wikitext ''foo''' !! html/* @@ -517,18 +598,6 @@ parsoid=wt2html </p> !!end - -# same html as previous, but wikitext adjusted to match parsoid html2wt -!! test -Italics and bold: 2-quote opening sequence: (2,3) w/ nowiki -!! wikitext -''<nowiki>foo'</nowiki>'' -!! html -<p><i>foo'</i> -</p> -!! end - - !! test Italics and bold: 2-quote opening sequence: (2,4) !! options @@ -540,18 +609,16 @@ parsoid=wt2html </p> !!end - # same html as previous, but wikitext adjusted to match parsoid html2wt !! test Italics and bold: 2-quote opening sequence: (2,4) w/ nowiki !! wikitext -''<nowiki>foo''</nowiki>'' +''foo<nowiki>''</nowiki>'' !! html <p><i>foo''</i> </p> !! end - # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: 2-quote opening sequence: (2,5) @@ -589,12 +656,11 @@ Italics and bold: 2-quote opening sequence: (2,5+3) w/ nowiki Italics and bold: 3-quote opening sequence: (3,2) !! wikitext '''foo'' -!! html +!! html/* <p>'<i>foo</i> </p> !!end - !! test Italics and bold: 3-quote opening sequence: (3,3) !! wikitext @@ -604,11 +670,8 @@ Italics and bold: 3-quote opening sequence: (3,3) </p> !!end - !! test Italics and bold: 3-quote opening sequence: (3,4) -!! options -parsoid=wt2html !! wikitext '''foo'''' !! html/* @@ -616,18 +679,6 @@ parsoid=wt2html </p> !!end - -# same html as previous, but wikitext adjusted to match parsoid html2wt -!! test -Italics and bold: 3-quote opening sequence: (3,4) w/ nowiki -!! wikitext -'''<nowiki>foo'</nowiki>''' -!! html -<p><b>foo'</b> -</p> -!! end - - # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: 3-quote opening sequence: (3,5) @@ -672,7 +723,6 @@ parsoid=wt2html </p> !!end - # same html as previous, but wikitext adjusted to match parsoid html2wt !! test Italics and bold: 4-quote opening sequence: (4,2) w/ nowiki @@ -683,17 +733,15 @@ Italics and bold: 4-quote opening sequence: (4,2) w/ nowiki </p> !! end - !! test Italics and bold: 4-quote opening sequence: (4,3) !! wikitext ''''foo''' -!! html +!! html/* <p>'<b>foo</b> </p> !!end - !! test Italics and bold: 4-quote opening sequence: (4,4) !! options @@ -705,18 +753,16 @@ parsoid=wt2html </p> !!end - # same html as previous, but wikitext adjusted to match parsoid html2wt !! test Italics and bold: 4-quote opening sequence: (4,4) w/ nowiki !! wikitext -''''<nowiki>foo'</nowiki>''' +'<nowiki/>'''foo'''' !! html <p>'<b>foo'</b> </p> !! end - # The PHP parser strips the empty tags out for giggles; parsoid doesn't. !! test Italics and bold: 4-quote opening sequence: (4,5) @@ -736,7 +782,7 @@ parsoid=wt2html !! test Italics and bold: 4-quote opening sequence: (4,5+2) w/ nowiki !! wikitext -''''foo'''''<nowiki/>'' +'<nowiki/>'''foo'''''<nowiki/>'' !! html/php <p>'<b>foo</b> </p> @@ -761,7 +807,6 @@ parsoid=wt2html </p> !!end - # same html as previous, but wikitext adjusted to match parsoid html2wt # skipping wt2html and html2html because it wants to put <i> before <b> !! test @@ -786,7 +831,6 @@ parsoid=wt2html </p> !!end - # same html as previous, but wikitext adjusted to match parsoid html2wt !! test Italics and bold: 5-quote opening sequence: (5,3+2) @@ -797,7 +841,6 @@ Italics and bold: 5-quote opening sequence: (5,3+2) </p> !! end - !! test Italics and bold: 5-quote opening sequence: (5,4) !! options @@ -809,18 +852,6 @@ parsoid=wt2html </p> !!end - -# same html as previous, but wikitext adjusted to match parsoid html2wt -!! test -Italics and bold: 5-quote opening sequence: (5,4+2) w/ nowiki -!! wikitext -'''''<nowiki>foo'</nowiki>''''' -!! html -<p><i><b>foo'</b></i> -</p> -!! end - - !! test Italics and bold: 5-quote opening sequence: (5,5) !! wikitext @@ -830,6 +861,15 @@ Italics and bold: 5-quote opening sequence: (5,5) </p> !!end +!! test +Italics and bold: 5-quote opening sequence: (5,6) +!! wikitext +'''''foo'''''' +!! html/* +<p><i><b>foo'</b></i> +</p> +!! end + ### ### multiple quote sequences in a line ### @@ -849,7 +889,7 @@ parsoid=wt2html !! test Italics and bold: multiple quote sequences: (2,4,2+3) w/ nowiki !! wikitext -''<nowiki>foo'</nowiki>'''bar''''' +''foo'<nowiki/>'''bar''''' !! html <p><i>foo'<b>bar</b></i> </p> @@ -872,7 +912,7 @@ parsoid=wt2html !! test Italics and bold: multiple quote sequences: (2,4,3+2) w/ nowiki !! wikitext -''<nowiki>foo'</nowiki>'''bar''''' +''foo'<nowiki/>'''bar''''' !! html <p><i>foo'<b>bar</b></i> </p> @@ -895,7 +935,7 @@ parsoid=wt2html !! test Italics and bold: multiple quote sequences: (2,4,4+2) w/ nowiki !! wikitext -''<nowiki>foo'</nowiki>'''<nowiki>bar'</nowiki>''''' +''foo'<nowiki/>'''bar'<nowiki/>''''' !! html <p><i>foo'<b>bar'</b></i> </p> @@ -997,14 +1037,11 @@ parsoid=wt2html # same html as previous, but wikitext adjusted to match parsoid html2wt -# add 'parsoid' option to use 'parsoid' normalization of the placeholder !! test Italics and bold: other quote tests: (3,2,3+2+2,2) -!! options -parsoid !! wikitext '''this is about ''foo'''''<nowiki/>''s family'' -!! html/* +!! html <p><b>this is about <i>foo</i></b><i>s family</i> </p> !! end @@ -1012,10 +1049,9 @@ parsoid !! test Italics and bold: other quote tests: (3,2,3,3) -!! options !! wikitext '''this is about ''foo'''s family''' -!! html +!! html/* <p>'<i>this is about </i>foo<b>s family</b> </p> !!end @@ -1035,9 +1071,11 @@ Italics and bold: other quote tests: (3,(2,2),3) Italicized possessive !! wikitext The ''[[Main Page]]'''s talk page. -!! html +!! html/php <p>The <i><a href="/wiki/Main_Page" title="Main Page">Main Page</a>'</i>s talk page. </p> +!! html/parsoid +<p>The <i><a rel="mw:WikiLink" href="Main_Page" title="Main Page">Main Page</a>'</i>s talk page.</p> !! end !! test @@ -1201,38 +1239,84 @@ Ruby markup (W3C-style) </p> !! end -# There is a tidy bug here: http://sourceforge.net/p/tidy/bugs/946/ +# The next two test different paths in the sanitizer. !! test Non-word characters don't terminate tag names (bug 17663, 40670, 52022) !! wikitext -<b→> doesn't work! </b→> +<blockquote|>a</blockquote> + +<b→> doesn't terminate </b→> -<bä> doesn't work! </bä> +<bä> doesn't terminate </bä> -<boo> works fine </boo> +<boo> doesn't terminate </boo> -<s.foo>s.foo</s.foo> +<s.foo> doesn't terminate </s.foo> <sub-ID#1> !! html -<p><b→> doesn't work! </b→> -</p><p><bä> doesn't work! </bä> -</p><p><boo> works fine </boo> -</p><p><s.foo>s.foo</s.foo> +<p><blockquote|>a</blockquote> +</p><p><b→> doesn't terminate </b→> +</p><p><bä> doesn't terminate </bä> +</p><p><boo> doesn't terminate </boo> +</p><p><s.foo> doesn't terminate </s.foo> </p><p><sub-ID#1> </p> !! end +# There is a tidy bug here: http://sourceforge.net/p/tidy/bugs/946/ +# If the non-word-character tag made it through the sanitizer, tidy +# would munge it up. +!! test +Non-word characters don't terminate tag names + tidy +!! wikitext +<blockquote|>a</blockquote> + +<b→> doesn't terminate </b→> + +<bä> doesn't terminate </bä> + +<boo> doesn't terminate </boo> + +<s.foo> doesn't terminate </s.foo> + +<sub-ID#1> +!! html+tidy +<p><blockquote|>a</p> +<p><b→> doesn't terminate </b→></p> +<p><bä> doesn't terminate </bä></p> +<p><boo> doesn't terminate </boo></p> +<p><s.foo> doesn't terminate </s.foo></p> +<p><sub-ID#1></p> +!! end + +### +### See tests/parser/parserTestsParserHook.php for the <tåg> extension) +### This checks that HTML5 tags (with non-word characters in the tag +### name) make it safely through the parser -- the Sanitizer will +### munge them later, as it should. +### +!! test +Non-word characters are valid in extension tags (T19663) +!! wikitext +<tåg>tåg</tåg> +!! html +<pre> +'tåg' +array ( +) +</pre> + +!! end + !! test Isolated close tags should be treated as literal text (bug 52760) !! wikitext </b> <s.foo>s</s> -!! html -<p></b> -</p><p><s.foo>s</s> -</p> +!! html+tidy +<p><s.foo>s</p> !! end ### @@ -1328,18 +1412,75 @@ parsoid !! wikitext {{echo|–}} !! html -<p><span typeof="mw:Transclusion mw:Entity" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&ndash;"}},"i":0}}]}'>–</span> -</p> +<p><span typeof="mw:Transclusion mw:Entity" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&ndash;"}},"i":0}}]}'>–</span></p> !! end !! test Properly escape nowiki when combined with other wiki markup !! options parsoid=html2wt +!! html +<p>* </nowiki> tag</p> !! wikitext <nowiki>* </nowiki></nowiki> tag +!! end + +!! test +T71950: 1. Put nowiki as close to cause as possible, even with non-quote escapable chars +!! options +parsoid=html2wt !! html -<p>* </nowiki> tag</p> +<p>This text: L'<a rel="mw:WikiLink" href="./Foo">Foo</a> +This text: L''<a rel="mw:WikiLink" href="./Foo">Foo</a> +This text: L'''<a rel="mw:WikiLink" href="./Foo">Foo</a>''</p> +!! wikitext +This text: L'[[Foo]] +This text: L<nowiki>''</nowiki>[[Foo]] +This text: L<nowiki>'''</nowiki>[[Foo]]<nowiki>''</nowiki> +!! end + +# This test fails because wikitext whitespace is not normalized before comparing. +!! test +T71950: 2. Put nowiki as close to cause as possible, after ' :' +!! options +parsoid=html2wt +!! html +<p>This text : L''<a rel="mw:WikiLink" href="./Foo">Foo</a> +</p> +!! wikitext +This text : L<nowiki>''</nowiki>[[Foo]] +!! end + +# This test and the next one are html2wt only as they test that incorrect wikitext +# passed in template arguments gets escaped or wrapped in nowikis where required. +!! test +T71482: Use {{!}} instead of nowiki for single pipe in template argument +!! options +parsoid=html2wt +!! html/parsoid +<p><span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo|bar"}},"i":0}}]}" about="#mwt1"></span> +<span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo|bar |[["}},"i":0}}]}" about="#mwt2"></p> +!! wikitext +{{echo|foo{{!}}bar}} +{{echo|<nowiki>foo|bar |[[</nowiki>}} +!! end + +!! test +T53961: Output correct nowikis in template arguments +!! options +parsoid=html2wt +!! html/parsoid +<p><span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a [ b"}},"i":0}}]}" about="#mwt1"></span> +<span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a }} b"}},"i":0}}]}" about="#mwt2"></span> +<span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a [[ b"}},"i":0}}]}" about="#mwt3"></span> +<span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a | {{ ]]"}},"i":0}}]}" about="#mwt4"></span> +<span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a }"}},"i":0}}]}" about="#mwt5"></span></p> +!! wikitext +{{echo|a [ b}} +{{echo|a <nowiki>}}</nowiki> b}} +{{echo|<nowiki>a [[ b</nowiki>}} +{{echo|a {{!}} <nowiki>{{ ]]</nowiki>}} +{{echo|a <nowiki>}</nowiki>}} !! end ### @@ -1488,6 +1629,19 @@ Comment semantics: unclosed comment at end !! end +# Bug 58184: document parsoid's behaviour +!! test +Suppress comment closing tag in lenient browsers +!! options +parsoid=wt2html,html2html +!! wikitext +<!-- Browsers--!> think this is closed --> +!! html/php + +!! html/parsoid +<!-- Browsers--¡> think this is closed --> +!! end + !! test Comment in template title !! wikitext @@ -1649,6 +1803,11 @@ x <div>foo</div> z <p>z</p> !! end +# Tidy strips out the empty <div> tags. Parsoid doesn't. +# So, we have a separate section for Parsoid. We don't want +# to mimic this stripping behavior in Parsoid. It affects +# editing experience and also requires us to maintain additional +# info for RT-ing. !! test Empty lines between lines with block tags !! wikitext @@ -1687,10 +1846,22 @@ b <p>d</p> <p><br /></p> <div>e</div> +!! html/parsoid +<div data-parsoid='{"stx":"html"}'></div> + +<p><br /></p> +<div data-parsoid='{"stx":"html"}'></div><p>a</p> + +<p>b</p> +<div data-parsoid='{"stx":"html"}'>a</div><p>b</p> + +<div data-parsoid='{"stx":"html"}'>b</div><p>d</p> + +<p><br /></p> +<div data-parsoid='{"stx":"html"}'>e</div> !! end ## PHP parser emits output which is broken -## XXX The parsoid output doesn't match the tidy output. !! test Unclosed HTML p-tags should be handled properly !! wikitext @@ -1700,15 +1871,42 @@ a b !! html/php+tidy <div> -<p>foo</div></p> +<p>foo</p> +</div> <p>a</p> -b</div> +<p>b</p> !! html/parsoid <div data-parsoid='{"stx":"html"}'><p data-parsoid='{"stx":"html", "autoInsertedEnd":true}'>foo</p></div> <p>a</p> <p>b</p> !! end +## SSS FIXME: I can come up with other scenarios where this doesn't work because +## of eager output of buffered tokens in the p-wrapper. But, I'm going to ignore +## them for now. +!! test +1. P-wrapping should leave sol-transparent tags outside p-tags where possible +!! options +parsoid=wt2html +!! wikitext +a [[Category:A1]] [[Category:A2]] +[[Category:A3]] +[[Category:A4]] +!! html/parsoid +<p>a</p> +<link href="Category:A1"/> <link href="Category:A2"/> <link href="Category:A3"/> <link href="Category:A4"/> +!! end + +!! test +2. P-wrapping should leave sol-transparent tags outside p-tags where possible +!! options +parsoid=wt2html +!! wikitext +[[Category:A1]]a +!! html/parsoid +<link href="Category:A1"/><p>a</p> +!! end + ### ### Preformatted text ### @@ -1966,8 +2164,11 @@ Entities inside <pre> </p> !! end +# Parsoid doesn't strip empty tags, like Tidy does. !! test Empty pre; pre inside other HTML tags (bug 54946) +!! options +parsoid=wt2html,wt2wt !! wikitext a @@ -1975,7 +2176,7 @@ a foo </pre></div> <pre></pre> -!! html +!! html/php <p>a </p> <div><pre> @@ -1983,12 +2184,18 @@ foo </pre></div> <pre></pre> -!! html+tidy +!! html/php+tidy <p>a</p> <div> <pre> foo </pre></div> +!! html/parsoid +<p>a</p> + +<div><pre>foo +</pre></div> +<pre></pre> !! end !! test @@ -2156,10 +2363,11 @@ parsoid=wt2html <table><pre></pre></table> !! html/parsoid -<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<pre <pre>x</pre>"}},"i":0}}]}'><pre </span> -<pre>x</pre> +<pre about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"a":{"<pre":null},"sa":{"<pre":""},"stx":"html","pi":[[{"k":"1","spc":["","","",""]}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<pre <pre>x</pre>"}},"i":0}}]}'>x</pre> + + +<p><pre </p> -<span><pre </span> <table></table> !! end @@ -2335,6 +2543,41 @@ Templates: Handle comments in the target <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p> !!end +!! test +Templates: Handle comments in parameter names (bug 67657) +!! wikitext +{{echo|1 +<!-- should be ignored --> +=foo}} + +{{echo| +<!-- should be ignored --> +1 = foo}} + +{{echo|1<!-- should be ignored --> = foo}} + +{{echo|<!-- should be ignored -->1 = foo}} +!!html/parsoid +<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"1\n<!-- should be ignored -->"}}},"i":0}}]}'>foo</p> + +<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"<!-- should be ignored -->\n1"}}},"i":0}}]}'>foo</p> + +<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"1<!-- should be ignored -->"}}},"i":0}}]}'>foo</p> + +<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"<!-- should be ignored -->1"}}},"i":0}}]}'>foo</p> +!!end + +!! test +Templates: Other wikitext in parameter names (bug 67657) +!! wikitext +{{echo|''1''=foo}} +!!html/parsoid +<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"''1''":{"wt":"foo"}},"i":0}}]}'>{{{1}}}</p> +!!html/php +<p>{{{1}}} +</p> +!!end + #-------------------------------------------------------------------- # Transclusion parameter escaping tests #-------------------------------------------------------------------- @@ -2431,6 +2674,18 @@ parsoid <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a : b"}},"i":0}}]}'>a<span typeof="mw:Placeholder" data-parsoid='{"isDisplayHack":true}'> </span>: b</p> !! end +## Bug T73412 +!! test +Templates: Preserve blank parameter names +!! wikitext +{{echo|=foo}} +!! html/php +<p>{{{1}}} +</p> +!! html/parsoid +<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"":{"wt":"foo"}},"i":0}}]}'>{{{1}}}</p> +!! end + ### ### Parsoid-centric tests for testing RT edge cases for pre ### @@ -2559,12 +2814,8 @@ c !! html/parsoid <pre>a</pre> - -<table> - -<tbody> -<tr> -<td> b</td></tr> + <table> + <tbody><tr><td> b</td></tr> </tbody></table> !!end @@ -2613,6 +2864,12 @@ a c <blockquote> foo </blockquote> <pre><span> foo </span> </pre> +!! html/parsoid + <p>a </p><p data-parsoid='{"stx":"html"}'> foo </p> + <p>b </p><div data-parsoid='{"stx":"html"}'> foo </div> + <p>c </p><blockquote data-parsoid='{"stx":"html"}'> foo </blockquote> +<pre><span> foo </span> +</pre> !! html+tidy <p>a</p> <p>foo</p> @@ -2637,6 +2894,9 @@ a </pre> b <div> foo </div> +!! html/parsoid +<pre>a <span data-parsoid='{"stx":"html"}'>foo</span></pre> + b <div data-parsoid='{"stx":"html"}'> foo </div> !! html+tidy <pre> a <span>foo</span> @@ -2718,7 +2978,7 @@ File:foobar.jpg !! html a <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="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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> @@ -2730,7 +2990,7 @@ File:foobar.jpg <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="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div> +<div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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> @@ -2878,8 +3138,7 @@ parsoid=wt2html,wt2wt {{echo| [[Category:foo]]}} <!-- No pre-wrapping --> !! html <link rel="mw:PageProp/Category" href="./Category:Foo"> <!-- No pre-wrapping --> -<span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" [[Category:foo]]"}},"i":0}}]}'> </span> -<link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1"> <!-- No pre-wrapping --> +<span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" [[Category:foo]]"}},"i":0}}]}'> </span><link rel="mw:PageProp/Category" href="./Category:Foo" about="#mwt1"> <!-- No pre-wrapping --> !! end !! test @@ -2892,7 +3151,6 @@ parsoid=wt2html,wt2wt !! html <pre> <link rel="mw:PageProp/Category" href="./Category:Foo"> a - <link rel="mw:PageProp/Category" href="./Category:Foo"> <span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b"}},"i":0}}]}'>b</span></pre> !! end @@ -3110,10 +3368,12 @@ Definition list with wikilink containing colon Definition list with news link containing colon !! wikitext ; news:alt.wikipedia.rox: This isn't even a real newsgroup! -!! html +!! 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" href="news:alt.wikipedia.rox" data-parsoid='{"stx":"url"}'>news:alt.wikipedia.rox</a></dt><dd data-parsoid='{"stx":"row"}'> This isn't even a real newsgroup!</dd></dl> !! end !! test @@ -3803,7 +4063,7 @@ Definition Lists: Weird Ones: Test 1 <dl> <dt> <dl> -<dt> foo<span typeof="mw:Placeholder" data-parsoid='{"src":" "}'> </span></dt> +<dt> foo<span typeof="mw:Placeholder"> </span></dt> <dd data-parsoid='{"stx":"row"}'> bar (who uses this?)</dd> </dl></dt> </dl></dd> @@ -3815,6 +4075,122 @@ Definition Lists: Weird Ones: Test 1 </ul> !! end +!! test +Definition Lists: colons occurring in tags +!! wikitext +;a:b +;'''a:b''' +;<i>a:b</i> +;<span>a:b</span> +;<div>a:b</div> +;<div>a +:b</div> +;{{echo|a:b}} +;{{echo|''a:b''}} +;;;''a:b'' +!! html+tidy +<dl> +<dt>a</dt> +<dd>b</dd> +<dt><b>a:b</b></dt> +<dt><i>a:b</i></dt> +<dt><span>a:b</span></dt> +<dd> +<div>a:b</div> +</dd> +<dd> +<div>a +<dl> +<dd>b</dd> +</dl> +</div> +</dd> +<dt>a</dt> +<dd>b</dd> +<dt><i>a:b</i></dt> +</dl> +<dl> +<dd> +<dl> +<dd> +<dl> +<dt><i>a:b</i></dt> +</dl> +</dd> +</dl> +</dd> +</dl> +!! end + +!! test +Definition Lists: colons and tables 1 +!! wikitext +:{| +| x +|} +:{| +| y +|} +!! html +<dl><dd><table> +<tr> +<td> x +</td></tr></table></dd></dl> +<dl><dd><table> +<tr> +<td> y +</td></tr></table></dd></dl> + +!! end + +# Parsoid's output (as documented below) differs from php's in this case. +# This is probably a bug. If we fixup parsoid to match php's output, the +# above test should pass and the below test case can be removed. It is +# unclear which output is more desirable. + +!! test +Definition Lists: colons and tables 2 +!! wikitext +:{| +| x +|} +:{| +| y +|} +!! html/parsoid +<dl><dd><table> +<tr> +<td> x +</td></tr></table></dd> +<dd><table> +<tr> +<td> y +</td></tr></table></dd></dl> +!! end + +!! test +Definition Lists: template interaction +!! wikitext +::{{definition_list}} + +:one +::{{definition_list}} +:::two +:::three +::four +!! html/parsoid +<dl><dd><dl data-parsoid='{}'><dd about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[]]}' data-mw='{"parts":[":",{"template":{"target":{"wt":"definition_list","href":"./Template:Definition_list"},"params":{},"i":0}}]}'>one</dd><span about="#mwt1"> +</span><dd about="#mwt1">two</dd></dl></dd></dl> + +<dl><dd data-parsoid='{}'>one +<dl><dd about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"pi":[[]]}' data-mw='{"parts":["::",{"template":{"target":{"wt":"definition_list","href":"./Template:Definition_list"},"params":{},"i":0}},"\n:::two\n:::three"]}'>one</dd><span about="#mwt2"> +</span><dd about="#mwt2">two +<dl><dd>two</dd> +<dd>three</dd></dl></dd> +<dd data-parsoid='{}'>four</dd></dl></dd></dl> +!! end + + ### ### External links ### @@ -4004,8 +4380,79 @@ External links: with no contents </p> !! html/parsoid <p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo"></a></p> -<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo">Bar</a></p> -<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo"><span>Bar</span></a></p> +<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" title="wikipedia:Foo">Bar</a></p> +<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" title="wikipedia:Foo"><span>Bar</span></a></p> +!! end + +!! test +External links: Free with trailing punctuation +!! wikitext +http://example.com, +http://example.com; +http://example.com\ +http://example.com. +http://example.com: +http://example.com! +http://example.com? +http://example.com) +http://example.com/url_with_(brackets) +(http://example.com/url_without_brackets) +http://example.com/url_with_entity +http://example.com/url_with_entity  +http://example.com/url_with_entity  +http://example.com/url_with_entity< +http://example.com/url_with_entity< +http://example.com/url_with_entity< +!! html/php +<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>, +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>; +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>\ +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>. +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>: +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>! +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>? +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>) +<a rel="nofollow" class="external free" href="http://example.com/url_with_(brackets)">http://example.com/url_with_(brackets)</a> +(<a rel="nofollow" class="external free" href="http://example.com/url_without_brackets">http://example.com/url_without_brackets</a>) +<a rel="nofollow" class="external free" href="http://example.com/url_with_entity ">http://example.com/url_with_entity </a> +<a rel="nofollow" class="external free" href="http://example.com/url_with_entity ">http://example.com/url_with_entity </a> +<a rel="nofollow" class="external free" href="http://example.com/url_with_entity ">http://example.com/url_with_entity </a> +<a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a>< +<a rel="nofollow" class="external free" href="http://example.com/url_with_entity%3C">http://example.com/url_with_entity%3C</a> +<a rel="nofollow" class="external free" href="http://example.com/url_with_entity%3C">http://example.com/url_with_entity%3C</a> +</p> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a>, +<a rel="mw:ExtLink" href="http://example.com">http://example.com</a>; +<a rel="mw:ExtLink" href="http://example.com">http://example.com</a>\ +<a rel="mw:ExtLink" href="http://example.com">http://example.com</a>. +<a rel="mw:ExtLink" href="http://example.com">http://example.com</a>: +<a rel="mw:ExtLink" href="http://example.com">http://example.com</a>! +<a rel="mw:ExtLink" href="http://example.com">http://example.com</a>? +<a rel="mw:ExtLink" href="http://example.com">http://example.com</a>) +<a rel="mw:ExtLink" href="http://example.com/url_with_(brackets)">http://example.com/url_with_(brackets)</a> +(<a rel="mw:ExtLink" href="http://example.com/url_without_brackets">http://example.com/url_without_brackets</a>) +<a rel="mw:ExtLink" href="http://example.com/url_with_entity ">http://example.com/url_with_entity </a> +<a rel="mw:ExtLink" href="http://example.com/url_with_entity ">http://example.com/url_with_entity </a> +<a rel="mw:ExtLink" href="http://example.com/url_with_entity ">http://example.com/url_with_entity </a> +<a rel="mw:ExtLink" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><span typeof="mw:Entity"><</span> +<a rel="mw:ExtLink" href="http://example.com/url_with_entity<">http://example.com/url_with_entity<</a> +<a rel="mw:ExtLink" href="http://example.com/url_with_entity<">http://example.com/url_with_entity<</a></p> +!! end + +!! test +External links: No preceding word characters allowed (bug 65278) +!! wikitext +NOPEhttp://example.com +N0http://example.com +ok:http://example.com +ok-http://example.com +!! html +<p>NOPEhttp://example.com +N0http://example.com +ok:<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> +ok-<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> +</p> !! end !! test @@ -4095,10 +4542,12 @@ URL in text: [http://example.com http://example.com] External links: Clickable images !! wikitext ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png] -!! html +!! html/php <p>ja-style clickable images: <a rel="nofollow" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a> </p> -!!end +!! html/parsoid +<p>ja-style clickable images: <a rel="mw:ExtLink" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" data-parsoid='{"type":"extlink"}'/></a></p> +!! end !! test External links: raw ampersand @@ -4288,10 +4737,12 @@ http://www.example.com/<hello> BUG 289: literal ">"-token in URL-tail !! wikitext http://www.example.com/<b>html</b> -!! html +!! html/php <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><b>html</b> </p> -!!end +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://www.example.com/" data-parsoid='{"stx":"url"}'>http://www.example.com/</a><b data-parsoid='{"stx":"html"}'>html</b></p> +!! end !! test BUG 289: ">"-token in bracketed URL @@ -4410,7 +4861,7 @@ http://www.example.com/?title=AT%26T <p><a rel="mw:ExtLink" href="http://www.example.com/?title=AT%26T">http://www.example.com/?title=AT%26T</a></p> !! end -# According to http://dev.w3.org/html5/spec/Overview.html#parsing-urls a plain +# According to http://www.w3.org/TR/2011/WD-html5-20110525/Overview.html#parsing-urls a plain # % is actually legal in HTML5. Any change in output would need testing though. !! test Bug 4781, 5267: %25 in URL @@ -4751,7 +5202,7 @@ Parenthesis in external links, w/ transclusion or comment </p><p>(<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>) </p> !! html/parsoid -<p>(<a data-mw='{"attribs":[[{"txt":"href"},{"html":"http://example.com/<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;hi&quot;}},&quot;i&quot;:0}}]}\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[20,31,null,null]}\">hi</span>"}]]}' typeof="mw:ExpandedAttrs" about="#mwt2" rel="mw:ExtLink" href="http://example.com/hi" data-parsoid='{"stx":"url","a":{"href":"http://example.com/hi"},"sa":{"href":"http://example.com/{{echo|hi}}"}}'>http://example.com/hi</a>)</p> +<p>(<a typeof="mw:ExpandedAttrs" about="#mwt2" rel="mw:ExtLink" href="http://example.com/hi" data-parsoid='{"stx":"url","a":{"href":"http://example.com/hi"},"sa":{"href":"http://example.com/{{echo|hi}}"}}' data-mw='{"attribs":[[{"txt":"href"},{"html":"http://example.com/<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[20,31,null,null]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;hi&quot;}},&quot;i&quot;:0}}]}\">hi</span>"}]]}'>http://example.com/hi</a>)</p> <p>(<a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"stx":"url","a":{"href":"http://example.com"},"sa":{"href":"http://example.com<!-- hi -->"}}'>http://example.com</a>)</p> !! end @@ -5129,8 +5580,8 @@ Accept "!!" in table data </td></tr></table> !! html/parsoid -<table data-parsoid='{}'> -<tbody data-parsoid='{}'><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td data-parsoid='{"autoInsertedEnd":true}'> Foo!! </td><td data-parsoid='{"stx_v":"row","autoInsertedEnd":true}'></td></tr> +<table> +<tbody><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td data-parsoid='{"autoInsertedEnd":true}'> Foo!! </td><td data-parsoid='{"stx_v":"row","autoInsertedEnd":true}'></td></tr> </tbody></table> !! end @@ -5295,7 +5746,6 @@ Invalid attributes in table cell (bug 1830) !! end - # The "|}" to close the table is missing from the input, so parsoid's # *2wt modes will fail. !! test @@ -5320,6 +5770,25 @@ parsoid=wt2html,html2html <td><a rel="mw:ExtLink" href="ftp://|x||"></a>" onmouseover="alert(document.cookie)">test</td></tr></tbody></table> !! end +# FIXME: The php output is broken. +!! test +! and || in td attributes should not be parsed as <th>/<td> +!! wikitext +{| +| style="color: red !important;" data-contrived="put this here ||" | foo +|} +!! html/php +<table> +<tr> +<td> style="color: red !important;" data-contrived="put this here </td> +<td> foo +</td></tr></table> + +!! html/parsoid +<table> +<tbody><tr><td style="color: red !important;" data-contrived="put this here ||" data-parsoid='{"autoInsertedEnd":true}'> foo</td></tr> +</tbody></table> +!! end !! test Indented table markup mixed with indented pre content (proposed in bug 6200) @@ -5344,50 +5813,83 @@ Indented table markup mixed with indented pre content (proposed in bug 6200) !! end !! test -Template-generated table cell attributes and cell content +1. Template-generated table cell attributes and cell content !! wikitext {| |{{table_attribs}} | {{table_attribs}} +|| {{table_attribs_5}} +| <!--foo--> <!--bar--> <!--baz--> {{table_attribs}} +|align=center {{table_attribs}} +| <!--foo--> align=center <!--bar--> {{table_attribs}} |} !! html <table> <tr> -<td style="color: red"> Foo +<td style="color:red;">Foo </td> -<td style="color: red"> Foo +<td style="color:red;">Foo +</td> +<td> style="color:red;"</td> +<td>Bar +</td> +<td style="color:red;">Foo +</td> +<td align="center" style="color:red;">Foo +</td> +<td align="center" style="color:red;">Foo </td></tr></table> !! end !! test -Template-generated table cell attributes and cell content (2) +2. Template-generated table cell attributes and cell content !! wikitext {| -|align=center {{table_attribs}} +|{{table_attribs_2}} |} -!! html +!! html/php <table> <tr> -<td align="center" style="color: red"> Foo +<td style="color:red;">Foo +</td> +<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> +<td about="#mwt1">Bar</td><td about="#mwt1">Baz</td></tr> +</tbody></table> !! end !! test -Template-generated table cell attributes and cell content (3) +3. Template-generated table cell attributes and cell content !! wikitext {| +!align=center {{table_header_cells}} +|- |align=center {{table_cells}} |} -!! html +!! html/php <table> <tr> -<td align="center" style="color: red"> Foo </td> -<td> Bar </td> -<td> Baz +<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> +<tr> +<td align="center" style="color:red;">Foo</td> +<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> +<td align="center" style="color:red;" typeof="mw:Transclusion" about="#mwt1" data-mw='{"parts":["|align=center ",{"template":{"target":{"wt":"table_cells","href":"./Template:Table_cells"},"params":{},"i":0}}]}'>Foo</td><td about="#mwt1" style="color:red;"><i about="#mwt1">Bar</i></td><td about="#mwt1" style="color:brown;"><i about="#mwt1">Foo</i> and Baz</td></tr> +</tbody></table> !! end !! test @@ -5450,7 +5952,7 @@ Wikitext table with a lot of comments <!-- c0 --> | foo <!-- c1 --> -|- <!-- c2 --> +|-<!-- c2 --> <!-- c3 --> |<!-- c4 --> <!-- c5 --> @@ -5467,6 +5969,26 @@ Wikitext table with a lot of comments !! end !! test +Wikitext table comments represented in parsoid dom +!! wikitext +{|<!--c1--><!--c2--> +|-<!--c3--> +| x +|} +!! html/php+tidy +<table> +<tr> +<td>x</td> +</tr> +</table> +!! html/parsoid +<table><!--c1--><!--c2--> +<tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'><!--c3--> +<td data-parsoid='{"autoInsertedEnd":true}'> x</td></tr> +</tbody></table> +!! end + +!! test Wikitext table with double-line table cell !! wikitext {| @@ -5548,6 +6070,68 @@ Build table with {{!}} !! end +!! test +Build table with pipe as data +!! wikitext +{| class="wikitable" +! header +! second header +|- style="color:red;" +| data || style="color:red;" | second data +|- +| style="color:red;" | data with | || style="color:red;" | second data with | +|- +|| data with | ||| second data with | +|} +!! html +<table class="wikitable"> +<tr> +<th> header +</th> +<th> second header +</th></tr> +<tr style="color:red;"> +<td> data </td> +<td style="color:red;"> second data +</td></tr> +<tr> +<td style="color:red;"> data with | </td> +<td style="color:red;"> second data with | +</td></tr> +<tr> +<td> data with | </td> +<td> second data with | +</td></tr></table> + +!! end + +!! test +Build table with wikilink +!! wikitext +{| class="wikitable" +! header || second header +|- style="color:red;" +| data [[Main Page|linktext]] || second data [[Main Page|linktext]] +|- +| data || second data [[Main Page|link|text with pipe]] +|} +!! html +<table class="wikitable"> +<tr> +<th> header </th> +<th> second header +</th></tr> +<tr style="color:red;"> +<td> data <a href="/wiki/Main_Page" title="Main Page">linktext</a> </td> +<td> second data <a href="/wiki/Main_Page" title="Main Page">linktext</a> +</td></tr> +<tr> +<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 # not parse this kind of table at all. The main focus for Parsoid is on # round-tripping, so this output is ok for now. TODO: revisit! @@ -5574,7 +6158,7 @@ Wikitext table with html-syntax row !! test Implicit <td> after a |- !! options -parsoid=wt2html,wt2wt +parsoid=wt2html,html2html !! wikitext {| |- @@ -5598,7 +6182,7 @@ a !! test <pre> tags should be recognized in an explicit <td> context, but not in an implicit <td> context !! options -parsoid=wt2html,wt2wt +parsoid=wt2html,html2html !! wikitext {| |- @@ -5638,10 +6222,11 @@ a !! end # PHP + Tidy strips the list out of the table; Parsoid wraps it. +# Parsoid generates the missing <td>, so wt2wt won't succeed. !! test Lists should be recognized in an implicit <td> context !! options -parsoid=wt2html,wt2wt +parsoid=wt2html,html2html !! wikitext {| |- @@ -5668,6 +6253,28 @@ parsoid=wt2html,wt2wt !! end !! test +Table cells not properly parsed in an implicit-td context +!! wikitext +{| +|- +{{table_attribs_4}} || a || b +|} +!! html/php+tidy +<table> +<tr> +<td style="background-color:#DC241f;" width="10px"></td> +<td>a</td> +<td>b</td> +</tr> +</table> +!! html/parsoid +<table> +<tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'> +<td style="background-color:#DC241f;" width="10px" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"autoInsertedEnd":true,"pi":[[]]}' data-mw='{"parts":["",{"template":{"target":{"wt":"table_attribs_4","href":"./Template:Table_attribs_4"},"params":{},"i":0}}," "]}'> </td><td data-parsoid='{"stx_v":"row","autoInsertedEnd":true}'> a </td><td data-parsoid='{"stx_v":"row","autoInsertedEnd":true}'> b</td></tr> +</tbody></table> +!! end + +!! test Parsoid: Round-trip tables directly followed by content (bug 51219) !! options parsoid=wt2html,wt2wt @@ -5679,20 +6286,30 @@ parsoid=wt2html,wt2wt {| |baz |}<b>quux</b> -!! html -<table><tbody> +!! html+tidy +<table> <tr> -<td>foo</td></tr></tbody></table> bar +<td>foo</td> +</tr> +</table> +<p>bar</p> <table> -<tbody> <tr> -<td>baz</td></tr></tbody></table><b>quux</b> +<td>baz</td> +</tr> +</table> +<p><b>quux</b></p> !! end !! test Parsoid: Default to a newline after tables in new content (bug 51219) !! options parsoid=html2wt +!! html +<table><tbody> +<tr><td>foo</td></tr></tbody></table> bar +<table><tbody> +<tr><td>baz</td></tr></tbody></table><b>quux</b> !! wikitext {| |foo @@ -5702,23 +6319,18 @@ parsoid=html2wt |baz |} '''quux''' -!! html -<table><tbody> -<tr><td>foo</td></tr></tbody></table> bar -<table><tbody> -<tr><td>baz</td></tr></tbody></table><b>quux</b> !! end !! test Parsoid: newline inducing block nodes don't suppress <nowiki> !! options parsoid=html2wt +!! html + a<h1>foo</h1> !! wikitext <nowiki> </nowiki>a = foo = -!! html - a<h1>foo</h1> !! end !! test @@ -5823,6 +6435,27 @@ parsoid=html2wt |} !! end +!!test +Testing serialization after deletion of table cells +!!options +parsoid={ + "modes": ["wt2wt", "selser"], + "changes": [ + ["#x", "remove"] + ] +} +!!wikitext +{| +!h1 !!h2 !!h3 +| id="x" |c1 {{!}}{{!}}{{!}}c2 |||c3 +|} +!! wikitext/edited +{| +!h1 !!h2 !!h3 +|c2 |||c3 +|} +!!end + ### ### Internal links ### @@ -5953,9 +6586,11 @@ Bug 43661: Piped links with identical prefixes Link with HTML entity in suffix / tail !! wikitext [[Main Page]]", [[Main Page]]a -!! html +!! html/php <p><a href="/wiki/Main_Page" title="Main Page">Main Page</a>", <a href="/wiki/Main_Page" title="Main Page">Main Page</a>a </p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a><span typeof="mw:Entity" data-parsoid='{"src":"&quot;","srcContent":"\""}'>"</span>, <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a><span typeof="mw:Entity" data-parsoid='{"src":"&#97;","srcContent":"a"}'>a</span></p> !! end !! test @@ -5990,10 +6625,13 @@ Piped link with extlink-like text !! wikitext [[Main Page|[bar]]] [[Main Page|This is a [bar]]] -!! html +!! html/php <p><a href="/wiki/Main_Page" title="Main Page">[bar]</a> <a href="/wiki/Main_Page" title="Main Page">This is a [bar]</a> </p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./Main_Page" title="Main Page" data-parsoid='{"stx":"piped"}'>[bar]</a> +<a rel="mw:WikiLink" href="./Main_Page" title="Main Page" data-parsoid='{"stx":"piped"}'>This is a [bar]</a></p> !! end !! test @@ -6058,11 +6696,10 @@ Namespace takes precedence over interwiki link (bug 51680) Link to namespace preferred over interwiki with correct rel attribute !! options parsoid=html2wt,html2html +!! html +<p><a rel="mw:WikiLink" href="./MemoryAlpha:AlphaTest" title="MemoryAlpha:AlphaTest">MemoryAlpha:AlphaTest</a></p> !! wikitext [[MemoryAlpha:AlphaTest]] -!! html -<p><a rel="mw:WikiLink" href="./MemoryAlpha:AlphaTest" title="MemoryAlpha:AlphaTest">MemoryAlpha:AlphaTest</a> -</p> !! end !! test @@ -6213,7 +6850,7 @@ Link containing double-single-quotes '' in text embedded in italics (bug 4598 sa !! test Link with double quotes in title part (literal) and alternate part (interpreted) !! wikitext -[[File:Denys Savchenko ''Pentecoste''.jpg]] +[[File:Denys_Savchenko_''Pentecoste''.jpg]] [[''Pentecoste'']] @@ -6227,7 +6864,7 @@ Link with double quotes in title part (literal) and alternate part (interpreted) </p><p><a href="/index.php?title=%27%27Pentecoste%27%27&action=edit&redlink=1" class="new" title="''Pentecoste'' (page does not exist)"><i>Pentecoste</i></a> </p> !! html/parsoid -<meta typeof="mw:Placeholder"/> +<p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","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></span></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> @@ -6237,15 +6874,20 @@ Link with double quotes in title part (literal) and alternate part (interpreted) Broken image links with HTML captions (bug 39700) !! wikitext [[File:Nonexistent|<script></script>]] -[[File:Nonexistent|100px|<script></script>]] +[[File:Nonexistent|100x100px|<script></script>]] [[File:Nonexistent|<]] [[File:Nonexistent|a<i>b</i>c]] -!! html +!! html/php <p><a href="/index.php?title=Special:Upload&wpDestFile=Nonexistent" class="new" title="File:Nonexistent"><script></script></a> <a href="/index.php?title=Special:Upload&wpDestFile=Nonexistent" class="new" title="File:Nonexistent"><script></script></a> <a href="/index.php?title=Special:Upload&wpDestFile=Nonexistent" class="new" title="File:Nonexistent"><</a> <a href="/index.php?title=Special:Upload&wpDestFile=Nonexistent" class="new" title="File:Nonexistent">abc</a> </p> +!! html/parsoid +<p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","message":"This image does not exist."}],"caption":"<script></script>"}'><a href="./File:Nonexistent"><img resource="./File:Nonexistent" src="./Special:FilePath/Nonexistent" height="220" width="220"/></a></span> +<span typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","message":"This image does not exist."}],"caption":"<script></script>"}'><a href="./File:Nonexistent" data-parsoid='{"a":{"href":"./File:Nonexistent"},"sa":{}}'><img resource="./File:Nonexistent" src="./Special:FilePath/Nonexistent" height="100" width="100"/></a></span> +<span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","message":"This image does not exist."}],"caption":"&lt;"}'><a href="./File:Nonexistent"><img resource="./File:Nonexistent" src="./Special:FilePath/Nonexistent" height="220" width="220"/></a></span> +<span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","message":"This image does not exist."}],"caption":"a<i>b</i>c"}'><a href="./File:Nonexistent"><img resource="./File:Nonexistent" src="./Special:FilePath/Nonexistent" height="220" width="220"/></a></span></p> !! end !! test @@ -6483,7 +7125,7 @@ title=[[User:test/123]] <p><a href="#a">b</a> </p> !! html/parsoid -<p data-parsoid='{}'><a rel="mw:WikiLink" href="../User:Test/123#a" data-parsoid='{"stx":"piped","a":{"href":"../User:Test/123#a"},"sa":{"href":"#a"}}'>b</a></p> +<p><a rel="mw:WikiLink" href="../User:Test/123#a" data-parsoid='{"stx":"piped","a":{"href":"../User:Test/123#a"},"sa":{"href":"#a"}}'>b</a></p> !! end !! test @@ -6503,7 +7145,7 @@ parsoid !! wikitext {{echo|Some [[Fool]]}}s !! html -<p data-parsoid='{}'><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Some [[Fool]]"}},"i":0}},"s"]}' data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}'>Some </span><a rel="mw:WikiLink" href="./Fool" title="Fool" about="#mwt1" data-parsoid='{"stx":"simple","a":{"href":"./Fool"},"sa":{"href":"Fool"},"tail":"s"}'>Fools</a></p> +<p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Some [[Fool]]"}},"i":0}},"s"]}' data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}'>Some </span><a rel="mw:WikiLink" href="./Fool" title="Fool" about="#mwt1" data-parsoid='{"stx":"simple","a":{"href":"./Fool"},"sa":{"href":"Fool"},"tail":"s"}'>Fools</a></p> !! end !! test @@ -6513,7 +7155,7 @@ parsoid !! wikitext {{echo|Some [[Fool]]s are '''bold and foolish'''}} !! html -<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Some [[Fool]]s are '''bold and foolish'''"}},"i":0}}]}' data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}'>Some <a rel="mw:WikiLink" href="./Fool" title="Fool" data-parsoid='{"stx":"simple","a":{"href":"./Fool"},"sa":{"href":"Fool"},"tail":"s"}'>Fools</a> are <b data-parsoid="{}">bold and foolish</b></p> +<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"Some [[Fool]]s are '''bold and foolish'''"}},"i":0}}]}' data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}'>Some <a rel="mw:WikiLink" href="./Fool" title="Fool" data-parsoid='{"stx":"simple","a":{"href":"./Fool"},"sa":{"href":"Fool"},"tail":"s"}'>Fools</a> are <b>bold and foolish</b></p> !! end !! article @@ -6562,10 +7204,10 @@ mótmælenda[[söfnuður|söfnuðir]]xxx Parsoid link trail escaping !! options parsoid=html2wt,html2html -!! wikitext -[[apple]]<nowiki/>s !! html <p><a rel="mw:WikiLink" href="Apple" title="Apple">apple</a>s</p> +!! wikitext +[[apple]]<nowiki/>s !! end !! test @@ -6573,10 +7215,10 @@ Parsoid link prefix escaping !! options language=is parsoid=html2wt,html2html -!! wikitext -Aðrir mótmælenda<nowiki/>[[söfnuður]] !! html <p>Aðrir mótmælenda<a rel="mw:WikiLink" href="Söfnuður" title="Söfnuður">söfnuður</a></p> +!! wikitext +Aðrir mótmælenda<nowiki/>[[söfnuður]] !! end !! test @@ -6624,20 +7266,28 @@ Link with angle bracket after anchor !! test Inline interwiki link +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[MeatBall:SoftSecurity]] -!! html +!! html/php <p><a href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" class="extiw" title="meatball:SoftSecurity">MeatBall:SoftSecurity</a> </p> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?SoftSecurity" title="meatball:SoftSecurity">MeatBall:SoftSecurity</a></p> !! end !! test Inline interwiki link with empty title (bug 2372) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[MeatBall:]] -!! html +!! html/php <p><a href="http://www.usemod.com/cgi-bin/mb.pl" class="extiw" title="meatball:">MeatBall:</a> </p> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?" title="meatball:">MeatBall:</a></p> !! end !! test @@ -6666,6 +7316,10 @@ Interwiki link with fragment (bug 2130) !! end # Ideally the wikipedia: prefix here should be proto-relative too +# [CSA]: this is kind of a bogus test, as the PHP parser test doesn't +# define the 'en' prefix, and originally the test used 'wikipedia', +# which isn't a localinterwiki prefix hence the links to the 'en:Foo' +# article. !! test Different interwiki prefixes mapping to the same URL !! wikitext @@ -6683,19 +7337,19 @@ Different interwiki prefixes mapping to the same URL [[ wikiPEdia :Foo]] !! html/parsoid -<p><a rel="mw:ExtLink" href="//en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"//en.wikipedia.org/wiki/Foo"},"sa":{"href":":en:Foo"},"isIW":true}'>en:Foo</a></p> +<p><a rel="mw:ExtLink" href="//en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"//en.wikipedia.org/wiki/Foo"},"sa":{"href":":en:Foo"},"isIW":true}' title="en:Foo">en:Foo</a></p> -<p><a rel="mw:ExtLink" href="//en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"piped","a":{"href":"//en.wikipedia.org/wiki/Foo"},"sa":{"href":":en:Foo"},"isIW":true}'>Foo</a></p> +<p><a rel="mw:ExtLink" href="//en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"piped","a":{"href":"//en.wikipedia.org/wiki/Foo"},"sa":{"href":":en:Foo"},"isIW":true}' title="en:Foo">Foo</a></p> -<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"wikipedia:Foo"},"isIW":true}'>wikipedia:Foo</a></p> +<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"wikipedia:Foo"},"isIW":true}' title="wikipedia:Foo">wikipedia:Foo</a></p> -<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"piped","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":":wikipedia:Foo"},"isIW":true}'>Foo</a></p> +<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"piped","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":":wikipedia:Foo"},"isIW":true}' title="wikipedia:Foo">Foo</a></p> -<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/en:Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/en:Foo"},"sa":{"href":"wikipedia:en:Foo"},"isIW":true}'>wikipedia:en:Foo</a></p> +<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/en:Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/en:Foo"},"sa":{"href":"wikipedia:en:Foo"},"isIW":true}' title="wikipedia:en:Foo">wikipedia:en:Foo</a></p> -<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/en:Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/en:Foo"},"sa":{"href":":wikipedia:en:Foo"},"isIW":true}'>wikipedia:en:Foo</a></p> +<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/en:Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/en:Foo"},"sa":{"href":":wikipedia:en:Foo"},"isIW":true}' title="wikipedia:en:Foo">wikipedia:en:Foo</a></p> -<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":" wikiPEdia :Foo"},"isIW":true}'> wikiPEdia :Foo</a></p> +<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":" wikiPEdia :Foo"},"isIW":true}' title="wikipedia:Foo"> wikiPEdia :Foo</a></p> !! end !! test @@ -6707,60 +7361,97 @@ Interwiki links that cannot be represented in wiki syntax [http://de.wikipedia.org/wiki/Foo?action=history has query] [http://de.wikipedia.org/wiki/#foo is just fragment] +!! html/php +<p><a href="http://www.usemod.com/cgi-bin/mb.pl?ok" class="extiw" title="meatball:ok">meatball:ok</a> +<a href="http://www.usemod.com/cgi-bin/mb.pl?ok#foo" class="extiw" title="meatball:ok">ok with fragment</a> +<a href="http://www.usemod.com/cgi-bin/mb.pl?ok_as_well%3F" class="extiw" title="meatball:ok as well?">ok ending with ? mark</a> +<a rel="nofollow" class="external text" href="http://de.wikipedia.org/wiki/Foo?action=history">has query</a> +<a rel="nofollow" class="external text" href="http://de.wikipedia.org/wiki/#foo">is just fragment</a> +</p> !! html/parsoid -<p><a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok">meatball:ok</a> -<a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok#foo">ok with fragment</a> -<a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok_as_well?">ok ending with ? mark</a> +<p><a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok" title="meatball:ok">meatball:ok</a> +<a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok#foo" title="meatball:ok">ok with fragment</a> +<a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?ok_as_well?" title="meatball:ok as well?">ok ending with ? mark</a> <a rel="mw:ExtLink" href="http://de.wikipedia.org/wiki/Foo?action=history">has query</a> <a rel="mw:ExtLink" href="http://de.wikipedia.org/wiki/#foo">is just fragment</a></p> !! end !! test Interwiki links: trail -!! options -parsoid !! wikitext [[wikipedia:Foo|Ba]]r -!! html -<p data-parsoid='{}'><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"piped","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"wikipedia:Foo"},"isIW":true,"tail":"r"}'>Bar</a></p> +!! html/php +<p><a href="http://en.wikipedia.org/wiki/Foo" class="extiw" title="wikipedia:Foo">Bar</a> +</p> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" data-parsoid='{"stx":"piped","a":{"href":"http://en.wikipedia.org/wiki/Foo"},"sa":{"href":"wikipedia:Foo"},"isIW":true,"tail":"r"}' title="wikipedia:Foo">Bar</a></p> !! end !! test Local interwiki link +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[local:Template:Foo]] -!! html +!! html/php <p><a href="/wiki/Template:Foo" title="Template:Foo">local:Template:Foo</a> </p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./Template:Foo" title="Template:Foo">local:Template:Foo</a></p> !! end +# Parsoid does not mark self-links, by design. !! test Local interwiki link: self-link to current page !! options title=[[Main Page]] +parsoid=wt2html,wt2wt,html2html !! wikitext [[local:Main Page]] -!! html +!! html/php <p><strong class="selflink">local:Main Page</strong> </p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./Main_Page" title="Main Page">local:Main Page</a></p> !! end !! test Local interwiki link: prefix only (bug 64167) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[local:]] -!! html +!! html/php <p><a href="/wiki/Main_Page" title="Main Page">local:</a> </p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./Main_Page" title="Main Page">local:</a></p> !! end !! test Local interwiki link: with additional interwiki prefix (bug 61357) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[local:meatball:Hello]] -!! html +!! html/php <p><a href="http://www.usemod.com/cgi-bin/mb.pl?Hello" class="extiw" title="meatball:Hello">local:meatball:Hello</a> </p> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://www.usemod.com/cgi-bin/mb.pl?Hello" title="meatball:Hello">local:meatball:Hello</a></p> +!! end + +!! test +Multiple local interwiki link prefixes +!! wikitext +[[local:local:local:local:mi:local:Foo]] +!! options +parsoid=wt2html,wt2wt,html2html +!! html/php +<p><a href="/wiki/Foo" title="Foo">local:local:local:local:mi:local:Foo</a> +</p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./Foo" title="Foo">local:local:local:local:mi:local:Foo</a></p> !! end ### @@ -6770,6 +7461,8 @@ Local interwiki link: with additional interwiki prefix (bug 61357) !! test Interlanguage link +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[zh:Chinese]] @@ -6777,12 +7470,14 @@ Blah blah blah <p>Blah blah blah </p> !! html/parsoid -<p>Blah blah blah -<link rel="mw:PageProp/Language" href="//zh.wikipedia.org/wiki/Chinese"/></p> +<p>Blah blah blah</p> +<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/> !! end !! test Interlanguage link with spacing +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[ zh : Chinese ]] @@ -6790,12 +7485,14 @@ Blah blah blah <p>Blah blah blah </p> !! html/parsoid -<p>Blah blah blah -<link rel="mw:PageProp/Language" href="//zh.wikipedia.org/wiki/Chinese"/></p> +<p>Blah blah blah</p> +<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/> !! end !! test Double interlanguage link +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[es:Spanish]] @@ -6804,24 +7501,30 @@ Blah blah blah <p>Blah blah blah </p> !! html/parsoid -<p>Blah blah blah -<link rel="mw:PageProp/Language" href="//es.wikipedia.org/wiki/Spanish"/> -<link rel="mw:PageProp/Language" href="//zh.wikipedia.org/wiki/Chinese"/></p> +<p>Blah blah blah</p> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Spanish"/> +<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/> !! end !! test Interlanguage link variations +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[ es :Spanish]] [[ ZH :Chinese]] +[[es:Foo_bar]] +[[es:Foo bar]] !! html/php <p>Blah blah blah </p> !! html/parsoid -<p>Blah blah blah -<link rel="mw:PageProp/Language" href="//es.wikipedia.org/wiki/Spanish" data-parsoid='{"stx":"simple","a":{"href":"//es.wikipedia.org/wiki/Spanish"},"sa":{"href":" es :Spanish"}}'/> -<link rel="mw:PageProp/Language" href="//zh.wikipedia.org/wiki/Chinese" data-parsoid='{"stx":"simple","a":{"href":"//zh.wikipedia.org/wiki/Chinese"},"sa":{"href":" ZH :Chinese"}}'/> +<p>Blah blah blah</p> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Spanish" /> +<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese" /> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Foo_bar" /> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Foo_bar" /> !! end !! test @@ -6835,8 +7538,8 @@ Blah blah blah <p>Blah blah blah </p> !! html/parsoid -<p>Blah blah blah -<link rel="mw:PageProp/Language" href="//zh.wikipedia.org/wiki/Chinese"/></p> +<p>Blah blah blah</p> +<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/> !! end !! test @@ -6851,9 +7554,9 @@ Blah blah blah <p>Blah blah blah </p> !! html/parsoid -<p>Blah blah blah -<link rel="mw:PageProp/Language" href="//es.wikipedia.org/wiki/Spanish"/> -<link rel="mw:PageProp/Language" href="//zh.wikipedia.org/wiki/Chinese"/></p> +<p>Blah blah blah</p> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Spanish"/> +<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/> !! end !! test @@ -6865,8 +7568,8 @@ Blah blah blah <p>Blah blah blah </p> !! html/parsoid -<p>Blah blah blah -<link rel="mw:PageProp/Language" title="Multilingual" href="//wikisource.org/wiki/Article"/></p> +<p>Blah blah blah</p> +<link rel="mw:PageProp/Language" title="Multilingual" href="http://wikisource.org/wiki/Article"/> !! end !! test @@ -6884,84 +7587,119 @@ language=ln Parsoid bug 53221: Wikilinks should be properly entity-escaped !! options parsoid=html2wt +!! html +<p>He&nbsp;llo <a href="Foo" rel="mw:WikiLink">He&nbsp;llo</a></p> +<p>He&nbsp;llo <a href="He&nbsp;llo" rel="mw:WikiLink">He&nbsp;llo</a></p> !! wikitext He&nbsp;llo [[Foo|He&nbsp;llo]] He&nbsp;llo [[He&nbsp;llo]] -!! html -<p>He&nbsp;llo <a href="Foo" rel="mw:WikiLink">He&nbsp;llo</a></p> -<p>He&nbsp;llo <a href="He&nbsp;llo" rel="mw:WikiLink">He&nbsp;llo</a></p> !! end !! test Parsoid: handle constructor well -!! options -parsoid !! wikitext [[constructor]] [[constructor:foo]] -!! html +!! html/php +<p><a href="/index.php?title=Constructor&action=edit&redlink=1" class="new" title="Constructor (page does not exist)">constructor</a> +</p><p><a href="/index.php?title=Constructor:foo&action=edit&redlink=1" class="new" title="Constructor:foo (page does not exist)">constructor:foo</a> +</p> +!! html/parsoid <p><a rel="mw:WikiLink" href="./Constructor" title="Constructor" data-parsoid="{"stx":"simple","a":{"href":"./Constructor"},"sa":{"href":"constructor"}}">constructor</a></p> <p><a rel="mw:WikiLink" href="./Foo" title="Foo" data-parsoid="{"stx":"simple","a":{"href":"./Foo"},"sa":{"href":"constructor:foo"}}">constructor:foo</a></p> !! end +!! article +ko: +!! text +Test. +!! endarticle + +# Note that `ko` isn't a known interlanguage prefix !! test Parsoid: recognize interlanguage links without a target page !! options -parsoid +ill !! wikitext +[[es:]] + [[ko:]] -!! html -<p><link rel="mw:PageProp/Language" href="http://ko.wikipedia.org/wiki/"></p> +!! html/php +es: +!! html/parsoid +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/"/> + +<p><a rel="mw:WikiLink" href="./Ko:" title="Ko:">ko:</a></p> !! end +# Note that `ko` isn't a known interwiki prefix !! test Parsoid: recognize interwiki links without a target page !! options -parsoid +parsoid=wt2html,wt2wt,html2html !! wikitext +[[:es:]] + [[:ko:]] -!! html -<p><a rel="mw:ExtLink" href="//ko.wikipedia.org/wiki/">ko:</a></p> +!! html/php +<p><a href="http://es.wikipedia.org/wiki/" class="extiw" title="es:">es:</a> +</p><p><a href="/wiki/Ko:" title="Ko:">ko:</a> +</p> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://es.wikipedia.org/wiki/" title="es:">es:</a></p> +<p><a rel="mw:WikiLink" href="./Ko:" title="Ko:">ko:</a></p> !! end !! test -Parsoid: Bug #45209, handle interwiki links pointing to the current wiki as plain wiki links -!! options -parsoid +Handle interwiki links pointing to the current wiki as plain wiki links (bug 45209) !! wikitext -[[en:Foo]] -!! html -<p><a rel="mw:WikiLink" href="./Foo" title="Foo" data-parsoid='{"stx":"simple","a":{"href":"./Foo"},"sa":{"href":"en:Foo"}}'>Foo</a></p> +[[mi:Foo]] +!! html/php +<p><a href="/wiki/Foo" title="Foo">mi:Foo</a> +</p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./Foo" title="Foo" data-parsoid='{"stx":"simple","a":{"href":"./Foo"},"sa":{"href":"mi:Foo"}}'>mi:Foo</a></p> !! end !! test Interlanguage link with preceding local interwiki link (bug 68085) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[local:es:Spanish]] -!! html +!! html/php <p>Blah blah blah <a href="http://es.wikipedia.org/wiki/Spanish" class="extiw" title="es:Spanish">local:es:Spanish</a> </p> +!! html/parsoid +<p>Blah blah blah +<a rel="mw:ExtLink" href="http://es.wikipedia.org/wiki/Spanish" title="es:Spanish">local:es:Spanish</a></p> !! end !! test Looks like an interlanguage link, but is actually a local interwiki +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[mi:Template:Foo]] -!! html +!! html/php <p>Blah blah blah <a href="/wiki/Template:Foo" title="Template:Foo">mi:Template:Foo</a> </p> +!! html/parsoid +<p>Blah blah blah +<a rel="mw:WikiLink" href="Template:Foo" title="Template:Foo">mi:Template:Foo</a></p> !! end ### ### Redirects, Parsoid-only ### + !! test 1. Simple redirect to page !! options @@ -6972,17 +7710,20 @@ parsoid <link rel="mw:PageProp/redirect" href="./Main_Page"> !! end -# Only wt2html and html2html since "Main_Page" will serialize to "Main Page" !! test 2. Other redirect variants -!! options -parsoid=wt2html,wt2wt !! wikitext #REDIRECT [[Main_Page]] +!! html/parsoid +<link rel="mw:PageProp/redirect" href="./Main_Page" data-parsoid='{"src":"#REDIRECT ","a":{"href":"./Main_Page"},"sa":{"href":"Main_Page"}}'/> +!! end + +!! test +3. Other redirect variants +!! wikitext #REDIRECT [[<nowiki>[[Bar]]</nowiki>]] -!! html -<link rel="mw:PageProp/redirect" href="./Main_Page"> -<link rel="mw:PageProp/redirect" href="./%5B%5BBar%5D%5D"> +!! html/parsoid +<link rel="mw:PageProp/redirect" href="./%5B%5BBar%5D%5D" data-parsoid='{"src":"#REDIRECT ","a":{"href":"./%5B%5BBar%5D%5D"},"sa":{"href":"<nowiki>[[Bar]]</nowiki>"}}'/> !! end !! test @@ -7039,7 +7780,7 @@ parsoid=wt2html !! test Redirect to category !! options -parsoid=wt2html +parsoid=wt2wt,wt2html !! wikitext #REDIRECT [[Category:Foo]] !! html @@ -7059,11 +7800,11 @@ parsoid=wt2html !! test Redirect to category page !! options -parsoid=wt2html,html2html +parsoid !! wikitext #REDIRECT [[:Category:Foo]] !! html -<p><a rel="mw:WikiLink" href="Category:Foo" title="Category:Foo">Category:Foo</a></p> +<link rel="mw:PageProp/redirect" href="Category:Foo" title="Category:Foo"/> !! end !! test @@ -7093,7 +7834,7 @@ parsoid !! wikitext #REDIRECT [[en:File:Wiki.png]] !! html -<link rel="mw:PageProp/redirect" href="File:Wiki.png"> +<link rel="mw:PageProp/redirect" href="./File:Wiki.png"> !! end !! test @@ -7103,7 +7844,7 @@ parsoid !! wikitext #REDIRECT [[meatball:File:Wiki.png]] !! html -<link rel="mw:PageProp/redirect" href="File:Wiki.png"> +<link rel="mw:PageProp/redirect" href="./File:Wiki.png"> !! end !! test @@ -7118,14 +7859,26 @@ language=is !! end !! test +Redirect syntax under text isn't considered a redirect +!! wikitext +some text +#redirect [[Main Page]] +!! html/parsoid +<p>some text</p> +<ol data-parsoid='{}'><li data-parsoid='{}'>redirect <a rel="mw:WikiLink" href="./Main_Page" title="Main Page" data-parsoid='{"stx":"simple","a":{"href":"./Main_Page"},"sa":{"href":"Main Page"}}'>Main Page</a></li></ol> +!! end + +# FIXME: Should hoist the redirect to the top of the page and ensure there +# is only one. +!! test New redirect !! options parsoid=html2wt +!! html +<p>Foo<link rel="mw:PageProp/redirect" href="./Foo"></p> !! wikitext Foo #REDIRECT [[Foo]] -!! html -<p>Foo<link rel="mw:PageProp/redirect" href="./Foo"></p> !! end ## @@ -7151,9 +7904,6 @@ Broken br tag sanitization !! end # TODO: Fix html2html mode (bug 51055)! -# This </br> handling was added as part of bug 50831; but it -# differs from how PHP+tidy handles this. We should investigate -# this. !! test Parsoid: Broken br tag recognition !! options @@ -7162,12 +7912,9 @@ parsoid=wt2html </br> <br/ > -!! html/php+tidy -<p></br></p> +!! html+tidy +<p><br /></p> <p><br /></p> -!! html/parsoid -<p><br></p> -<p><br/></p> !! end !! test @@ -7192,6 +7939,8 @@ Failing to transform badly formed HTML into correct XHTML </p> !!end +## FIXME: Is Parsoid's acceptance of self-closing html-tags +## a feature or a bug? See https://phabricator.wikimedia.org/T76962 !! test Handling html with a div self-closing tag !! wikitext @@ -7201,7 +7950,7 @@ Handling html with a div self-closing tag <div title=bar /> <div title=bar/> <div title=bar/ > -!! html +!! html/php <p><div title /> <div title/> </p> @@ -7212,6 +7961,13 @@ Handling html with a div self-closing tag <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> +<div title="" data-parsoid='{"stx":"html","selfClose":true,"brokenHTMLTag":true}'></div> +<div title="bar" data-parsoid='{"stx":"html","selfClose":true}'></div> +<div title="bar" data-parsoid='{"stx":"html","selfClose":true}'></div> +<div title="bar/" data-parsoid='{"stx":"html","autoInsertedEnd":true}'></div> !! end !! test @@ -7234,7 +7990,7 @@ Handling html with a br self-closing tag !! html/parsoid <p><br title="" /> <br title="" /> -<br /> +<br title="" /> <br title="bar" /> <br title="bar" /> <br title="bar/" /> @@ -7248,11 +8004,12 @@ Horizontal ruler (should it add that extra space?) <hr > foo <hr > bar -!! html +!! html+tidy <hr /> <hr /> -foo <hr /> bar - +<p>foo</p> +<hr /> +<p>bar</p> !! end !! test @@ -7462,6 +8219,16 @@ Nested lists 8 (multiple nesting transitions) !! end !! test +Nested lists 9 (extension interaction) +!! options +parsoid +!! wikitext +*<references /> +!! html/parsoid +<ul><li data-parsoid='{}'><ol class="references" typeof="mw:Extension/references" about="#mwt2" data-parsoid='{}' data-mw='{"name":"references","attrs":{}}'></ol></li></ul> +!! end + +!! test 1. Lists with start-of-line-transparent tokens before bullets: Comments !! wikitext *foo @@ -7718,6 +8485,8 @@ Unbalanced closing non-block tags don't break a list !! test Unclosed formatting tags that straddle lists are closed and reopened (php parser relies on Tidy to fix up) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext # <s> a # b </s> @@ -7727,19 +8496,13 @@ Unclosed formatting tags that straddle lists are closed and reopened <li><s>b</s></li> </ol> !! html/parsoid -<ol> -<li> <s> a </s> -</li> -<li> <s> b </s> -</li> -</ol> +<ol><li> <s> a</s></li> +<li><s> b </s></li></ol> !! end -# Parsoid fails this test, but it might be tricky to support properly. # See bug 68395. !!test -List embedded in a non-block tag -(Ugly Parsoid output -- worth fixing; PHP parser relies on Tidy) +1. List embedded in a formatting tag !! wikitext <small> * foo @@ -7756,6 +8519,49 @@ List embedded in a non-block tag </small> !!end +## Ugly Parsoid output here +## Not sure what the right output is. +!!test +2. List embedded in a formatting tag +!! wikitext +<small> +*a +*b</small> +!! html/php+tidy +<ul> +<li><small>a</small></li> +<li><small>b</small></li> +</ul> +!! html/parsoid +<small></small> +<ul><small> +<li>a</li> +</small> +<li><small>b</small></li> +</ul> +!!end + +# Ugly Parsoid and PHP parser output here +# Not sure if we want to make this a test! +# +## !!test +## 3. Unclosed formatting tags in list elements +## !! wikitext +## *<small>a +## *<small>b +## !! html/php+tidy +## <ul> +## <li><small>a</small></li> +## <li><small><small>b</small></small></li> +## </ul> +## !! html/parsoid +## <ul> +## <li><small>a</small></li> +## <small> +## <li><small>b</small></li> +## </small></ul> +## !!end + # This is a bug in the PHP parser + tidy combination. # (The </tr> tag gets parsed as text and html-escaped by PHP, # and then fostered out of the table by tidy.) @@ -7769,14 +8575,7 @@ parsoid=wt2html,wt2wt <td>foo</td> </tr> </table> -!! html/php+tidy -<p></tr></p> -<table> -<tr> -<td>foo</td> -</tr> -</table> -!! html/parsoid +!! html+tidy <table> <tr> <td>foo</td> @@ -8360,6 +9159,23 @@ Aoeu </p> !! end +# From plwiki:PLOS_ONE +!! test +Parsoid: Page property magic word with magic word contents +!! wikitext +{{DISPLAYTITLE:''{{PAGENAME}}''}} +!! html/parsoid +<meta property="mw:PageProp/displaytitle" content="Main Page" about="#mwt2" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"content"},{"html":"<i data-parsoid=\"{&quot;dsr&quot;:[15,31,2,2]}\"><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;pi&quot;:[[]],&quot;dsr&quot;:[17,29,null,null]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;PAGENAME&quot;,&quot;function&quot;:&quot;pagename&quot;},&quot;params&quot;:{},&quot;i&quot;:0}}]}\">Main Page</span></i>"}]]}'/> +!! end + +!! test +Parsoid: Template-generated DISPLAYTITLE +!! wikitext +{{{{echo|DISPLAYTITLE}}:Foo}} +!! html/parsoid +<meta property="mw:PageProp/displaytitle" content="Foo" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"dsr":[0,29,null,null],"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"{{echo|DISPLAYTITLE}}:Foo"},"params":{},"i":0}}]}'/> +!! end + !! test Namespace 1 {{ns:1}} !! wikitext @@ -8490,10 +9306,10 @@ hi+world%3F%21 Magic Word: prioritize type info over data-parsoid !! options parsoid=html2wt +!! html +<meta property="mw:PageProp/forcetoc" data-parsoid='{"magicSrc":"__NOTOC__"}'/> !! wikitext __FORCETOC__ -!! html -<meta property="mw:PageProp/forcetoc" data-parsoid='{"src":"__NOTOC__","magicSrc":"__NOTOC__"}'/> !! end !! test @@ -8516,7 +9332,7 @@ language=de !! wikitext __NOEDITSECTION__ !! html -<meta property="mw:PageProp/noeditsection" data-parsoid='{"src":"__NOEDITSECTION__","magicSrc":"__NOEDITSECTION__"}'/> +<meta property="mw:PageProp/noeditsection" data-parsoid='{"magicSrc":"__NOEDITSECTION__"}'/> !! end ### @@ -8541,6 +9357,28 @@ RFC 822 !! end !! test +Magic links: RFC (bug 65278) +!! wikitext +This is RFC 822 but thisRFC 822 is not RFC 822linked. +!! html +<p>This is <a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc822">RFC 822</a> but thisRFC 822 is not RFC 822linked. +</p> +!! end + +!! test +Magic links: RFC (w/ non-newline whitespace, bug 28950/29025) +!! wikitext +RFC      822 +RFC +822 +!! html +<p><a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc822">RFC 822</a> +RFC +822 +</p> +!! end + +!! test Magic links: ISBN (bug 1937) !! wikitext ISBN 0-306-40615-2 @@ -8550,6 +9388,34 @@ ISBN 0-306-40615-2 !! end !! test +Magic links: ISBN (bug 65278) +!! wikitext +This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked. +!! html/php +<p>This is <a href="/wiki/Special:BookSources/9780316098113" class="internal mw-magiclink-isbn">ISBN 978-0-316-09811-3</a> but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked. +</p> +!! html/parsoid +<p>This is <a href="./Special:BookSources/9780316098113" rel="mw:ExtLink">ISBN 978-0-316-09811-3</a> but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.</p> +!! end + +!! test +Magic links: ISBN (w/ non-newline whitespace, bug 28950/29025) +!! wikitext +ISBN      978 0 316 09811 3 +ISBN +9780316098113 +ISBN 978 +0316098113 +!! html +<p><a href="/wiki/Special:BookSources/9780316098113" class="internal mw-magiclink-isbn">ISBN 978 0 316 09811 3</a> +ISBN +9780316098113 +ISBN 978 +0316098113 +</p> +!! end + +!! test Magic links: PMID incorrectly converts space to underscore !! wikitext PMID 1234 @@ -8558,6 +9424,28 @@ PMID 1234 </p> !! end +!! test +Magic links: PMID (bug 65278) +!! wikitext +This is PMID 1234 but thisPMID 1234 is not PMID 1234linked. +!! html +<p>This is <a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a> but thisPMID 1234 is not PMID 1234linked. +</p> +!! end + +!! test +Magic links: PMID (w/ non-newline whitespace, bug 28950/29025) +!! wikitext +PMID      1234 +PMID +1234 +!! html +<p><a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a> +PMID +1234 +</p> +!! end + ### ### Templates #### @@ -8783,8 +9671,7 @@ Template with complex template as argument !! test Template with thumb image (with link in description) !! wikitext -{{paramtest| - param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} +{{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&wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a> <div class="thumbcaption"><a href="/index.php?title=No_link&action=edit&redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&action=edit&redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div> @@ -8795,6 +9682,8 @@ This is a test template with parameter <div class="thumb tright"><div class="thu <div class="thumbcaption"><a href="/index.php?title=No_link&action=edit&redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&action=edit&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":"missing-image","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> !! end !! article @@ -8853,15 +9742,6 @@ Template parameter as link source </p> !! end -!!test -Template-generated attribute string (k='v') -!! wikitext -<span {{attr_str|id|v1}}>bar</span> -!! html -<p><span id="v1">bar</span> -</p> -!!end - !!article Template:paramtest2 !! text @@ -9237,19 +10117,15 @@ some <h3><span class="mw-headline" id="here">here</span></h3> !! html/parsoid -<!-- comment --><meta typeof="mw:Includes/NoInclude" data-parsoid='{"src":"<noinclude>"}'/><!-- comment --><meta typeof="mw:Includes/NoInclude/End" data-parsoid='{"src":"</noinclude>"}'/><!-- comment --> -<h2 data-parsoid='{}'> hu </h2> +<!-- comment --><meta typeof="mw:Includes/NoInclude" data-parsoid='{"src":"<noinclude>"}'/><!-- comment --><meta typeof="mw:Includes/NoInclude/End" data-parsoid='{"src":"</noinclude>"}'/><!-- comment --><h2> hu </h2> <meta typeof="mw:Includes/NoInclude" data-parsoid='{"src":"<noinclude>"}'/> +<p>some</p> +<meta typeof="mw:Includes/NoInclude/End" data-parsoid='{"src":"</noinclude>"}'/><ul><li> stuff</li> +<li> here</li></ul> -<p data-parsoid='{}'>some</p> -<meta typeof="mw:Includes/NoInclude/End" data-parsoid='{"src":"</noinclude>"}'/> -<ul data-parsoid='{}'> -<li data-parsoid='{}'> stuff</li> - -<li data-parsoid='{}'> here</li></ul> +<meta typeof="mw:Includes/IncludeOnly" data-parsoid='{"src":"<includeonly>can have stuff</includeonly>"}'/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid='{"src":""}'/><h3> here </h3> -<h3 data-parsoid='{}'> here </h3> !! end # TODO: test with DOM fragment reuse! @@ -9270,25 +10146,17 @@ c}}d b}} !! html -a<span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b -<table></table>c"}},"i":0}}]}'>b</span> -<table about="#mwt1"></table><span about="#mwt1">c</span>d +<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["a",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b<table></table>c"}},"i":0}},"d"]}' data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}'>ab</p><table about="#mwt1" data-parsoid='{"stx":"html"}'></table><p about="#mwt1">cd</p> +<p about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":["a",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b\n<table></table>\nc"}},"i":0}},"d"]}' data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}'>ab</p><span about="#mwt2"> +</span><table about="#mwt2" data-parsoid='{"stx":"html"}'></table><span about="#mwt2"> +</span><p about="#mwt2">cd</p> -<p about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":["a",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"b\n<table></table>\nc"}},"i":0}},"d"]}'>ab</p><span about="#mwt2"> -</span> -<table about="#mwt2"></table><span about="#mwt2"> -</span> -<p about="#mwt2">cd</p> - +<p about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a\n\n<table></table>\n\nb"}},"i":0}}]}' data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]}]]}'>a</p><span about="#mwt3"> -<p about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a\n\n<table></table>\n\nb"}},"i":0}}]}'>a</p><span about="#mwt3"> - -</span> -<table about="#mwt3"></table><span about="#mwt3"> +</span><table about="#mwt3" data-parsoid='{"stx":"html"}'></table><span about="#mwt3"> -</span> -<p about="#mwt3">b</p> +</span><p about="#mwt3">b</p> !! end !! test @@ -9405,11 +10273,9 @@ parsoid=wt2html,wt2wt |foo |} !!html/parsoid -<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":""}},"i":0}}]}'></span> -<table width="100%"> -<tbody> -<tr> -<td>foo</td></tr></tbody></table> +<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":""}},"i":0}}]}'></span><table width="100%"> +<tbody><tr><td>foo</td></tr> +</tbody></table> !!end !!test @@ -9421,7 +10287,7 @@ parsoid=wt2html,wt2wt |c |} !!html/parsoid -<meta typeof="mw:Includes/IncludeOnly" data-parsoid='{"src":"<includeonly>a</includeonly>"'/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid='{"src":""}'/><table about="#mwt2" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"{{{b}}}","html":"<span about=\"#mwt1\" typeof=\"mw:Param\" data-parsoid=\"{&quot;dsr&quot;:[31,38,null,null],&quot;src&quot;:&quot;{{{b}}}&quot;}\">{{{b}}}</span>"},{"html":""}]]}' data-parsoid='{"a":{"{{{b}}}":null},"sa":{"{{{b}}}":""}}'> +<meta typeof="mw:Includes/IncludeOnly"/><meta typeof="mw:Includes/IncludeOnly/End"/><table about="#mwt2" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"{{{b}}}","html":"<span about=\"#mwt1\" typeof=\"mw:Param\" data-parsoid=\"{&quot;dsr&quot;:[31,38,null,null],&quot;src&quot;:&quot;{{{b}}}&quot;}\">{{{b}}}</span>"},{"html":""}]]}' data-parsoid='{"a":{"{{{b}}}":null},"sa":{"{{{b}}}":""}}'> <tbody><tr><td>c</td></tr> </tbody></table> @@ -9592,7 +10458,7 @@ Templates: Correctly encapsulate templates producing </p> tag without a correspo b</p>}} !! html/parsoid <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a\nb</p>"}},"i":0}}]}'>a -b</p><p></p> +b</p> !!end !!test @@ -9718,6 +10584,9 @@ Templates: HTML Tag: 6. Generation of end piece of HTML attr value !!end +# SSS FIXME: While it is great we added support for all this, +# do we want to make this part of the spec? Maybe we want to +# deprecate this kind of usage in the future? !!test Templates: HTML Tag: 7. Generation of partial attribute key string !! wikitext @@ -9727,6 +10596,79 @@ Templates: HTML Tag: 7. Generation of partial attribute key string !!end +!! test +Templates: HTML Tag: 8. Template-generated attribute (k=v) +!! wikitext +<div {{echo|1=id="v1"}}>bar</div> +!! html +<div id="v1">bar</div> + +!!end + +!! test +Templates: HTML Tag: 9. Multiple template-generated attributes +!! wikitext +<div {{echo|1=id="v1" title="foo"}}>bar</div> +!! html +<div id="v1" title="foo">bar</div> + +!!end + +!! test +Templates: Support for templates generating attributes and content +!! wikitext +{| {{mixed_attr_content_template}} +|- +|bar +|} +!! html/php +<table style="color:red;" title="T48811"> + +<tr> +<td>foo +</td></tr> +<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> +<td>foo</td></tr> +<tr> +<td>bar</td></tr> +</tbody></table> +!!end + +!! test +1. Entities and nowikis inside templated attributes should be handled correctly +!! wikitext +<div {{echo|style{{=}}"background:#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":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[5,49,null,null]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;style{{=}}\\&quot;background:&amp;#35;f9f9f9;\\&quot;&quot;}},&quot;i&quot;:0}}]}\">style</span><span typeof=\"mw:Nowiki\" about=\"#mwt1\" data-parsoid=\"{}\">=</span><span about=\"#mwt1\" data-parsoid=\"{}\">\"background:</span><span typeof=\"mw:Entity\" about=\"#mwt1\" data-parsoid=\"{&quot;src&quot;:&quot;&amp;#35;&quot;,&quot;srcContent&quot;:&quot;#&quot;}\">#</span><span about=\"#mwt1\" data-parsoid=\"{}\">f9f9f9;\"</span>"},{"html":""}]]}'>foo</div> +!! end + +!! test +2. Entities and nowikis inside templated attributes should be handled correctly +!! wikitext +{| +|{{table_attribs_3}} +|} +!! html/php +<table> +<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> +</tbody></table> +!! end + !!test Templates: HTML Tables: 1. Generating start of a HTML table !! wikitext @@ -10700,26 +11642,26 @@ parsoid=wt2html Parsoid: Escape nowiki with trailing space in tags !! options parsoid=html2wt +!! html +<p><nowiki > foo </nowiki ></p> +<p>a<nowiki />b</p> +<p>c<nowiki/ >d</p> !! wikitext <nowiki > foo </nowiki > a<nowiki />b c<nowiki/ >d -!! html -<p><nowiki > foo </nowiki ></p> -<p>a<nowiki />b</p> -<p>c<nowiki/ >d</p> !! end !! test Parsoid: Escape weird noWikI capitalizations !! options parsoid=html2wt -!! wikitext -<noWikI > foo </NoWikI > !! html <p><noWikI > foo </NoWikI ></p> +!! wikitext +<noWikI > foo </NoWikI > !! end ### @@ -10841,8 +11783,7 @@ parsoid=wt2html,wt2wt,html2html <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span 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" height="220" width="1941"></a></span> -</p> +<p><span 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></span></p> !! end !! test @@ -10853,8 +11794,7 @@ Simple image (using File: namespace, now canonical) <p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span 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" height="220" width="1941"></a></span> -</p> +<p><span 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></span></p> !! end !! test @@ -10865,7 +11805,7 @@ Right-aligned image <div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" 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" 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></figure> !! end !! test @@ -10876,7 +11816,7 @@ Image with caption <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" 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" height="220" width="1941"></a><figcaption>Caption text</figcaption></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>Caption text</figcaption></figure> !! end !! test @@ -10887,7 +11827,7 @@ Image with caption, bug 53312 #1 <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" 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" height="220" width="1941"></a><figcaption>Caption page stuff</figcaption></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>Caption page stuff</figcaption></figure> !! end !! test @@ -10898,7 +11838,7 @@ Image with caption, bug 53312 #2 <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" 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" height="220" width="1941"></a><figcaption>Caption page=</figcaption></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>Caption page=</figcaption></figure> !! end !! test @@ -10909,7 +11849,7 @@ Image with caption, bug 53312 #3 <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" 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" height="220" width="1941"></a><figcaption>Caption page=stuff</figcaption></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>Caption page=stuff</figcaption></figure> !! end !! test @@ -10925,13 +11865,22 @@ thumbsize=220 <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" 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&action=edit&redlink=1" class="new" title="Link1 (page does not exist)">Link1</a> [[]] <a href="/index.php?title=Link2&action=edit&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"}],"dsr":[0,59,2,2]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"dsr":[2,null,null,null]}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" height="25" width="220" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption data-parsoid='{"dsr":[null,57,null,null]}'>Caption <a rel="mw:WikiLink" href="./Link1" title="Link1" data-parsoid='{"stx":"simple","a":{"href":"./Link1"},"sa":{"href":"Link1"},"dsr":[32,41,2,2]}'>Link1</a> +<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> [[]] -<a rel="mw:WikiLink" href="./Link2" title="Link2" data-parsoid='{"stx":"simple","a":{"href":"./Link2"},"sa":{"href":"Link2"},"dsr":[47,56,2,2]}'>Link2</a> +<a rel="mw:WikiLink" href="./Link2" title="Link2" data-parsoid='{"stx":"simple","a":{"href":"./Link2"},"sa":{"href":"Link2"}}'>Link2</a> </figcaption></figure> !! end !! test +Titles in unlinked images (T23454) +!! wikitext +[[File:Foobar.jpg|link=|stuff]] +!! html/php +<p><img alt="stuff" src="http://example.com/images/3/3a/Foobar.jpg" title="stuff" width="1941" height="220" /> +</p> +!! end + +!! test Link with empty target !! wikitext [[]] @@ -10941,6 +11890,17 @@ Link with empty target !! end !! test +Image with link trail +!! wikitext +Linktrails should not work for images: [[File:Foobar.jpg]]s +!! html/php +<p>Linktrails should not work for images: <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>s +</p> +!! html/parsoid +<p>Linktrails should not work for images: <span 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></span>s</p> +!! end + +!! test Image with empty attribute !! options parsoid=wt2html,wt2wt,html2html @@ -10950,7 +11910,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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" height="220" width="1941"></a><figcaption>Caption text</figcaption></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>Caption text</figcaption></figure> !! end !! test @@ -10961,7 +11921,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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" data-mw='{"attribs":[["thumbnail",{"html":"thumb"}],["width",{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;137px&quot;}},&quot;i&quot;:0}}]}\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[24,38,null,null]}\">137px</span>"}]]}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="16" width="137"/></a><figcaption>This is a caption</figcaption></figure> +<figure typeof="mw:Image/Thumb mw:ExpandedAttrs" about="#mwt2" data-mw='{"attribs":[["thumbnail",{"html":"thumb"}],["width",{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[24,38,null,null]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;137px&quot;}},&quot;i&quot;:0}}]}\">137px</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="16" width="137"/></a><figcaption>This is a caption</figcaption></figure> !! end !! test @@ -10972,7 +11932,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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" data-mw='{"attribs":[["thumbnail",{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;thumb&quot;}},&quot;i&quot;:0}}]}\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[18,32,null,null]}\">thumb</span>"}],["width",{"html":"<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;137px&quot;}},&quot;i&quot;:0}}]}\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[33,47,null,null]}\">137px</span>"}]]}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="16" width="137"/></a><figcaption>This is a caption</figcaption></figure> +<figure typeof="mw:Image/Thumb mw:ExpandedAttrs" about="#mwt3" data-mw='{"attribs":[["thumbnail",{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[18,32,null,null]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;thumb&quot;}},&quot;i&quot;:0}}]}\">thumb</span>"}],["width",{"html":"<span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[33,47,null,null]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;137px&quot;}},&quot;i&quot;:0}}]}\">137px</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="16" width="137"/></a><figcaption>This is a caption</figcaption></figure> !! end !! test @@ -10983,7 +11943,7 @@ parsoid=wt2html,wt2wt,html2html <p><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" width="50" height="6" 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> </p> !! html/parsoid -<p><span typeof="mw:Image mw:ExpandedAttrs" about="#mwt2" data-mw='{"attribs":[["width",{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;50px&quot;}},&quot;i&quot;:0}}]}\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[18,31,null,null]}\">50px</span>"}]]}' data-parsoid='{"optList":[{"ck":"width","ak":"{{echo|50px}}"}]}'><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/50px-Foobar.jpg" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p> +<p><span typeof="mw:Image mw:ExpandedAttrs" about="#mwt2" data-parsoid='{"optList":[{"ck":"width","ak":"{{echo|50px}}"}]}' data-mw='{"attribs":[["width",{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]],&quot;dsr&quot;:[18,31,null,null]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;50px&quot;}},&quot;i&quot;:0}}]}\">50px</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/50px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50"/></a></span></p> !! end ## Parsoid does not provide editing support for images where templates produce multiple image attributes. @@ -10996,10 +11956,9 @@ Image with multiple attributes from the same template <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" 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" height="220" width="1941"></a><figcaption>Caption text</figcaption></figure> +<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 -# Parsoid's output here is broken (incorrect p-wrapping); see bug 64901. !! test Image with link tails !! options @@ -11028,9 +11987,9 @@ thumbsize=220 </div> <p>456</p> !! html/parsoid -<p>123<span 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" height="220" width="1941"></a></span>456</p> -123<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" height="220" width="1941"></a></figure>456 -123<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/180px-Foobar.jpg" height="25" width="220"></a></figure>456 +<p>123<span 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></span>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</p> +<p>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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a></figure><p>456</p> !! end !! test @@ -11041,7 +12000,7 @@ Image with multiple captions -- only last one is accepted <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" 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" height="220" width="1941"></a><figcaption>Caption3 - accepted</figcaption></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>Caption3 - accepted</figcaption></figure> !! end !! test @@ -11052,7 +12011,7 @@ Image with multiple widths -- use last <p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg" 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> </p> !! html/parsoid -<p><span typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="34" width="300"/></a></span></p> +<p><span typeof="mw:Image" data-mw='{"caption":"caption"}'><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="34" width="300"/></a></span></p> !! end !! test @@ -11068,8 +12027,8 @@ thumbsize=220 <p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" style="vertical-align: middle" /></a> </p> !! 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>caption</figcaption></figure> -<p><span class="mw-default-size mw-valign-middle" typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>caption</figcaption></figure> +<p><span class="mw-default-size mw-valign-middle" typeof="mw:Image" data-mw='{"caption":"caption"}'><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></span></p> !! end !! test @@ -11084,9 +12043,9 @@ 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" 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" 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" 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" 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/3/3a/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/3/3a/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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="23" width="200"/></a><figcaption>Caption</figcaption></figure> !! end # a sad bit of backward-compatibility @@ -11102,7 +12061,7 @@ parsoid=wt2html,wt2wt,html2html <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/177px-Foobar.jpg" width="177" height="20" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/265px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/353px-Foobar.jpg 2x" /></a> </p> !! html/parsoid -<p><span typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="2" width="20"/></a></span><span typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="20" width="177"/></a></span></p> +<p><span 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="2" width="20"/></a></span> <span 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="20" width="177"/></a></span></p> !! end !! test @@ -11113,7 +12072,7 @@ Image with link parameter, wiki target <p><a href="/wiki/Main_Page" title="Main Page"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image"><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image"><a href="Main_Page"><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></span></p> !! end # parsoid bug 49293 (part 1) @@ -11125,7 +12084,7 @@ Image with link parameter, URL target <p><a href="http://example.com/" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image"><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image"><a href="http://example.com/"><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></span></p> !! end # parsoid bug 49293 (part 2) @@ -11137,7 +12096,7 @@ Image with link parameter, protocol-less URL target <p><a href="//example.com/" rel="nofollow"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image"><a href="//example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image"><a href="//example.com/"><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></span></p> !! end !! test @@ -11192,7 +12151,7 @@ Image with empty link parameter <p><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image"><span><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></span></span></p> +<p><span class="mw-default-size" typeof="mw:Image"><span><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"/></span></span></p> !! end !! test @@ -11203,7 +12162,7 @@ Image with link parameter (wiki target) and unnamed parameter <p><a href="/wiki/Main_Page" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="Main_Page"><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></span></p> !! end !! test @@ -11214,7 +12173,7 @@ Image with link parameter (URL target) and unnamed parameter <p><a href="http://example.com/" title="Title" rel="nofollow"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="http://example.com/"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="http://example.com/"><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></span></p> !! end !! test @@ -11228,7 +12187,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>Title</figcaption></figure> +<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="http://example.com/"><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="25" width="220"/></a><figcaption>Title</figcaption></figure> !! end !! test @@ -11241,7 +12200,7 @@ thumbsize=220 <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" 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" height="135" width="135"/></a><figcaption>Title</figcaption></figure> +<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 !! test @@ -11255,7 +12214,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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" height="135" width="135"/></a><figcaption>Title</figcaption></figure> +<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> !! end !! test @@ -11269,7 +12228,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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" height="135" width="135"/></a><figcaption>Title</figcaption></figure> +<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> !! end !! test @@ -11283,7 +12242,7 @@ parsoid=wt2html,wt2wt,html2html <div class="thumb tright"><div class="thumbinner" style="width:137px;"><img alt="" src="http://example.com/images/e/ea/Thumb.png" 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" height="135" width="135"/></span><figcaption>Title</figcaption></figure> +<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> !! end !! test @@ -11297,7 +12256,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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" height="135" width="135"/></a><figcaption>Title</figcaption></figure> +<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> !! end !! test @@ -11310,7 +12269,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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" 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> +<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 !! test @@ -11323,7 +12282,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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" 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> +<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 !! test @@ -11339,8 +12298,19 @@ parsoid=wt2html,wt2wt,html2html </p><p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="testing bold in alt" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw="{"caption":"testing '''bold''' in alt"}"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> -<p><span class="mw-default-size" typeof="mw:Image"><a href="File:Foobar.jpg"><img alt="testing bold in alt" resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw="{"caption":"testing '''bold''' in alt"}"><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></span></p> +<p><span class="mw-default-size" typeof="mw:Image"><a href="./File: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"/></a></span></p> +!! end + +!! test +Alt image option should handle most kinds of wikitext without barfing +!! wikitext +[[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" 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|''bold template''}}."}]}' data-mw='{"attribs":[["thumbnail",{"html":"thumb"}],["alt",{"html":"alt=This is a <a rel=\"mw:WikiLink\" href=\"./Link\" title=\"Link\" data-parsoid=\"{&quot;stx&quot;:&quot;simple&quot;,&quot;a&quot;:{&quot;href&quot;:&quot;./Link&quot;},&quot;sa&quot;:{&quot;href&quot;:&quot;link&quot;},&quot;dsr&quot;:[65,73,2,2]}\">link</a> and a <i about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;dsr&quot;:[80,106,null,null],&quot;pi&quot;:[[{&quot;k&quot;:&quot;1&quot;,&quot;spc&quot;:[&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]}]]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;echo&quot;,&quot;href&quot;:&quot;./Template:Echo&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;''bold template''&quot;}},&quot;i&quot;:0}}]}\">bold template</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|''bold template''}}.","resource":"Image:Foobar.jpg"}}'/></a><figcaption>This is the image caption</figcaption></figure> !! end ################### @@ -11364,9 +12334,9 @@ parsoid=wt2html,wt2wt,html2html </p><p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" 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> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a></span></p> -<p><span class="mw-default-size" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a></span></p> -<p><span class="mw-default-size" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}'><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="25" width="220"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}'><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="25" width="220"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}'><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="25" width="220"/></a></span></p> !! end !! test @@ -11383,7 +12353,9 @@ 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" 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" 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" 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" 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> +<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> !! end !! test @@ -11400,7 +12372,9 @@ 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" 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/3/3a/Foobar.jpg" 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/3/3a/Foobar.jpg" 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/3/3a/Foobar.jpg" 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/3/3a/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/3/3a/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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>caption</figcaption></figure> !! end ################### @@ -11427,8 +12401,8 @@ parsoid=wt2html,wt2wt,html2html </p><p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="2000" height="227" class="thumbborder" /></a> </p> !! html/parsoid -<p><span typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="227" width="2000"/></a></span></p> -<p><span class="mw-image-border" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="227" width="2000"/></a></span></p> +<p><span 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="227" width="2000"/></a></span></p> +<p><span class="mw-image-border" 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="227" width="2000"/></a></span></p> !! end !! test @@ -11444,8 +12418,8 @@ parsoid=wt2html,wt2wt,html2html </p><p><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/1000px-Foobar.jpg" width="1000" height="113" class="thumbborder" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/1500px-Foobar.jpg 1.5x, http://example.com/images/3/3a/Foobar.jpg 2x" /></a> </p> !! html/parsoid -<p><span typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="113" width="1000"/></a></span></p> -<p><span class="mw-image-border" typeof="mw:Image"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="113" width="1000"/></a></span></p> +<p><span 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="113" width="1000"/></a></span></p> +<p><span class="mw-image-border" 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="113" width="1000"/></a></span></p> !! end !! test @@ -11458,7 +12432,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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/3/3a/Foobar.jpg" 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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50"/></a></figure> !! end !! test @@ -11474,8 +12448,8 @@ parsoid=wt2html,wt2wt,html2html <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" 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" 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/f/ff/Foobar.svg" 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></figure> +<figure typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/f/ff/Foobar.svg" data-file-width="240" data-file-height="180" data-file-type="drawing" height="1500" width="2000"/></a></figure> !! end !! test @@ -11488,7 +12462,7 @@ parsoid=wt2html,wt2wt,html2html <p><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" width="50" height="6" 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> </p> !! html/parsoid -<p><span typeof="mw:Image/Frameless"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="6" width="50"/></a></span></p> +<p><span typeof="mw:Image/Frameless"><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="6" width="50"/></a></span></p> !! end !! test @@ -11504,8 +12478,8 @@ parsoid=wt2html,wt2wt,html2html </p><p><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" width="2000" height="1500" 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> </p> !! html/parsoid -<p><span typeof="mw:Image/Frameless"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> -<p><span typeof="mw:Image/Frameless"><a href="File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/f/ff/Foobar.svg" height="1500" width="2000"/></a></span></p> +<p><span typeof="mw:Image/Frameless"><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></span></p> +<p><span typeof="mw:Image/Frameless"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/f/ff/Foobar.svg" data-file-width="240" data-file-height="180" data-file-type="drawing" height="1500" width="2000"/></a></span></p> !! end !! test @@ -11527,7 +12501,10 @@ 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" 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" 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" 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" 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" 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></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> !! end ################### @@ -11560,7 +12537,7 @@ Frameless image caption with a free URL <p><a href="/wiki/File:Foobar.jpg" class="image" title="http://example.com"><img alt="http://example.com" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"http://example.com"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"http://example.com"}'><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></span></p> !! end !! test @@ -11573,7 +12550,7 @@ thumbsize=220 <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" 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com">http://example.com</a></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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com">http://example.com</a></figcaption></figure> !! end !! test @@ -11587,7 +12564,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com">http://example.com</a></figcaption></figure> +<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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com">http://example.com</a></figcaption></figure> !! end !! test @@ -11599,7 +12576,7 @@ SVG thumbnails with no language set <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" 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/f/ff/Foobar.svg" height="165" width="220"/></a><figcaption>caption</figcaption></figure> +<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/f/ff/Foobar.svg" data-file-width="240" data-file-height="180" data-file-type="drawing" height="165" width="220"/></a><figcaption>caption</figcaption></figure> !! end !! test @@ -11612,7 +12589,7 @@ parsoid=wt2html,wt2wt,html2html <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=File:Foobar.svg&lang=de" class="image"><img alt="" src="http://example.com/images/thumb/f/ff/Foobar.svg/langde-180px-Foobar.svg.png" 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/f/ff/Foobar.svg" lang="de" height="165" width="220"/></a><figcaption>caption</figcaption></figure> +<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/f/ff/Foobar.svg" lang="de" data-file-width="240" data-file-height="180" data-file-type="drawing" height="165" width="220"/></a><figcaption>caption</figcaption></figure> !! end !! test @@ -11625,7 +12602,7 @@ parsoid=wt2html,wt2wt,html2html <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" 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/f/ff/Foobar.svg" height="165" width="220"/></a><figcaption>lang=invalid.language.code</figcaption></figure> +<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/f/ff/Foobar.svg" 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 !! test @@ -11636,7 +12613,7 @@ BUG 1887: A ISBN with a thumbnail <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" 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption><a href="Special:BookSources/1235467890" rel="mw:ExtLink">ISBN 1235467890</a></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/3/3a/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:ExtLink">ISBN 1235467890</a></figcaption></figure> !! end !! test @@ -11647,7 +12624,7 @@ BUG 1887: A RFC with a thumbnail <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" 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="//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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>This is <a href="//tools.ietf.org/html/rfc12354" rel="mw:ExtLink">RFC 12354</a></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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>This is <a href="//tools.ietf.org/html/rfc12354" rel="mw:ExtLink">RFC 12354</a></figcaption></figure> !! end !! test @@ -11658,7 +12635,7 @@ BUG 1887: A mailto link with a thumbnail <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" 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>Please <a rel="mw:ExtLink" href="mailto:nobody@example.com">mailto:nobody@example.com</a></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/3/3a/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" href="mailto:nobody@example.com">mailto:nobody@example.com</a></figcaption></figure> !! end # Pending resolution to bug 368 @@ -11670,7 +12647,7 @@ BUG 648: Frameless image caption with a link <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"text with a [[link]] in it"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"text with a [[link]] in it"}'><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></span></p> !! end !! test @@ -11681,7 +12658,7 @@ BUG 648: Frameless image caption with a link (suffix) <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a linkfoo in it"><img alt="text with a linkfoo in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"text with a [[link]]foo in it"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"text with a [[link]]foo in it"}'><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></span></p> !! end !! test @@ -11692,7 +12669,7 @@ BUG 648: Frameless image caption with an interwiki link <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a MeatBall:Link in it"><img alt="text with a MeatBall:Link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"text with a [[MeatBall:Link]] in it"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"text with a [[MeatBall:Link]] in it"}'><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></span></p> !! end !! test @@ -11703,7 +12680,7 @@ BUG 648: Frameless image caption with a piped interwiki link <p><a href="/wiki/File:Foobar.jpg" class="image" title="text with a link in it"><img alt="text with a link in it" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"text with a [[MeatBall:Link|link]] in it"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"text with a [[MeatBall:Link|link]] in it"}'><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></span></p> !! end !! test @@ -11714,7 +12691,7 @@ Escape HTML special chars in image alt text <p><a href="/wiki/File:Foobar.jpg" class="image" title="& < > ""><img alt="& < > "" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"& < > \""}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"& < > \""}'><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></span></p> !! end !! test @@ -11725,7 +12702,7 @@ BUG 499: Alt text should have Ӓ, not &1234; <p><a href="/wiki/File:Foobar.jpg" class="image" title="♀"><img alt="♀" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"&#9792;"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"&#9792;"}'><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></span></p> !! end !! test @@ -11749,7 +12726,7 @@ Image caption containing another image <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" 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" 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>This is a caption with another <span 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" height="135" width="135"/></a></span> inside it!</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/3/3a/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 <span 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></span> inside it!</figcaption></figure> !! end !! test @@ -11761,7 +12738,7 @@ Image: caption containing a newline <p><a href="/wiki/File:Foobar.jpg" class="image" title="This *is some text"><img alt="This *is some text" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"This\n*is some text"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"This\n*is some text"}'><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></span></p> !!end !!test @@ -11773,7 +12750,7 @@ Image: caption containing leading space <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" 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption> bar</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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption> bar</figcaption></figure> !!end !! test @@ -11792,7 +12769,7 @@ and some more text.]] <div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This is an example image thumbnail caption with a table <table> <tr> <th> Foo </th> <th> Bar </th></tr> <tr> <td> Foo1 </td> <td> Bar1 </td></tr></table> and some more text.</div></div></div> !! html/parsoid -<figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="23" width="200"/></a><figcaption>This is an example image thumbnail caption with a table +<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="23" width="200"/></a><figcaption>This is an example image thumbnail caption with a table <table> <tbody> <tr><th>Foo </th><th>Bar</th></tr> @@ -11809,7 +12786,7 @@ Bug 3090: External links other than http: in image captions <div class="thumb tright"><div class="thumbinner" style="width:202px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>This 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/3/3a/Foobar.jpg" height="23" width="200"/></a><figcaption>This caption has <a rel="mw:ExtLink" href="irc://example.net">irc</a> and <a rel="mw:ExtLink" href="https://example.com">Secure</a> ext links in it.</figcaption></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="23" width="200"/></a><figcaption>This caption has <a rel="mw:ExtLink" href="irc://example.net">irc</a> and <a rel="mw:ExtLink" href="https://example.com">Secure</a> ext links in it.</figcaption></figure> !! end !! test @@ -11822,7 +12799,7 @@ parsoid=wt2html,wt2wt,html2html <p><a href="/wiki/File:Foobar.jpg" class="image" title="a"><img alt="a" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="b" /></a> </p> !! html/parsoid -<p><span class="mw-default-size b" typeof="mw:Image" data-mw='{"caption":"a"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"/></a></span></p> +<p><span class="mw-default-size b" typeof="mw:Image" data-mw='{"caption":"a"}'><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></span></p> !! end !! test @@ -11836,7 +12813,7 @@ language=es <div class="floatleft"><a href="/wiki/Foo" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" 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" height="220" width="1941"/></a><figcaption>caption</figcaption></figure> +<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 !! test @@ -11851,7 +12828,7 @@ language=es <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" 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>caption</figcaption></figure> +<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><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="25" width="220"/></a><figcaption>caption</figcaption></figure> !! end !! test @@ -11865,7 +12842,7 @@ parsoid=wt2html,wt2wt,html2html <p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" width="220" height="25" class="extra thumbborder" 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> </p> !! html/parsoid -<p><span class="mw-default-size mw-image-border extra" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}'><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="25" width="220"/></a></span></p> +<p><span class="mw-default-size mw-image-border extra" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}'><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="25" width="220"/></a></span></p> !! end # Note that 'right' is the default alignment, despite the misspelled 'righ' below @@ -11886,7 +12863,9 @@ 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" 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/3/3a/Foobar.jpg" 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>caption</figcaption></figure><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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>caption</figcaption></figure> +<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/3/3a/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/3/3a/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 mw-halign-left" 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="25" width="220"/></a><figcaption>caption</figcaption></figure> !! end !! article @@ -11895,11 +12874,13 @@ File:Barfoo.jpg #REDIRECT [[File:Barfoo.jpg]] !! endarticle +# FIXME: Parsoid should run this test -- but we'd need to teach the +# mockAPI about the redirected Barfoo.jpg image. !! test Redirected image !! wikitext [[Image:Barfoo.jpg]] -!! html +!! html/php <p><a href="/wiki/File:Barfoo.jpg" title="File:Barfoo.jpg">File:Barfoo.jpg</a> </p> !! end @@ -11909,10 +12890,12 @@ Missing image with uploads disabled !! options wgEnableUploads=0 !! wikitext -[[Image:Foobaz.jpg]] -!! html +[[File:Foobaz.jpg]] +!! html/php <p><a href="/wiki/File:Foobaz.jpg" title="File:Foobaz.jpg">File:Foobaz.jpg</a> </p> +!! html/parsoid +<p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","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></span></p> !! end # Parsoid-specific testing for images @@ -11927,12 +12910,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|middle|50px]] !! html/parsoid -<p><span class="mw-valign-middle" typeof="mw:Image"> -<a href="File:Foobar.jpg"> -<img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50"> -</a> -</span> -</p> +<p><span class="mw-valign-middle" 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="6" width="50"/></a></span></p> !! end !! test @@ -11943,12 +12921,7 @@ parsoid=wt2wt,wt2html,html2html !! wikitext [[Image:Foobar.jpg|middle|50px]] !! html/parsoid -<p><span class="mw-valign-middle" typeof="mw:Image"> -<a href="File:Foobar.jpg"> -<img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50"> -</a> -</span> -</p> +<p><span class="mw-valign-middle" 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="6" width="50"/></a></span></p> !! end !! test @@ -11957,7 +12930,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|50px|middle]] !! html/parsoid -<p><span class="mw-valign-middle" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":"50px"},{"ck":"middle","ak":"middle"}]}'><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/50px-Foobar.jpg" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p> +<p><span class="mw-valign-middle" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"width","ak":"50px"},{"ck":"middle","ak":"middle"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"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="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p> !! end !! test @@ -11968,12 +12941,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[Image:Foobar.jpg|50px|middle]] !! html/parsoid -<p><span class="mw-valign-middle" typeof="mw:Image"> -<a href="File:Foobar.jpg"> -<img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg" height="6" width="50"> -</a> -</span> -</p> +<p><span class="mw-valign-middle" 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="6" width="50"/></a></span></p> !! end !! test @@ -11981,7 +12949,7 @@ Parsoid-specific image handling - simple image with both sizes, a baseline align !! wikitext [[File:Foobar.jpg|500x10px|baseline|caption]] !! html/parsoid -<p><span class="mw-valign-baseline" typeof="mw:Image" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"width","ak":"500x10px"},{"ck":"baseline","ak":"baseline"},{"ck":"caption","ak":"caption"}],"size":"500x10"}'><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/89px-Foobar.jpg" height="10" width="89" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"10","width":"89"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p> +<p><span class="mw-valign-baseline" typeof="mw:Image" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"width","ak":"500x10px"},{"ck":"baseline","ak":"baseline"},{"ck":"caption","ak":"caption"}],"size":"500x10"}'><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/89px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="10" width="89" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"10","width":"89"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p> !! end !! test @@ -11989,7 +12957,7 @@ Parsoid-specific image handling - simple image with border and size spec !! wikitext [[File:Foobar.jpg|50px|border|caption]] !! html/parsoid -<p><span class="mw-image-border" typeof="mw:Image" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"width","ak":"50px"},{"ck":"border","ak":"border"},{"ck":"caption","ak":"caption"}]}'><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/50px-Foobar.jpg" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p> +<p><span class="mw-image-border" typeof="mw:Image" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"width","ak":"50px"},{"ck":"border","ak":"border"},{"ck":"caption","ak":"caption"}]}'><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/50px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p> !! end !! test @@ -11997,12 +12965,7 @@ Parsoid-specific image handling - thumbnail with halign, valign, and caption !! wikitext [[File:Foobar.jpg|left|baseline|thumb|caption content]] !! html/parsoid -<figure class="mw-default-size mw-halign-left mw-valign-baseline" typeof="mw:Image/Thumb"> -<a href="File:Foobar.jpg"> -<img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" height="25" width="220" /> -</a> -<figcaption>caption content</figcaption> -</figure> +<figure class="mw-default-size mw-halign-left mw-valign-baseline" 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="25" width="220"/></a><figcaption>caption content</figcaption></figure> !! end !! test @@ -12011,7 +12974,7 @@ Parsoid-specific image handling - thumbnail with halign, valign, and caption !! wikitext [[File:Foobar.jpg|thumb|left|baseline|caption content]] !! html/parsoid -<figure class="mw-default-size mw-halign-left mw-valign-baseline" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"left","ak":"left"},{"ck":"baseline","ak":"baseline"},{"ck":"caption","ak":"caption content"}]}'><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/180px-Foobar.jpg" height="25" width="220" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>caption content</figcaption></figure> +<figure class="mw-default-size mw-halign-left mw-valign-baseline" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"left","ak":"left"},{"ck":"baseline","ak":"baseline"},{"ck":"caption","ak":"caption content"}]}'><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/180px-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 content</figcaption></figure> !! end !! test @@ -12019,12 +12982,7 @@ Parsoid-specific image handling - thumbnail with specific size, halign, valign, !! wikitext [[Image:Foobar.jpg|right|middle|thumb|50x50px|caption]] !! html/parsoid -<figure class="mw-halign-right mw-valign-middle" 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" height="6" width="50" /> -</a> -<figcaption>caption</figcaption> -</figure> +<figure class="mw-halign-right mw-valign-middle" 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="6" width="50"/></a><figcaption>caption</figcaption></figure> !! end !! test @@ -12033,7 +12991,7 @@ valign, and caption (existing content) !! wikitext [[File:Foobar.jpg|thumb|50x50px|right|middle|caption]] !! html/parsoid -<figure class="mw-halign-right mw-valign-middle" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"50x50px"},{"ck":"right","ak":"right"},{"ck":"middle","ak":"middle"},{"ck":"caption","ak":"caption"}],"size":"50x50"}'><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/50px-Foobar.jpg" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>caption</figcaption></figure> +<figure class="mw-halign-right mw-valign-middle" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"width","ak":"50x50px"},{"ck":"right","ak":"right"},{"ck":"middle","ak":"middle"},{"ck":"caption","ak":"caption"}],"size":"50x50"}'><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/50px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="6" width="50" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"6","width":"50"},"sa":{"resource":"File:Foobar.jpg"}}'/></a><figcaption>caption</figcaption></figure> !! end !! test @@ -12044,12 +13002,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|frame|500x50px|caption]] !! html/parsoid -<figure typeof="mw:Image/Frame"> -<a href="File:Foobar.jpg"> -<img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941" /> -</a> -<figcaption>caption</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>caption</figcaption></figure> !! end !! test @@ -12060,12 +13013,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|left|baseline|frame|500x50px|caption]] !! html/parsoid -<figure class="mw-halign-left mw-valign-baseline" typeof="mw:Image/Frame"> -<a href="File:Foobar.jpg"> -<img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941" /> -</a> -<figcaption>caption</figcaption> -</figure> +<figure class="mw-halign-left mw-valign-baseline" 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> !! end !! test @@ -12073,7 +13021,7 @@ Parsoid-specific image handling - frameless image with specific size, border, an !! wikitext [[File:Foobar.jpg|frameless|442x50px|border|caption]] !! html/parsoid -<p><span class="mw-image-border" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"frameless","ak":"frameless"},{"ck":"width","ak":"442x50px"},{"ck":"border","ak":"border"},{"ck":"caption","ak":"caption"}],"size":"442x50"}'><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/442px-Foobar.jpg" height="50" width="442" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"50","width":"442"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p> +<p><span class="mw-image-border" typeof="mw:Image/Frameless" data-mw='{"caption":"caption"}' data-parsoid='{"optList":[{"ck":"frameless","ak":"frameless"},{"ck":"width","ak":"442x50px"},{"ck":"border","ak":"border"},{"ck":"caption","ak":"caption"}],"size":"442x50"}'><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/442px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="50" width="442" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"50","width":"442"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></span></p> !! end !! test @@ -12081,10 +13029,7 @@ Parsoid-specific image handling - simple image with a formatted caption !! wikitext [[File:Foobar.jpg|<table><tr><td>a</td><td>b</td></tr><tr><td>c</td></tr></table>]] !! html/parsoid -<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"<table><tr><td>a</td><td>b</td></tr><tr><td>c</td></tr></table>"}'> -<a href="File:Foobar.jpg"> -<img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="220" width="1941"> -</a></span></p> +<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"<table><tr><td>a</td><td>b</td></tr><tr><td>c</td></tr></table>"}'><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></span></p> !! end !! test @@ -12092,7 +13037,7 @@ Parsoid-specific image handling - caption with a template in it !! wikitext [[File:Foobar.jpg|thumb|200x23px|This caption has a {{echo|transclusion}} in it.]] !! 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" height="23" width="200"></a><figcaption>This caption has a <span about="#mwt1" typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}">transclusion</span> in it.</figcaption></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/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 <span about="#mwt1" typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}">transclusion</span> in it.</figcaption></figure> !! end !! test @@ -12105,7 +13050,7 @@ foo bar !! html/parsoid <p>foo</p> -<figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="23" width="200"></a><figcaption>This caption has a <center>unbalanced tag in it.</center></figcaption></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="23" width="200"/></a><figcaption>This caption has a <center>unbalanced tag in it.</center></figcaption></figure> <p>bar</p> !! end @@ -12116,7 +13061,7 @@ parsoid=wt2html,wt2wt !! wikitext [[File:Foobar.jpg|thumb|]] !! 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption></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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption></figcaption></figure> !! end # empty captions don't get serialized unless we're in the "round trip" case @@ -12126,9 +13071,10 @@ Parsoid-specific image handling - empty caption (2) parsoid=html2wt !! html/parsoid <figure class="mw-default-size" typeof="mw:Image/Thumb"> - <a href="File:Foobar.jpg"> + <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="25" width="220"/> </a> <figcaption></figcaption> @@ -12142,7 +13088,7 @@ Parsoid-specific image handling - whitespace caption !! wikitext [[File:Foobar.jpg|thumb| ]] !! 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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption> </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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption> </figcaption></figure> !! end !! test @@ -12153,7 +13099,7 @@ foo bar !! html/parsoid <p>foo -<span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/f/ff/Foobar.svg" lang="de" height="180" width="240"/></a></span> +<span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="./File:Foobar.svg"><img resource="./File:Foobar.svg" src="//example.com/images/f/ff/Foobar.svg" lang="de" data-file-width="240" data-file-height="180" data-file-type="drawing" height="180" width="240"/></a></span> bar</p> !! end @@ -12189,7 +13135,12 @@ subpage title=[[Subpage test]] </p> !! end -# TODO: make this PHP-parser compatible! +!! article +Subpage test/1/2/subpage +!! text +blah +!! endarticle + !! test Relative subpage noslash link !! options @@ -12199,8 +13150,12 @@ subpage title=[[Subpage test/1/2/3/4]] [[../../subpage/]] [[../../subpage]] -!! html -<p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage/" title="Subpage test/1/2/subpage/">subpage</a></p> +!! html/php +<p><a href="/wiki/Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">subpage</a> +</p><p><a href="/wiki/Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">Subpage test/1/2/subpage</a> +</p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">subpage</a></p> <p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">Subpage_test/1/2/subpage</a></p> !! end @@ -12273,8 +13228,28 @@ Render invalid page names as plain text (bug 51090) [[foo<bar]] </p> !!html/parsoid -<p>[[./../foo|bar]][[foo�|bar]][[foo/.|bar]][[foo/..|bar]][[foo~~~bar]][[foo>bar]][[foo[bar]][[.]][[..]][[foo././bar]]</p> -<p>[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"./../foo"}},"i":0}}]}'>./../foo</span>|bar]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo/."}},"i":0}}]}'>foo/.</span>|bar]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo/.."}},"i":0}}]}'>foo/..</span>|bar]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo~~~~bar"}},"i":0}}]}'>foo~~~~bar</span>]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo>bar"}},"i":0}}]}'>foo>bar</span>]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo././bar"}},"i":0}}]}'>foo././bar</span>]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo{bar"}},"i":0}}]}'>foo{bar</span>]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo}bar"}},"i":0}}]}'>foo}bar</span>]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo[bar"}},"i":0}}]}'>foo[bar</span>]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo]bar"}},"i":0}}]}'>foo]bar</span>]][[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo<bar"}},"i":0}}]}'>foo<bar</span>]]</p> +<p>[[./../foo|bar]] +[[foo�|bar]] +[[foo/.|bar]] +[[foo/..|bar]] +[[foo~~~bar]] +[[foo>bar]] +[[foo[bar]] +[[.]] +[[..]] +[[foo././bar]]</p> + +<p>[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"./../foo"}},"i":0}}]}'>./../foo</span>|bar]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo/."}},"i":0}}]}'>foo/.</span>|bar]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo/.."}},"i":0}}]}'>foo/..</span>|bar]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo~~~~bar"}},"i":0}}]}'>foo~~~~bar</span>]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo>bar"}},"i":0}}]}'>foo>bar</span>]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo././bar"}},"i":0}}]}'>foo././bar</span>]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo{bar"}},"i":0}}]}'>foo{bar</span>]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo}bar"}},"i":0}}]}'>foo}bar</span>]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo[bar"}},"i":0}}]}'>foo[bar</span>]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo]bar"}},"i":0}}]}'>foo]bar</span>]] +[[<span typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo<bar"}},"i":0}}]}'>foo<bar</span>]]</p> !!end !! test @@ -12496,8 +13471,8 @@ parsoid [[:File:Foo.png|Bar]] !! html <p> -<a rel="mw:WikiLink" href="File:Foo.png" title="File:Foo.png">File:Foo.png</a> -<a rel="mw:WikiLink" href="File:Foo.png" title="File:Foo.png">Bar</a> +<a rel="mw:WikiLink" href="./File:Foo.png" title="File:Foo.png">File:Foo.png</a> +<a rel="mw:WikiLink" href="./File:Foo.png" title="File:Foo.png">Bar</a> </p> !! end @@ -12514,15 +13489,31 @@ parsoid !! end !! test -Parsoid: Defaultsort +Normalize hrefs properly before testing for invalid link targets (bug 70894) !! options -parsoid +parsoid=html2wt +!! html +<link rel="mw:PageProp/Category" href="./Category:Toxine_bactérienne"/> +!! wikitext +[[Category:Toxine bactérienne]] +!! end + +!! test +Parsoid: Defaultsort !! wikitext {{DEFAULTSORT:Foo}} -!! html +!! html/parsoid <meta property="mw:PageProp/categorydefaultsort" content="Foo"/> !! end +!! test +Parsoid: Defaultsort (template-generated) +!! wikitext +{{{{echo|DEFAULTSORT}}:Foo}} +!! html/parsoid +<meta property="mw:PageProp/categorydefaultsort" content="Foo" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"dsr":[0,28,null,null],"pi":[[]]}' data-mw='{"parts":[{"template":{"target":{"wt":"{{echo|DEFAULTSORT}}:Foo"},"params":{},"i":0}}]}'/> +!! end + ### ### Inter-language links ### @@ -12537,9 +13528,9 @@ ill !! html/php es:Alimento fr:Nourriture zh:食品 !! html/parsoid -<p><link rel="mw:PageProp/Language" href="//es.wikipedia.org/wiki/Alimento"/> -<link rel="mw:PageProp/Language" href="//fr.wikipedia.org/wiki/Nourriture"/> -<link rel="mw:PageProp/Language" href="//zh.wikipedia.org/wiki/食品"/></p> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Alimento"/> +<link rel="mw:PageProp/Language" href="http://fr.wikipedia.org/wiki/Nourriture"/> +<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/食品"/> !! end !! test @@ -12554,10 +13545,10 @@ ill !! html/php es:1 fr:1 !! html/parsoid -<p><link rel="mw:PageProp/Language" href="//es.wikipedia.org/wiki/1"/> -<link rel="mw:PageProp/Language" href="//es.wikipedia.org/wiki/2"/> -<link rel="mw:PageProp/Language" href="//fr.wikipedia.org/wiki/1"/> -<link rel="mw:PageProp/Language" href="//fr.wikipedia.org/wiki/2"/></p> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/1"/> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/2"/> +<link rel="mw:PageProp/Language" href="http://fr.wikipedia.org/wiki/1"/> +<link rel="mw:PageProp/Language" href="http://fr.wikipedia.org/wiki/2"/> !! end ### @@ -12631,6 +13622,31 @@ Some text !! end +!! test +TOC anchors don't collide +!! wikitext +__FORCETOC__ +== Headline 2 == +== Headline == +== Headline 2 == +== Headline == +!! html +<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div> +<ul> +<li class="toclevel-1 tocsection-1"><a href="#Headline_2"><span class="tocnumber">1</span> <span class="toctext">Headline 2</span></a></li> +<li class="toclevel-1 tocsection-2"><a href="#Headline"><span class="tocnumber">2</span> <span class="toctext">Headline</span></a></li> +<li class="toclevel-1 tocsection-3"><a href="#Headline_2_2"><span class="tocnumber">3</span> <span class="toctext">Headline 2</span></a></li> +<li class="toclevel-1 tocsection-4"><a href="#Headline_3"><span class="tocnumber">4</span> <span class="toctext">Headline</span></a></li> +</ul> +</div> + +<h2><span class="mw-headline" id="Headline_2">Headline 2</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Headline 2">edit</a><span class="mw-editsection-bracket">]</span></span></h2> +<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&action=edit&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&action=edit&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&action=edit&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' !! test Handling of sections up to level 6 and beyond @@ -12690,7 +13706,7 @@ Handling of sections up to level 6 and beyond !! end !! test -TOC regression (bug 9764) +TOC regression (T11764) !! wikitext == title 1 == === title 1.1 === @@ -12862,7 +13878,7 @@ Link inside a section heading !! end !! test -TOC regression (bug 12077) +TOC regression (T14077) !! wikitext __TOC__ == title 1 == @@ -12889,10 +13905,12 @@ __TOC__ !! test BUG 1219 URL next to image (good) !! wikitext -http://example.com [[Image:foobar.jpg]] -!! html +http://example.com [[File:Foobar.jpg]] +!! html/php <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> <a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a> <span 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></span></p> !!end !! test @@ -13115,10 +14133,12 @@ c3--> !! test BUG 1219 URL next to image (broken) !! wikitext -http://example.com[[Image:foobar.jpg]] -!! html +http://example.com[[File:Foobar.jpg]] +!! html/php <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a><span 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></span></p> !!end !! test @@ -13237,15 +14257,14 @@ parsoid </tbody></table> !! end -# The PHP parser escapes the opening brace to { for some reason, so -# disabled this test for it. !! test div with braces in attribute value -!! options -parsoid !! wikitext <div title="{}">Foo</div> -!! html +!! html/php +<div title="{}">Foo</div> + +!! html/parsoid <div title="{}">Foo</div> !! end @@ -13254,17 +14273,19 @@ parsoid # 'div with empty attribute value, space before equals'), but strips the # attribute completely if the space is missing. We hope that not much content # depends on this, so are implementing the behavior below in Parsoid for -# consistencies' sake. Disabled for the PHP parser. +# consistencies' sake. # FIXME: fix this behavior in the PHP parser? !! test div with empty attribute value, no space before equals !! options -parsoid +parsoid=wt2html,html2html !! wikitext <div class=>HTML rocks</div> -!! html -<div class="">HTML rocks</div> +!! html/php +<div>HTML rocks</div> +!! html/parsoid +<div class="">HTML rocks</div> !! end !! test @@ -13482,16 +14503,17 @@ Media link with text !! end # FIXME: this is still bad HTML tag nesting +# FIXME: doBlockLevels won't wrap this in a paragraph because it contains a div !! test Media link with nasty text -fixme: doBlockLevels won't wrap this in a paragraph because it contains a div !! wikitext [[Media:Foobar.jpg|Safe Link<div style=display:none>" onmouseover="alert(document.cookie)" onfoo="</div>]] !! html <a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div></a> !! html+tidy -<p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div></a></p> +<p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">Safe Link</a></p> +<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div> !! end !! test @@ -13506,19 +14528,23 @@ Media link to nonexistent file (bug 1702) !! test Image link to nonexistent file (bug 1850 - good) !! wikitext -[[Image:No such.jpg]] -!! html +[[File:No_such.jpg]] +!! html/php <p><a href="/index.php?title=Special:Upload&wpDestFile=No_such.jpg" class="new" title="File:No such.jpg">File:No such.jpg</a> </p> +!! html/parsoid +<p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","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></span></p> !! end !! test :Image link to nonexistent file (bug 1850 - bad) !! wikitext [[:Image:No such.jpg]] -!! html +!! html/php <p><a href="/index.php?title=File:No_such.jpg&action=edit&redlink=1" class="new" title="File:No such.jpg (page does not exist)">Image:No such.jpg</a> </p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./File:No_such.jpg" title="File:No such.jpg">Image:No such.jpg</a></p> !! end @@ -13685,7 +14711,7 @@ Bug 2304: HTML attribute safety (dangerous template; 2309) <div title=""></div> !! html/parsoid -<div title='" onmouseover="alert(document.cookie)' about="#mwt2" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"title"},{"html":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;dangerous attribute&quot;,&quot;href&quot;:&quot;./Template:Dangerous_attribute&quot;},&quot;params&quot;:{},&quot;i&quot;:0}}]}\" data-parsoid=\"{&quot;pi&quot;:[[]],&quot;dsr&quot;:[12,35,null,null]}\">\" onmouseover=\"alert(document.cookie)</span>"}]]}' data-parsoid='{"stx":"html","a":{"title":"\" onmouseover=\"alert(document.cookie)"},"sa":{"title":"{{dangerous attribute}}"}}'></div> +<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":"<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;pi&quot;:[[]],&quot;dsr&quot;:[12,35,null,null]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;dangerous attribute&quot;,&quot;href&quot;:&quot;./Template:Dangerous_attribute&quot;},&quot;params&quot;:{},&quot;i&quot;:0}}]}\">\" onmouseover=\"alert(document.cookie)</span>"}]]}'></div> !! end !! test @@ -14005,9 +15031,12 @@ Expansion of multi-line templates in attribute values (bug 6255 sanity check) !! wikitext <div style="background: #00FF00">-</div> -!! html +!! html/php <div style="background: #00FF00">-</div> +!! html/parsoid +<div style="background: +#00FF00">-</div> !! end !! test @@ -14245,6 +15274,10 @@ Nested template calls ### ### Sanitizer ### + +# HTML+Tidy effectively strips out the empty tags completely +# But since Parsoid doesn't it wraps the <s></s> tags in p-tags +# which Tidy would have done for the PHP parser had there been content inside it. !! test Sanitizer: Closing of open tags !! wikitext @@ -14252,6 +15285,8 @@ Sanitizer: Closing of open tags !! html <s></s><table></table> +!! html/parsoid +<p><s></s></p><table></table> !! end !! test @@ -14290,16 +15325,19 @@ Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id= </p> !! end +# In HTML5, the restrictions are that id must contain at least one character, +# and must not contain any space characters. !! test Sanitizer: Validating the contents of the id attribute (bug 4515) !! options disabled !! wikitext -<br id=9 /> +<br id="" /><br id="a space" /> !! html -Something, but definitely not <br id="9" />... +Something ... !! end +# In HTML5, id must be unique amongst all the ids in the element's home subtree. !! test Sanitizer: Validating id attribute uniqueness (bug 4515, bug 6301) !! options @@ -14397,7 +15435,6 @@ Punctuation: CSS ! important (bug 11874; with space after) !!end - !! test HTML bullet list, closed tags (bug 5497) !! wikitext @@ -14405,29 +15442,36 @@ HTML bullet list, closed tags (bug 5497) <li>One</li> <li>Two</li> </ul> -!! html +!! html/php <ul> <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 HTML bullet list, unclosed tags (bug 5497) -!! options -disabled !! wikitext <ul> <li>One <li>Two </ul> -!! html +!! html/php+tidy <ul> -<li>One -</li> -<li>Two -</li> +<li>One</li> +<li>Two</li> +</ul> +!! html/parsoid +<ul data-parsoid='{"stx":"html"}'> +<li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>One</li> +<li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>Two</li> </ul> !! end @@ -14439,29 +15483,37 @@ HTML ordered list, closed tags (bug 5497) <li>One</li> <li>Two</li> </ol> -!! html +!! html/php <ol> <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 HTML ordered list, unclosed tags (bug 5497) !! options -disabled !! wikitext <ol> <li>One <li>Two </ol> -!! html +!! html/php+tidy <ol> -<li>One -</li> -<li>Two -</li> +<li>One</li> +<li>Two</li> +</ol> +!! html/parsoid +<ol data-parsoid='{"stx":"html"}'> +<li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>One</li> +<li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>Two</li> </ol> !! end @@ -14493,8 +15545,6 @@ HTML nested bullet list, closed tags (bug 5497) !! test HTML nested bullet list, open tags (bug 5497) -!! options -disabled !! wikitext <ul> <li>One @@ -14504,7 +15554,17 @@ disabled <li>Sub-two </ul> </ul> -!! html +!! html/php+tidy +<ul> +<li>One</li> +<li>Two: +<ul> +<li>Sub-one</li> +<li>Sub-two</li> +</ul> +</li> +</ul> +!! html/parsoid <ul> <li>One </li> @@ -14547,8 +15607,6 @@ HTML nested ordered list, closed tags (bug 5497) !! test HTML nested ordered list, open tags (bug 5497) -!! options -disabled !! wikitext <ol> <li>One @@ -14558,7 +15616,17 @@ disabled <li>Sub-two </ol> </ol> -!! html +!! html/php +<ol> +<li>One +<li>Two: +<ol> +<li>Sub-one +<li>Sub-two +</ol> +</ol> + +!! html/parsoid <ol> <li>One </li> @@ -14659,6 +15727,7 @@ http://<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div> <li class="toclevel-1 tocsection-1"><a href="#onmouseover.3D"><span class="tocnumber">1</span> <span class="toctext">onmouseover=</span></a></li> </ul> </div> +<p></p> !! end !! test @@ -14798,32 +15867,38 @@ Fuzz testing: Parser25 (bug 6055) Fuzz testing: URL adjacent extension (with space, clean) !! wikitext http://example.com <nowiki>junk</nowiki> -!! html +!! html/php <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> junk </p> -!!end +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"stx":"url"}'>http://example.com</a> <span typeof="mw:Nowiki">junk</span></p> +!! end !!test Fuzz testing: URL adjacent extension (no space, dirty; nowiki) !! wikitext http://example.com<nowiki>junk</nowiki> -!! html +!! html/php <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>junk </p> -!!end +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"stx":"url"}'>http://example.com</a><span typeof="mw:Nowiki">junk</span></p> +!! end !!test Fuzz testing: URL adjacent extension (no space, dirty; pre) !! wikitext http://example.com<pre>junk</pre> -!! html +!! html/php <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><pre>junk</pre> -!! html+tidy +!! html/php+tidy <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></p> <pre> junk </pre> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"stx":"url"}'>http://example.com</a></p><pre data-parsoid='{"stx":"html"}'>junk</pre> !!end !!test @@ -14834,7 +15909,7 @@ Fuzz testing: image with bogus manual thumbnail <div class="thumb tright"><div class="thumbinner" style="width:182px;">Error creating thumbnail: <div class="thumbcaption"></div></div></div> !! html/parsoid -<meta typeof="mw:Placeholder" data-parsoid='{"src":"[[Image:foobar.jpg|thumbnail= ]]","optList":[{"ck":"manualthumb","ak":"thumbnail= "}],"dsr":[0,32,null,null]}'/> +<figure class="mw-default-size" typeof="mw:Error mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"manualthumb","ak":"thumbnail= "}],"dsr":[0,32,2,2]}' data-mw='{"errors":[{"key":"missing-thumbnail","message":"This thumbnail does not exist.","params":{"name":""}}],"thumb":""}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"sa":{},"dsr":[2,30,null,null]}'><img resource="./File:Foobar.jpg" src="./Special:FilePath/" height="220" width="220" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"220","width":"220"},"sa":{"resource":"Image:foobar.jpg"}}'/></a></figure> !!end !! test @@ -14912,15 +15987,19 @@ New wiki paragraph </p> !! end +# FIXME: The current php output is documented +# and desired output is the parsoid target. !! test Inline HTML vs wiki block nesting -!! options -disabled !! wikitext <b>Bold paragraph New wiki paragraph -!! html +!! html/php +<p><b>Bold paragraph +</p><p>New wiki paragraph</b> +</p> +!! html/parsoid <p><b>Bold paragraph</b> </p><p>New wiki paragraph </p> @@ -15913,6 +16992,17 @@ Special:Search page linking. !! end !! test +{{!}} is a magic word +!! wikitext +{{!}} is a magic word there and {{!}} is still a magic word here +!! html/php +<p>| is a magic word there and | is still a magic word here +</p> +!! html/parsoid +<p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"!","href":"./Template:!"},"params":{},"i":0}}]}' data-parsoid='{"pi":[[]]}'>|</span> is a magic word there and <span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"!","href":"./Template:!"},"params":{},"i":0}}]}' data-parsoid='{"pi":[[]]}'>|</span> is still a magic word here</p> +!! end + +!! test Say the magic word !! options title=[[Parser test]] @@ -16025,8 +17115,8 @@ image4 |300px| centre Gallery (with options) !! wikitext <gallery widths='70px' heights='40px' perrow='2' caption='Foo [[Main Page]]' > -File:Nonexistant.jpg|caption -File:Nonexistant.jpg +File:Nonexistent.jpg|caption +File:Nonexistent.jpg image:foobar.jpg|some '''caption''' [[Main Page]] image:foobar.jpg image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla. @@ -16035,31 +17125,31 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla. <ul class="gallery mw-gallery-traditional" style="max-width: 226px;_width: 226px;"> <li class='gallerycaption'>Foo <a href="/wiki/Main_Page" title="Main Page">Main Page</a></li> <li class="gallerybox" style="width: 105px"><div style="width: 105px"> - <div class="thumb" style="height: 70px;">Nonexistant.jpg</div> + <div class="thumb" style="height: 70px;">Nonexistent.jpg</div> <div class="gallerytext"> <p>caption </p> </div> </div></li> <li class="gallerybox" style="width: 105px"><div style="width: 105px"> - <div class="thumb" style="height: 70px;">Nonexistant.jpg</div> + <div class="thumb" style="height: 70px;">Nonexistent.jpg</div> <div class="gallerytext"> </div> </div></li> <li class="gallerybox" style="width: 105px"><div style="width: 105px"> - <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" width="70" height="8" /></a></div></div> + <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" width="70" height="8" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" /></a></div></div> <div class="gallerytext"> <p>some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a> </p> </div> </div></li> <li class="gallerybox" style="width: 105px"><div style="width: 105px"> - <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" width="70" height="8" /></a></div></div> + <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" width="70" height="8" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" /></a></div></div> <div class="gallerytext"> </div> </div></li> <li class="gallerybox" style="width: 105px"><div style="width: 105px"> - <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="This is a foo-bar." src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" width="70" height="8" /></a></div></div> + <div class="thumb" style="width: 100px;"><div style="margin:31px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="This is a foo-bar." src="http://example.com/images/thumb/3/3a/Foobar.jpg/70px-Foobar.jpg" width="70" height="8" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/105px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/140px-Foobar.jpg 2x" /></a></div></div> <div class="gallerytext"> <p>Blabla|blabla. </p> @@ -16080,17 +17170,17 @@ image:foobar.jpg|link=Main Page#section|caption !! html <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/Main_Page"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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> <li class="gallerybox" style="width: 155px"><div style="width: 155px"> - <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page#section"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page#section"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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> <li class="gallerybox" style="width: 155px"><div style="width: 155px"> - <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page#section"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/Main_Page#section"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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"> <p>caption </p> @@ -16110,14 +17200,14 @@ File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt !! html <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="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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"> <p><a href="/wiki/File:Foobar.jpg" class="image" title="desc"><img alt="inneralt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/20px-Foobar.jpg" width="20" height="2" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/30px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/40px-Foobar.jpg 2x" /></a> </p> </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="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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"> <p>This is a test template </p> @@ -16131,30 +17221,30 @@ File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt gallery (with showfilename option) !! wikitext <gallery showfilename> -File:Nonexistant.jpg|caption -File:Nonexistant.jpg +File:Nonexistent.jpg|caption +File:Nonexistent.jpg image:foobar.jpg|some '''caption''' [[Main Page]] File:Foobar.jpg </gallery> !! html <ul class="gallery mw-gallery-traditional"> <li class="gallerybox" style="width: 155px"><div style="width: 155px"> - <div class="thumb" style="height: 150px;">Nonexistant.jpg</div> + <div class="thumb" style="height: 150px;">Nonexistent.jpg</div> <div class="gallerytext"> -<p><a href="/wiki/File:Nonexistant.jpg" title="File:Nonexistant.jpg">Nonexistant.jpg</a><br /> +<p><a href="/wiki/File:Nonexistent.jpg" title="File:Nonexistent.jpg">Nonexistent.jpg</a><br /> caption </p> </div> </div></li> <li class="gallerybox" style="width: 155px"><div style="width: 155px"> - <div class="thumb" style="height: 150px;">Nonexistant.jpg</div> + <div class="thumb" style="height: 150px;">Nonexistent.jpg</div> <div class="gallerytext"> -<p><a href="/wiki/File:Nonexistant.jpg" title="File:Nonexistant.jpg">Nonexistant.jpg</a><br /> +<p><a href="/wiki/File:Nonexistent.jpg" title="File:Nonexistent.jpg">Nonexistent.jpg</a><br /> </p> </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" width="120" height="14" /></a></div></div> + <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" 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"> <p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br /> some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a> @@ -16162,7 +17252,7 @@ some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a> </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="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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"> <p><a href="/wiki/File:Foobar.jpg" title="File:Foobar.jpg">Foobar.jpg</a><br /> </p> @@ -16176,30 +17266,30 @@ some <b>caption</b> <a href="/wiki/Main_Page" title="Main Page">Main Page</a> Gallery (with namespace-less filenames) !! wikitext <gallery> -File:Nonexistant.jpg -Nonexistant.jpg +File:Nonexistent.jpg +Nonexistent.jpg image:foobar.jpg foobar.jpg </gallery> !! html <ul class="gallery mw-gallery-traditional"> <li class="gallerybox" style="width: 155px"><div style="width: 155px"> - <div class="thumb" style="height: 150px;">Nonexistant.jpg</div> + <div class="thumb" style="height: 150px;">Nonexistent.jpg</div> <div class="gallerytext"> </div> </div></li> <li class="gallerybox" style="width: 155px"><div style="width: 155px"> - <div class="thumb" style="height: 150px;">Nonexistant.jpg</div> + <div class="thumb" style="height: 150px;">Nonexistent.jpg</div> <div class="gallerytext"> </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="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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> <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="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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> @@ -16267,6 +17357,8 @@ ISBN 978-0-1234-56 789 </p> !! html+tidy <p><a href="/wiki/Special:BookSources/9780123456" class="internal mw-magiclink-isbn">ISBN 978-0-1234-56</a> 789</p> +!! html/parsoid +<p><a href="./Special:BookSources/9780123456" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 978-0-1234-56</a><span typeof="mw:Entity" data-parsoid='{"src":"&#x20;","srcContent":" "}'> </span>789</p> !! end !! test @@ -16282,24 +17374,37 @@ ISBN Double ISBN !! wikitext ISBN ISBN 1234567890 -!! html +!! html/php <p>ISBN <a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a> </p> +!! html/parsoid +<p>ISBN <a href="./Special:BookSources/1234567890" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 1234567890</a></p> !! end !! test ISBN with an X !! wikitext ISBN 3-462-04561-X -!! html +ISBN 080442957X +ISBN 978080442957X +!! html/php <p><a href="/wiki/Special:BookSources/346204561X" class="internal mw-magiclink-isbn">ISBN 3-462-04561-X</a> +<a href="/wiki/Special:BookSources/080442957X" class="internal mw-magiclink-isbn">ISBN 080442957X</a> +<a href="/wiki/Special:BookSources/978080442957X" class="internal mw-magiclink-isbn">ISBN 978080442957X</a> </p> +!! html/parsoid +<p><a href="./Special:BookSources/346204561X" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 3-462-04561-X</a> +<a href="./Special:BookSources/080442957X" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 080442957X</a> +<a href="./Special:BookSources/978080442957X" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 978080442957X</a></p> !! end !! test ISBN with empty prefix (parsoid test) !! wikitext ISBN 1234567890 +!! html/php +<p><a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a> +</p> !! html/parsoid <p><a href="Special:BookSources/1234567890" rel="mw:ExtLink">ISBN 1234567890</a></p> !! end @@ -16308,9 +17413,11 @@ ISBN 1234567890 Bug 22905: <abbr> followed by ISBN followed by </a> !! wikitext <abbr>(fr)</abbr> ISBN 2753300917 [http://www.example.com example.com] -!! html +!! html/php <p><abbr>(fr)</abbr> <a href="/wiki/Special:BookSources/2753300917" class="internal mw-magiclink-isbn">ISBN 2753300917</a> <a rel="nofollow" class="external text" href="http://www.example.com">example.com</a> </p> +!! html/parsoid +<p><abbr data-parsoid='{"stx":"html"}'>(fr)</abbr> <a href="./Special:BookSources/2753300917" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 2753300917</a> <a rel="mw:ExtLink" href="http://www.example.com">example.com</a></p> !! end !! test @@ -16402,9 +17509,11 @@ Image with page parameter djvu !! wikitext [[File:LoremIpsum.djvu|page=2]] -!! html +!! html/php <p><a href="/index.php?title=File:LoremIpsum.djvu&page=2" class="image"><img alt="LoremIpsum.djvu" src="http://example.com/images/thumb/5/5f/LoremIpsum.djvu/page2-2480px-LoremIpsum.djvu.jpg" 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><span class="mw-default-size" typeof="mw:Image" data-parsoid='{"optList":[{"ck":"page","ak":"page=2"}]}'><a href="./File:LoremIpsum.djvu" data-parsoid='{"a":{"href":"./File:LoremIpsum.djvu"},"sa":{}}'><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></span></p> !! end !! test @@ -16416,35 +17525,16 @@ Another italics / bold test </pre> !!end -# Note the results may be incorrect, as parserTest output included this: -# XML error: Mismatched tag at byte 6120: -# ...<dd> </dt></dl> </dd... +# FIXME: The php output seems broken. It's interleaving some open/close tags. !! test dt/dd/dl test -!! options -disabled !! wikitext :;;;:: -!! html -<dl> -<dd><dl> -<dt><dl> -<dt><dl> -<dt><dl> -<dd><dl> -<dd> -</dd> -</dl> -</dd> -</dl> -</dt> -</dl> -</dt> -</dl> -</dt> -</dl> -</dd> -</dl> +!! 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 @@ -16458,7 +17548,7 @@ Images with the "|" character in the comment <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" 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&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/3/3a/Foobar.jpg" height="25" width="220"/></a><figcaption>An <a rel="mw:ExtLink" href="http://test/?param1=|left|&param2=|x">external</a> URL</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/3/3a/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" href="http://test/?param1=|left|&param2=|x">external</a> URL</figcaption></figure> !! end !! test @@ -16538,7 +17628,7 @@ subpage title=[[Subpage test/L1/L2/L3]] !! wikitext [[../../////]] !! html -<p><a href="/index.php?title=Subpage_test/L1////&action=edit&redlink=1" class="new" title="Subpage test/L1//// (page does not exist)">///</a> +<p><a href="/index.php?title=Subpage_test/L1&action=edit&redlink=1" class="new" title="Subpage test/L1 (page does not exist)">Subpage test/L1</a> </p> !! end @@ -16587,7 +17677,7 @@ Definition list code coverage ; title : def ; title : def ;title: def -!! html +!! html/php <dl><dt> title  </dt> <dd> def</dd> <dt> title </dt> @@ -16595,6 +17685,10 @@ Definition list code coverage <dt>title</dt> <dd> def</dd></dl> +!! html/parsoid +<dl><dt> title <span typeof="mw:Placeholder"> </span></dt><dd> def</dd> +<dt> title<span typeof="mw:Placeholder"> </span></dt><dd> def</dd> +<dt>title</dt><dd> def</dd></dl> !! end !! test @@ -17051,7 +18145,7 @@ language=sr variant=sr-ec !! wikitext == -{Naslov}- == !! html -<h2><span class="mw-headline" id="-.7BNaslov.7D-">Naslov</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Уредите одељак „Naslov“">уреди</a><span class="mw-editsection-bracket">]</span></span></h2> +<h2><span class="mw-headline" id="-.7BNaslov.7D-">Naslov</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Уреди одељак „Naslov“">уреди</a><span class="mw-editsection-bracket">]</span></span></h2> !! end @@ -17277,45 +18371,51 @@ language=sr variant=sr-ec </p> !! end -# This test is currently broken in the PHP parser (bug 52661) +# FIXME: This test is currently broken in the PHP parser (bug 52661) !! test Don't break image parsing if language converter markup is in the caption. !! options language=sr -disabled !! wikitext [[File:Foobar.jpg|-{R|caption}-]] -!! html +!! html/parsoid <p><a href="/wiki/File:Foobar.jpg" class="image" title="caption"><img alt="caption" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a> </p> !! end -# This test is currently broken in the PHP parser (bug 52661) +# FIXME: This test is currently broken in the PHP parser (bug 52661) !! test Don't break list handling if language converter markup is in the item. !! options language=zh variant=zh-cn -disabled !! wikitext ;-{zh-cn:AAA;zh-tw:BBB}- -!! html +!! html/php +<dl><dt><span class="error">在手动语言转换规则中检测到错误</span></dd></dl> + +!! html/parsoid <dl><dt>AAA </dt></dl> - !! end -# This test is currently broken in the PHP parser (bug 52661) +# FIXME: This test is currently broken in the PHP parser (bug 52661) !! test Don't break table handling if language converter markup is in the cell. !! options language=sr variant=sr-ec -disabled !! wikitext {| |- | -{R|B}- |} -!! html +!! html/php +<table> + +<tr> +<td>Б}- +</td></tr></table> + +!! html/parsoid <table> <tr> @@ -17534,12 +18634,13 @@ Line two !! test Nesting tags, paragraphs on lines which begin with <div> -!! options -disabled !! wikitext <div></div><strong>A B</strong> -!! html +!! html/php+tidy +<p><strong>A</strong></p> +<p><strong>B</strong></p> +!! html/parsoid <div></div> <p><strong>A B</strong> @@ -17941,27 +19042,35 @@ comment <a href="/index.php?title=ABC3D%25_%2B%2B&action=edit&redlink=1" class="new" title="ABC3D% ++ (page does not exist)">ABC3D% ++</a> <a href="/index.php?title=ABC3D%25_%2B%2B&action=edit&redlink=1" class="new" title="ABC3D% ++ (page does not exist)">+%20</a> !! end +# Parsoid doesn't support this yet: see bug 73581 +# but it *should* omit the 'src' attribute if the image is bad. +# PHP side of tests was disabled in +# mediawiki/core:6bd31e7d95161a6e88fa86df60871051da997c3c +# because of issues in the PHP parserTests infrastructure +# (but the output below is indeed what the PHP side emits) !! test Bad images - basic functionality -!! options -disabled !! wikitext [[File:Bad.jpg]] -!! html +!! DISABLED/html/php +!! html/parsoid +<p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"bad-image","message":"This image is blacklisted in this context."}]}'><a href="./File:Bad.jpg"><img resource="./File:Bad.jpg" height="220" width="220"/></a></span></p> !! end !! test Bad images - bug 16039: text after bad image disappears -!! options -disabled !! wikitext Foo bar [[File:Bad.jpg]] Bar foo -!! html +!! DISABLED/html/php <p>Foo bar </p><p>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> +Bar foo</p> !! end !! test @@ -18097,6 +19206,82 @@ this is not the the title !! end !! test +Page status indicators: Empty name is invalid +!! options +showindicators +!! wikitext +<indicator name=" "></indicator> +<indicator></indicator> +!! html +<p><span class="error"><strong>Error:</strong> Page status indicators' <code>name</code> attribute must not be empty.</span> +<span class="error"><strong>Error:</strong> Page status indicators' <code>name</code> attribute must not be empty.</span> +</p> +!! end + +!! test +Page status indicators: Weird syntaxes that are okay +!! options +showindicators +!! wikitext +<indicator name="empty" /> +<indicator name></indicator> +!! html +empty= +name= +<p><br /> +</p> +!! end + +!! test +Page status indicators: Torture test +!! options +showindicators +!! wikitext +<indicator name="01">hello world</indicator> +<indicator name="02">[[Main Page]]</indicator> +<indicator name="03">[[File:Foobar.jpg|25px|link=]]</indicator> +<indicator name="04">[[File:Foobar.jpg|25px]]</indicator> +<indicator name="05">* foo +* bar</indicator> +<indicator name="06"><nowiki>foo</nowiki></indicator> +<indicator name="07"> Preformatted</indicator> +<indicator name="08"><div>Broken tag</indicator> +<indicator name="09">{| class=wikitable +| cell +|}</indicator> +<indicator name="10">Two + +paragraphs</indicator> +!! html +01=hello world +02=<a href="/wiki/Main_Page" title="Main Page">Main Page</a> +03=<img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg" width="25" height="3" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/38px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg 2x" /> +04=<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg" width="25" height="3" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/38px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg 2x" /></a> +05=<ul><li> foo</li> +<li> bar</li></ul> + +06=foo +07=<pre>Preformatted +</pre> +08=<div>Broken tag</div> + +09=<table class="wikitable"> +<tr> +<td> cell +</td></tr></table> + +10=<p>Two +</p><p>paragraphs +</p> +<p><br /> +</p><p><br /> +</p><p><br /> +</p><p><br /> +</p><p><br /> +</p> +!! end + +!! test preload: check <noinclude> and <includeonly> !! options preload @@ -18138,18 +19323,22 @@ preload !! test Play a bit with r67090 and bug 3158 -!! options -disabled !! wikitext <div style="width:50% !important"> </div> <div style="width:50% !important"> </div> <div style="width:50% !important"> </div> <div style="border : solid;"> </div> -!! html -<div style="width:50% !important"> </div> -<div style="width:50% !important"> </div> -<div style="width:50% !important"> </div> -<div style="border : solid;"> </div> +!! html/php +<div style="width:50% !important"> </div> +<div style="width:50% !important"> </div> +<div style="width:50% !important"> </div> +<div style="border : solid;"> </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%&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%&#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 @@ -18170,14 +19359,16 @@ percent-encoding and + signs in internal links (Bug 26410) !! wikitext [[User:+%]] [[Page+title%]] [[%+]] [[%+|%20]] [[%+ ]] [[%+r]] -[[%]] [[+]] [[image:%+abc%39|foo|[[bar]]]] +[[%]] [[+]] [[File:%+abc%39|foo|[[bar]]]] [[%33%45]] [[%33%45+]] -!! html +!! html/php <p><a href="/index.php?title=User:%2B%25&action=edit&redlink=1" class="new" title="User:+% (page does not exist)">User:+%</a> <a href="/index.php?title=Page%2Btitle%25&action=edit&redlink=1" class="new" title="Page+title% (page does not exist)">Page+title%</a> <a href="/index.php?title=%25%2B&action=edit&redlink=1" class="new" title="%+ (page does not exist)">%+</a> <a href="/index.php?title=%25%2B&action=edit&redlink=1" class="new" title="%+ (page does not exist)">%20</a> <a href="/index.php?title=%25%2B&action=edit&redlink=1" class="new" title="%+ (page does not exist)">%+ </a> <a href="/index.php?title=%25%2Br&action=edit&redlink=1" class="new" title="%+r (page does not exist)">%+r</a> <a href="/index.php?title=%25&action=edit&redlink=1" class="new" title="% (page does not exist)">%</a> <a href="/index.php?title=%2B&action=edit&redlink=1" class="new" title="+ (page does not exist)">+</a> <a href="/index.php?title=Special:Upload&wpDestFile=%25%2Babc9" class="new" title="File:%+abc9">bar</a> <a href="/index.php?title=3E&action=edit&redlink=1" class="new" title="3E (page does not exist)">3E</a> <a href="/index.php?title=3E%2B&action=edit&redlink=1" class="new" title="3E+ (page does not exist)">3E+</a> </p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="User:+%" title="User:+%">User:+%</a> <a rel="mw:WikiLink" href="Page+title%" title="Page+title%">Page+title%</a> <a rel="mw:WikiLink" href="%+" title="%+">%+</a> <a rel="mw:WikiLink" href="%+" title="%+">%20</a> <a rel="mw:WikiLink" href="%+" title="%+">%+ </a> <a rel="mw:WikiLink" href="%+r" title="%+r">%+r</a> <a rel="mw:WikiLink" href="%" title="%">%</a> <a rel="mw:WikiLink" href="+" title="+">+</a> <span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","message":"This image does not exist."}],"caption":"[[bar]]"}'><a href="./File:%+abc9"><img resource="./File:%25+abc9" src="./Special:FilePath/%+abc9" height="220" width="220"/></a></span> <a rel="mw:WikiLink" href="3E" title="3E">3E</a> <a rel="mw:WikiLink" href="3E+" title="3E+">3E+</a></p> !! end !! test @@ -18185,13 +19376,15 @@ Special characters in embedded file links (bug 27679) !! wikitext [[File:Contains & ampersand.jpg]] [[File:Does not exist.jpg|Title with & ampersand]] -!! html +!! html/php <p><a href="/index.php?title=Special:Upload&wpDestFile=Contains_%26_ampersand.jpg" class="new" title="File:Contains & ampersand.jpg">File:Contains & ampersand.jpg</a> <a href="/index.php?title=Special:Upload&wpDestFile=Does_not_exist.jpg" class="new" title="File:Does not exist.jpg">Title with & ampersand</a> </p> +!! html/parsoid +<p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","message":"This image does not exist."}]}'><a href="./File:Contains_&_ampersand.jpg"><img resource="./File:Contains_&_ampersand.jpg" src="./Special:FilePath/Contains_&_ampersand.jpg" height="220" width="220"/></a></span> +<span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","message":"This image does not exist."}],"caption":"Title with & 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></span></p> !! end - !! test Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4) !! wikitext @@ -18383,6 +19576,7 @@ __TOC__ <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&action=edit&section=1" title="Edit section: Quote">edit</a><span class="mw-editsection-bracket">]</span></span></h2> !! html+tidy +<p></p> <div id="toc" class="toc"> <div id="toctitle"> <h2>Contents</h2> @@ -18391,6 +19585,7 @@ __TOC__ <li class="toclevel-1 tocsection-1"><a href="#Quote"><span class="tocnumber">1</span> <span class="toctext">Quote</span></a></li> </ul> </div> +<p></p> <h2><span class="mw-headline" id="Quote"></span></h2> <blockquote> <p><span class="mw-headline" id="Quote">Quote</span></p> @@ -18439,6 +19634,7 @@ __TOC__ <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&action=edit&section=2" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2> !! html+tidy +<p></p> <div id="toc" class="toc"> <div id="toctitle"> <h2>Contents</h2> @@ -18448,6 +19644,7 @@ __TOC__ <li class="toclevel-1 tocsection-2"><a href="#Foo_Bar_2"><span class="tocnumber">2</span> <span class="toctext"><i>Foo</i> Bar</span></a></li> </ul> </div> +<p></p> <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&action=edit&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></span></h2> <blockquote> @@ -18508,6 +19705,53 @@ __TOC__ !! end +!! test +Bug 72884: bdi element in ToC +!! wikitext +__TOC__ +== <bdi>test</bdi> == +!! html +<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div> +<ul> +<li class="toclevel-1 tocsection-1"><a href="#test"><span class="tocnumber">1</span> <span class="toctext"><bdi>test</bdi></span></a></li> +</ul> +</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&action=edit&section=1" title="Edit section: test">edit</a><span class="mw-editsection-bracket">]</span></span></h2> + +!! end + +# Note that the html output does not have the <p></p>, but the +# html+tidy output *does*. This is because the empty <p></p> is +# removed by the sanitizer, but only when tidy is *not* enabled (!). +!! test +Empty <p> tag in TOC, removed by Sanitizer (T92892) +!! wikitext +__TOC__ +== x == +!! html +<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div> +<ul> +<li class="toclevel-1 tocsection-1"><a href="#x"><span class="tocnumber">1</span> <span class="toctext">x</span></a></li> +</ul> +</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&action=edit&section=1" title="Edit section: x">edit</a><span class="mw-editsection-bracket">]</span></span></h2> + +!! html+tidy +<p></p> +<div id="toc" class="toc"> +<div id="toctitle"> +<h2>Contents</h2> +</div> +<ul> +<li class="toclevel-1 tocsection-1"><a href="#x"><span class="tocnumber">1</span> <span class="toctext">x</span></a></li> +</ul> +</div> +<p></p> +<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&action=edit&section=1" title="Edit section: x">edit</a><span class="mw-editsection-bracket">]</span></span></h2> +!! end + !! article MediaWiki:Bug32057 !! text @@ -18677,7 +19921,7 @@ File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink !! html <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/InterWikiLink"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/InterWikiLink"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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"> <p>caption </p> @@ -18696,7 +19940,7 @@ File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org !! html <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="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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"> <p>caption </p> @@ -18715,7 +19959,7 @@ File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascri !! html <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/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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"> <p>caption </p> @@ -18734,7 +19978,7 @@ File:foobar.jpg|link=< !! html <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="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" /></a></div></div> + <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" 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> @@ -18858,13 +20102,13 @@ parsoid=wt2html,wt2wt #### Parsoid-specific functionality tests #### ----------------------------------------------------------------- -# Bug 63642: Formatting elt fixup is cleaned up. +# Bug 63642/66749: Formatting elt fixup around images is cleaned up. # We know wt2wt will fail, but we expect selser to pass. # Due to the nature of our testing, wt2wt and selser tests will enter the # blacklist and we'll catch selser regressions based on changes to the # blacklist entries for selser tests. !! test -Bad treebuilder fixup of formatting elt is cleaned up +1. Bad treebuilder fixup of formatting elt is cleaned up !! options parsoid=wt2html,wt2wt !! wikitext @@ -18877,12 +20121,28 @@ parsoid=wt2html,wt2wt !! html/parsoid <table> <tbody><tr><td> -<p><small></small></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" height="220" width="1941"></a><figcaption><small>Test</small></figcaption></figure> -<p></p></td></tr> +<small> +<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>Test</figcaption></figure> +</small> +</td></tr> </tbody></table> !! end +!! test +2. Bad treebuilder fixup of formatting elt is cleaned up +!! options +parsoid=wt2html,wt2wt +!! wikitext +'''foo[[File:Foobar.jpg|thumb|caption]]bar''' + +<small>[[Image:Foobar.jpg|right|300px]]</small> +!! html/parsoid +<p><b>foo</b></p> +<figure class="mw-default-size" 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="25" width="220"/></a><figcaption><b>caption</b></figcaption></figure> +<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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300"/></a></figure></small> +!! end + #### ---------------------------------------------------------------- #### Parsoid-only testing of Parsoid's impl of <ref> and <references> #### tags. Parsoid's output for these tags differs from that of the @@ -18897,10 +20157,16 @@ parsoid A <ref>foo</ref> B <ref name="x">foo</ref> C <ref name="y" /> +<references /> !! html -<p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> -B <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"x"}}' id="cite_ref-x-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-2">[2]</a></span> -C <span about="#mwt3" class="reference" data-mw='{"name":"ref","attrs":{"name":"y"}}' id="cite_ref-y-3-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-y-3">[3]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> +B <span about="#mwt4" class="reference" id="cite_ref-x_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-x-2"},"attrs":{"name":"x"}}'><a href="#cite_note-x-2">[2]</a></span> +C <span about="#mwt6" class="reference" id="cite_ref-y_3-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"y"}}'><a href="#cite_note-y-3">[3]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li> +<li about="#cite_note-x-2" id="cite_note-x-2"><span rel="mw:referencedBy"><a href="#cite_ref-x_2-0">↑</a></span> <span id="mw-reference-text-cite_note-x-2" class="mw-reference-text">foo</span></li> +<li about="#cite_note-y-3" id="cite_note-y-3"><span rel="mw:referencedBy"><a href="#cite_ref-y_3-0">↑</a></span> <span id="mw-reference-text-cite_note-y-3" class="mw-reference-text"></span></li> +</ol> !!end !!test @@ -18910,9 +20176,13 @@ parsoid !! wikitext A <ref name="x">foo</ref> B <ref name="x" /> +<references /> !! html -<p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"x"}}' id="cite_ref-x-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span> -B <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"x"}}' id="cite_ref-x-1-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-x_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-x-1"},"attrs":{"name":"x"}}'><a href="#cite_note-x-1">[1]</a></span> +B <span about="#mwt4" class="reference" id="cite_ref-x_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"x"}}'><a href="#cite_note-x-1">[1]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-x-1" id="cite_note-x-1"><span rel="mw:referencedBy">↑ <a href="#cite_ref-x_1-0">1.0</a> <a href="#cite_ref-x_1-1">1.1</a></span> <span id="mw-reference-text-cite_note-x-1" class="mw-reference-text">foo</span></li> +</ol> !!end !!test @@ -18923,21 +20193,29 @@ parsoid A <ref name="x">foo</ref> B <ref name=" x " /> C <ref name= x /> +<references /> !! html -<p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"x"}}' id="cite_ref-x-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span> -B <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"x"}}' id="cite_ref-x-1-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span> -C <span about="#mwt3" class="reference" data-mw='{"name":"ref","attrs":{"name":"x"}}' id="cite_ref-x-1-2" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-x-1">[1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-x_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-x-1"},"attrs":{"name":"x"}}'><a href="#cite_note-x-1">[1]</a></span> +B <span about="#mwt4" class="reference" id="cite_ref-x_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"x"}}'><a href="#cite_note-x-1">[1]</a></span> +C <span about="#mwt6" class="reference" id="cite_ref-x_1-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"x"}}'><a href="#cite_note-x-1">[1]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-x-1" id="cite_note-x-1"><span rel="mw:referencedBy">↑ <a href="#cite_ref-x_1-0">1.0</a> <a href="#cite_ref-x_1-1">1.1</a> <a href="#cite_ref-x_1-2">1.2</a></span> <span id="mw-reference-text-cite_note-x-1" class="mw-reference-text">foo</span></li> +</ol> !!end +# NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly) !!test Ref: 4. 'constructor' should be accepted as a valid ref-name -(NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly) !!options parsoid !! wikitext A <ref name="constructor">foo</ref> +<references /> !! html -<p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"constructor"}}' id="cite_ref-constructor-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-constructor-1">[1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-constructor_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-constructor-1"},"attrs":{"name":"constructor"}}'><a href="#cite_note-constructor-1">[1]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-constructor-1" id="cite_note-constructor-1"><span rel="mw:referencedBy"><a href="#cite_ref-constructor_1-0">↑</a></span> <span id="mw-reference-text-cite_note-constructor-1" class="mw-reference-text">foo</span></li> +</ol> !!end !!test @@ -18951,11 +20229,11 @@ A <ref> <references /> !! html -<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"This is a <b data-parsoid='{\"dsr\":[19,40,3,3]}'><a rel=\"mw:WikiLink\" href=\"./Bolded_link\" title=\"Bolded link\" data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Bolded_link\"},\"sa\":{\"href\":\"bolded link\"},\"dsr\":[22,37,2,2]}'>bolded link</a></b> and this is a <span about=\"#mwt3\" typeof=\"mw:Transclusion\" data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"echo\",\"href\":\"./Template:Echo\"},\"params\":{\"1\":{\"wt\":\"transclusion\"}},\"i\":0}}]}' data-parsoid='{\"pi\":[[{\"k\":\"1\",\"spc\":[\"\",\"\",\"\",\"\"]}]],\"dsr\":[55,76,null,null]}'>transclusion</span>\n"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span></p> -<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> -<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> This is a <b><a rel="mw:WikiLink" href="./Bolded_link" title="Bolded link">bolded link</a></b> and this is a <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}'>transclusion</span> -</li> +<ol class="references" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">This is a <b><a rel="mw:WikiLink" href="Bolded_link" title="Bolded link">bolded link</a></b> and this is a <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}'>transclusion</span> +</span></li> </ol> !!end @@ -18972,13 +20250,13 @@ A <ref> <references /> !! html -<p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo\n bar\n baz\n"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span></p> -<ol class="references" typeof="mw:Extension/references" about="#mwt3" data-mw='{"name":"references","attrs":{}}'> -<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo bar baz -</li> +</span></li> </ol> !!end @@ -19002,10 +20280,10 @@ booz <references /> !! html -<p>A <span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo\n\nbar\n\n\nbaz\n\n\n\nbooz\n"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span></p> -<ol about="#mwt2" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'> -<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo bar @@ -19015,7 +20293,7 @@ baz booz -</li> +</span></li> </ol> !!end @@ -19028,9 +20306,9 @@ A <ref> foo {{echo|</ref> B C}} <references /> !! html -<p>A <span class="reference" data-mw="{"name":"ref","body":{"html":"foo <span typeof=\"mw:Nowiki\" data-parsoid='{\"src\":\"{{\",\"dsr\":[12,14,0,0]}'>{{</span>echo|"},"attrs":{}}" id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> B C<span typeof="mw:Nowiki">}}</span></p> -<ol class="references" typeof="mw:Extension/references" data-mw="{"name":"references","attrs":{}}"> -<li id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo <span typeof="mw:Nowiki">{{</span>echo|</li> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> B C<span typeof="mw:Nowiki">}}</span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo <span typeof="mw:Nowiki" data-parsoid='{"src":"{{","dsr":[12,14,0,0]}'>{{</span>echo|</span></li> </ol> !!end @@ -19042,9 +20320,9 @@ parsoid A <ref> foo <!--</ref> B C <references /> !! html -<p>A <span class="reference" data-mw='{"name":"ref","body":{"html":"foo <!---->"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> B C</p> -<ol class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'> -<li id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo </li> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> B C</p> +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo <!----></span></li> </ol> !!end @@ -19057,11 +20335,11 @@ A <ref> <b> foo </ref> B C <references /> !! html -<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"<b data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[8,16,3,0]}'> foo </b>"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref> <b> foo </ref>"}'><a href="#cite_note-1">[1]</a></span> B C</p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> B C</p> -<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-parsoid='{"src":"<references />"}' data-mw='{"name":"references","attrs":{}}'> -<li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> <b data-parsoid='{"stx":"html","autoInsertedEnd":true}'> foo </b></li> +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text"><b data-parsoid='{"stx":"html","autoInsertedEnd":true}'> foo </b></span></li> </ol> !!end @@ -19072,9 +20350,14 @@ parsoid !! wikitext A <ref>foo</ref> B C <ref>bar</ref> D +<references /> !! html -<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>foo</ref>"}'><a href="#cite_note-1">[1]</a></span> B -C <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>bar</ref>"}'><a href="#cite_note-2">[2]</a></span> D</p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> B +C <span about="#mwt4" class="reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-2"},"attrs":{}}'><a href="#cite_note-2">[2]</a></span> D</p> +<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li> +<li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2">↑</a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">bar</span></li> +</ol> !!end !!test @@ -19088,15 +20371,18 @@ b<!--the newline at the end of this line stays inside the p-tag--> <ref /> <ref /> c +<references /> !! html <p><!--the newline at the end of this line moves out of the p-tag-->a</p> -<p>b<!--the newline at the end of this line stays inside the p-tag--> <span about="#mwt1" class="reference" data-mw='{"name":"ref","attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> -<span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2">[2]</a></span></p> - +<p>b<!--the newline at the end of this line stays inside the p-tag--> <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{}}'><a href="#cite_note-1">[1]</a></span> +<span about="#mwt4" class="reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{}}'><a href="#cite_note-2">[2]</a></span></p> <p>c</p> +<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text"></span></li> +<li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2">↑</a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text"></span></li></ol> !!end !!test @@ -19107,9 +20393,15 @@ parsoid <ref>foo</ref> A <ref>bar </ref> B +<references /> !! html -<p><span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> A -<span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"bar\n"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2">[2]</a></span> B</p> +<p><span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> A +<span about="#mwt4" class="reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-2"},"attrs":{}}'><a href="#cite_note-2">[2]</a></span> B</p> +<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li> +<li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2">↑</a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">bar +</span></li> +</ol> !!end !!test @@ -19121,10 +20413,10 @@ parsoid <references /> !! html -<p><span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo &lt;ref>bar&lt;/ref> baz"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>foo <ref>bar</ref> baz</ref>"}'><a href="#cite_note-1">[1]</a></span></p> - -<ol class="references" typeof="mw:Extension/references" about="#mwt5" data-parsoid='{"src":"<references />"}' data-mw='{"name":"references","attrs":{}}'> -<li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo <ref>bar</ref> baz</li> +<p><span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> +</p> +<ol class="references" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo <ref>bar</ref> baz</span></li> </ol> !!end @@ -19138,10 +20430,10 @@ B1 <ref name="b" /> B2 <ref name="b">bar</ref> <references /> !! html -<p>A1 <span about="#mwt3" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"name":"a"}}' id="cite_ref-a-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-a-1">[1]</a></span> A2 <span about="#mwt4" class="reference" data-mw='{"name":"ref","attrs":{"name":"a"}}' id="cite_ref-a-1-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-a-1">[1]</a></span> -B1 <span about="#mwt7" class="reference" data-mw='{"name":"ref","attrs":{"name":"b"}}' id="cite_ref-b-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-b-2">[2]</a></span> B2 <span about="#mwt8" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"name":"b"}}' id="cite_ref-b-2-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-b-2">[2]</a></span></p> +<p>A1 <span about="#mwt3" class="reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-a-1"},"attrs":{"name":"a"}}'><a href="#cite_note-a-1">[1]</a></span> A2 <span about="#mwt4" class="reference" id="cite_ref-a_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a"}}'><a href="#cite_note-a-1">[1]</a></span> +B1 <span about="#mwt7" class="reference" id="cite_ref-b_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"b"}}'><a href="#cite_note-b-2">[2]</a></span> B2 <span about="#mwt8" class="reference" id="cite_ref-b_2-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-b-2"},"attrs":{"name":"b"}}'><a href="#cite_note-b-2">[2]</a></span></p> -<ol about="#mwt10" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-a-1" id="cite_note-a-1"><span rel="mw:referencedBy">↑ <a href="#cite_ref-a-1-0">1.0</a> <a href="#cite_ref-a-1-1">1.1</a></span> foo</li><li about="#cite_note-b-2" id="cite_note-b-2"><span rel="mw:referencedBy">↑ <a href="#cite_ref-b-2-0">2.0</a> <a href="#cite_ref-b-2-1">2.1</a></span> bar</li> +<ol class="references" typeof="mw:Extension/references" about="#mwt10" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-a-1" id="cite_note-a-1"><span rel="mw:referencedBy">↑ <a href="#cite_ref-a_1-0">1.0</a> <a href="#cite_ref-a_1-1">1.1</a></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text">foo</span></li><li about="#cite_note-b-2" id="cite_note-b-2"><span rel="mw:referencedBy">↑ <a href="#cite_ref-b_2-0">2.0</a> <a href="#cite_ref-b_2-1">2.1</a></span> <span id="mw-reference-text-cite_note-b-2" class="mw-reference-text">bar</span></li> </ol> !!end @@ -19155,10 +20447,78 @@ A <ref >foo</ref > <references /> !! html -<p>A <span class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li></ol> +!!end + +!!test +Ref: 17. Generate valid HTML5 id/about attributes +!!options +parsoid +!!wikitext +<ref name="a b">foo</ref> + +<references /> +!!html +<p><span class="reference" id="cite_ref-a_b_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-a_b-1"},"attrs":{"name":"a b"}}'><a href="#cite_note-a_b-1">[1]</a></span> +</p> + +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-a_b-1" id="cite_note-a_b-1"><span rel="mw:referencedBy"><a href="#cite_ref-a_b_1-0">↑</a></span> <span id="mw-reference-text-cite_note-a_b-1" class="mw-reference-text">foo</span></li> +</ol> +!!end + +!!test +Ref: 18. T58916: Extension attributes should be parsed as plain text +!!options +parsoid +!!wikitext +<ref name="{{echo|a}}">foo</ref> + +<references /> +!!html +<p><span class="reference" id="cite_ref-.7B.7Becho.7Ca.7D.7D_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-.7B.7Becho.7Ca.7D.7D-1"},"attrs":{"name":"{{echo|a}}"}}'><a href="#cite_note-.7B.7Becho.7Ca.7D.7D-1">[1]</a></span> +</p> + +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-.7B.7Becho.7Ca.7D.7D-1" id="cite_note-.7B.7Becho.7Ca.7D.7D-1"><span rel="mw:referencedBy"><a href="#cite_ref-.7B.7Becho.7Ca.7D.7D_1-0">↑</a></span> <span id="mw-reference-text-cite_note-.7B.7Becho.7Ca.7D.7D-1" class="mw-reference-text">foo</span></li> +</ol> +!!end + +!!test +Ref: 19. ref-tags with identical name encodings should get identical indexes +!!options +parsoid +!! wikitext +1 <ref name="a & b">foo</ref> 2 <ref name="a & b" /> + +<references /> +!! html +<p>1 <span about="#mwt3" class="reference" id="cite_ref-a_.26_b_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-a_.26_b-1"},"attrs":{"name":"a & b"}}'><a href="#cite_note-a_.26_b-1">[1]</a></span> 2 <span about="#mwt4" class="reference" id="cite_ref-a_.26_b_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a &amp; b"}}'><a href="#cite_note-a_.26_b-1">[1]</a></span> +</p> +<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-a_.26_b-1" id="cite_note-a_.26_b-1"><span rel="mw:referencedBy">↑ <a href="#cite_ref-a_.26_b_1-0">1.0</a> <a href="#cite_ref-a_.26_b_1-1">1.1</a></span> <span id="mw-reference-text-cite_note-a_.26_b-1" class="mw-reference-text">foo</span></li> +</ol> +!!end -<ol class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'> -<li id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo</li></ol> +!!test +Ref: 20. ref-tags with identical names but different content should keep it +!!options +parsoid +!! wikitext +A <ref name="foo">Foo one</ref> +B <ref name="foo">Foo two</ref> +C <ref name="foo" /> + +<references /> +!! html +<p>A <span about="#mwt2" class="reference" id="cite_ref-foo_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-foo-1"},"attrs":{"name":"foo"}}'><a href="#cite_note-foo-1">[1]</a></span> +B <span about="#mwt4" class="reference" id="cite_ref-foo_1-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"html":"Foo two"},"attrs":{"name":"foo"}}'><a href="#cite_note-foo-1">[1]</a></span> +C <span about="#mwt6" class="reference" id="cite_ref-foo_1-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"foo"}}'><a href="#cite_note-foo-1">[1]</a></span></p> + +<ol class="references" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-foo-1" id="cite_note-foo-1"><span rel="mw:referencedBy">↑ <a href="#cite_ref-foo_1-0">1.0</a> <a href="#cite_ref-foo_1-1">1.1</a> <a href="#cite_ref-foo_1-2">1.2</a></span> <span id="mw-reference-text-cite_note-foo-1" class="mw-reference-text">Foo one</span></li> +</ol> !!end !!test @@ -19168,7 +20528,7 @@ parsoid !! wikitext <references /> !! html -<ol about="#mwt2" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'></ol> +<ol class="references" typeof="mw:Extension/references" about="#mwt2" data-mw='{"name":"references","attrs":{}}'></ol> !!end !!test @@ -19178,13 +20538,24 @@ parsoid !! wikitext A <ref group="a">foo</ref> B <ref group="b">bar</ref> +C <ref>baz</ref> <references group="a" /> +<references /> +<references group="b" /> !! html -<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{"group":"a"}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[a 1]</a></span> -B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"group":"b"}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2">[b 1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{"group":"a"}}'><a href="#cite_note-1">[a 1]</a></span> +B <span about="#mwt4" class="reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-2"},"attrs":{"group":"b"}}'><a href="#cite_note-2">[b 1]</a></span> +C <span class="reference" id="cite_ref-3" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-3"},"attrs":{}}'><a href="#cite_note-3">[1]</a></span></p> -<ol about="#mwt6" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{"group":"a"}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo</li> +<ol class="references" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{"group":"a"}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li> +</ol> +<ol class="references" typeof="mw:Extension/references" about="#mwt10" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-3" id="cite_note-3"><span rel="mw:referencedBy"><a href="#cite_ref-3">↑</a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text">baz</span></li> +</ol> +<ol class="references" typeof="mw:Extension/references" about="#mwt12" data-mw='{"name":"references","attrs":{"group":"b"}}'> +<li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2">↑</a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">bar</span></li> </ol> !!end @@ -19201,14 +20572,15 @@ B <ref>bar</ref> <references /> !! html -<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span></p> -<ol about="#mwt4" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo</li> +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li> </ol> -<p>B <span about="#mwt6" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2">[1]</a></span></p> +<p>B <span about="#mwt6" class="reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-2"},"attrs":{}}'><a href="#cite_note-2">[1]</a></span></p> -<ol about="#mwt8" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2-0">↑</a></span> bar</li> +<ol class="references" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2">↑</a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">bar</span></li> </ol> !!end @@ -19226,15 +20598,15 @@ C <ref>cfoo</ref> <references /> !! html -<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"afoo"},"attrs":{"group":"a"}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[a 1]</a></span> -B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bfoo"},"attrs":{}}' id="cite_ref-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>bfoo</ref>"}'><a href="#cite_note-2">[1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{"group":"a"}}'><a href="#cite_note-1">[a 1]</a></span> +B <span about="#mwt4" class="reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-2"},"attrs":{}}'><a href="#cite_note-2">[1]</a></span></p> -<ol about="#mwt6" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{"group":"a"}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> afoo</li> +<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{"group":"a"}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">afoo</span></li> </ol> -<p>C <span about="#mwt8" class="reference" data-mw='{"name":"ref","body":{"html":"cfoo"},"attrs":{}}' id="cite_ref-3-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-3">[2]</a></span></p> +<p>C <span about="#mwt8" class="reference" id="cite_ref-3" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-3"},"attrs":{}}'><a href="#cite_note-3">[2]</a></span></p> -<ol about="#mwt10" class="references" typeof="mw:Extension/references" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2-0">↑</a></span> bfoo</li><li about="#cite_note-3" id="cite_note-3"><span rel="mw:referencedBy"><a href="#cite_ref-3-0">↑</a></span> cfoo</li> +<ol class="references" typeof="mw:Extension/references" about="#mwt10" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2">↑</a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">bfoo</span></li><li about="#cite_note-3" id="cite_note-3"><span rel="mw:referencedBy"><a href="#cite_ref-3">↑</a></span> <span id="mw-reference-text-cite_note-3" class="mw-reference-text">cfoo</span></li> </ol> !!end @@ -19251,13 +20623,11 @@ B <ref name="b">bar</ref> This should just get lost. </references> !! html -<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","attrs":{"name":"a"}}' id="cite_ref-a-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref name=\"a\" />"}'><a href="#cite_note-a-1">[1]</a></span> -B <span about="#mwt4" class="reference" data-mw='{"name":"ref","body":{"html":"bar"},"attrs":{"name":"b"}}' id="cite_ref-b-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref name=\"b\">bar</ref>"}'><a href="#cite_note-b-2">[2]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-a_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"a"}}'><a href="#cite_note-a-1">[1]</a></span> +B <span about="#mwt4" class="reference" id="cite_ref-b_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-b-2"},"attrs":{"name":"b"}}'><a href="#cite_note-b-2">[2]</a></span></p> -<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-parsoid='{"src":"<references>\n<ref name=\"a\">foo</ref>\nThis should just get lost.\n</references>"}' data-mw='{"name":"references","body":{"extsrc":"<ref name=\"a\">foo</ref>\nThis should just get lost.","html":"\n<span about=\"#mwt8\" class=\"reference\" data-mw='{\"name\":\"ref\",\"body\":{\"html\":\"foo\"},\"attrs\":{\"name\":\"a\"}}' rel=\"dc:references\" typeof=\"mw:Extension/ref\"><a href=\"#cite_note-a-1\">[1]</a></span>\n"},"attrs":{}}'> -<li about="#cite_note-a-1" id="cite_note-a-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-a-1-0">↑</a></span> foo</li> -<li about="#cite_note-b-2" id="cite_note-b-2" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-b-2-0">↑</a></span> bar</li> +<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","body":{"extsrc":"<ref name=\"a\">foo</ref>\nThis should just get lost.","html":"\n<span about=\"#mwt8\" class=\"reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[59,82,14,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-a-1\"},\"attrs\":{\"name\":\"a\"}}'><a href=\"#cite_note-a-1\">[1]</a></span>\n"},"attrs":{}}'><li about="#cite_note-a-1" id="cite_note-a-1"><span rel="mw:referencedBy"><a href="#cite_ref-a_1-0">↑</a></span> <span id="mw-reference-text-cite_note-a-1" class="mw-reference-text">foo</span></li><li about="#cite_note-b-2" id="cite_note-b-2"><span rel="mw:referencedBy"><a href="#cite_ref-b_2-0">↑</a></span> <span id="mw-reference-text-cite_note-b-2" class="mw-reference-text">bar</span></li> </ol> !!end @@ -19268,7 +20638,8 @@ parsoid !! wikitext <ref>Foo</ref> {{echo|<references />}} !! html -<span about="#mwt3" class="reference" data-mw='{"name":"ref","body":{"html":"Foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> <ol class="references" typeof="mw:Extension/references mw:Transclusion" about="#mwt4" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<references />"}},"i":0}}]}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> Foo</li></ol> +<p><span about="#mwt3" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span></p> <ol class="references" typeof="mw:Extension/references mw:Transclusion" about="#mwt4" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<references />"}},"i":0}}]}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">Foo</span></li> +</ol> !!end !! test @@ -19285,22 +20656,81 @@ B <ref group="X" name="b" /> <ref name="b">foo</ref> </references> !! html -<p>A <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo bar for a"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>foo bar for a</ref>"}'><a href="#cite_note-1" data-parsoid="{}">[1]</a></span> -B <span about="#mwt4" class="reference" data-mw='{"name":"ref","attrs":{"group":"X","name":"b"}}' id="cite_ref-b-2-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref group=\"X\" name=\"b\" />"}'><a href="#cite_note-b-2" data-parsoid="{}">[X 1]</a></span></p> +<p>A <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> +B <span about="#mwt4" class="reference" id="cite_ref-b_2-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"group":"X","name":"b"}}'><a href="#cite_note-b-2">[X 1]</a></span> +</p> -<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-parsoid='{"src":"<references />"}' data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy" data-parsoid="{}"><a href="#cite_ref-1-0" data-parsoid="{}">↑</a></span> foo bar for a</li></ol> +<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo bar for a</span></li> +</ol> -<ol class="references" typeof="mw:Extension/references" about="#mwt8" data-parsoid='{"src":"<references group=\"X\">\n<ref name=\"b\">foo</ref>\n</references>","group":"X"}' data-mw='{"name":"references","body":{"extsrc":"<ref name=\"b\">foo</ref>","html":"\n<span about=\"#mwt10\" class=\"reference\" data-mw='{\"name\":\"ref\",\"body\":{\"html\":\"foo\"},\"attrs\":{\"name\":\"b\"}}' rel=\"dc:references\" typeof=\"mw:Extension/ref\"><a href=\"#cite_note-b-2\">[X 1]</a></span>\n"},"attrs":{"group":"X"}}'><li about="#cite_note-b-2" id="cite_note-b-2" data-parsoid="{}"><span rel="mw:referencedBy" data-parsoid="{}"><a href="#cite_ref-b-2-0" data-parsoid="{}">↑</a></span> foo</li></ol> +<ol class="references" typeof="mw:Extension/references" about="#mwt8" data-mw='{"name":"references","body":{"extsrc":"<ref name=\"b\">foo</ref>","html":"\n<span about=\"#mwt10\" class=\"reference\" rel=\"dc:references\" typeof=\"mw:Extension/ref\" data-parsoid='{\"dsr\":[96,119,14,6]}' data-mw='{\"name\":\"ref\",\"body\":{\"id\":\"mw-reference-text-cite_note-b-2\"},\"attrs\":{\"name\":\"b\"}}'><a href=\"#cite_note-b-2\">[X 1]</a></span>\n"},"attrs":{"group":"X"}}'> +<li about="#cite_note-b-2" id="cite_note-b-2"><span rel="mw:referencedBy"><a href="#cite_ref-b_2-0">↑</a></span> <span id="mw-reference-text-cite_note-b-2" class="mw-reference-text">foo</span></li> +</ol> !! end !! test +References: 8. T88019: Remove <meta>s from templates inside <ref> that's itself inside a template +!! options +parsoid +!! wikitext +X{{echo|<ref>foo {{echo|<b>bar</b>}} and {{echo|baz}} boo</ref>}} +<references /> +!! html +<p>X<span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Transclusion mw:Extension/ref" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<ref>foo {{echo|<b>bar</b>}} and {{echo|baz}} boo</ref>"}},"i":0}}]}'><a href="#cite_note-1">[1]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt7" data-mw='{"name":"references","attrs":{}}'><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo <b data-parsoid='{"stx":"html"}'>bar</b> and baz boo</span></li> +</ol> +!!end + +# This test only works in wt2html now as the <references /> are always generated +# unless selser is active. Once T72722 is fixed, we should add a changes test +# here to ensure that unrelated changes don't add the new <references /> in +# wt2wt. +!! test +References: 9. Generate missing references list at the end +!! options +parsoid +!! wikitext +A <ref>foo</ref> +B <ref group="inexistent">bar</ref> +!! html +<p>A <span class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> B <span class="reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-2"},"attrs":{"group":"inexistent"}}'><a href="#cite_note-2">[inexistent 1]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li> +</ol> +<ol class="references" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{"group":"inexistent"}}'> +<li about="#cite_note-2" id="cite_note-2"><span rel="mw:referencedBy"><a href="#cite_ref-2">↑</a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text">bar</span></li> +</ol> +!! end + +!! test +References: 10. New <references/> shouldn't be added for unrelated edits. +!! options +parsoid={ + "modes": ["selser"], + "changes": [["#x", "remove"]], + "selser": "noauto" +} +!! wikitext +Unrelated text<span id="x"> that's going to disappear</span>. +A <ref>foo</ref> +!! wikitext/edited +Unrelated text. +A <ref>foo</ref> +!!end + +!! test Entities in ref name !! options parsoid !! wikitext <ref name="test & me">hi</ref> +<references /> !! html -<p data-parsoid='{}'><span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"hi"},"attrs":{"name":"test & me"}}' id="cite_ref-test & me-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref name=\"test &amp; me\">hi</ref>"}'><a href="#cite_note-test & me-1" data-parsoid="{}">[1]</a></span></p> +<p><span about="#mwt2" class="reference" id="cite_ref-test_.26_me_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-test_.26_me-1"},"attrs":{"name":"test &amp; me"}}'><a href="#cite_note-test_.26_me-1">[1]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-test_.26_me-1" id="cite_note-test_.26_me-1"><span rel="mw:referencedBy"><a href="#cite_ref-test_.26_me_1-0">↑</a></span> <span id="mw-reference-text-cite_note-test_.26_me-1" class="mw-reference-text">hi</span></li> +</ol> !! end # This test is wt2html only because we're permitting the serializer to produce @@ -19314,11 +20744,9 @@ a<ref>foo</ref> <references> !! html -<p data-parsoid='{}'>a<span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"foo"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref>foo</ref>"}'><a href="#cite_note-1" data-parsoid="{}">[1]</a></span></p> - - -<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-parsoid='{"src":"<references>"}' data-mw='{"name":"references","attrs":{}}'> -<li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy" data-parsoid="{}"><a href="#cite_ref-1-0" data-parsoid="{}">↑</a></span> foo</li></ol> +<p>a<span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">foo</span></li></ol> !! end !! test @@ -19333,6 +20761,85 @@ foo<ol class="references" typeof="mw:Extension/references" about="#mwt2" data-mw !! end #### ---------------------------------------------------------------- +#### Parsoid-only testing of Parsoid's impl of LST +#### Not implemented yet, see +#### https://www.mediawiki.org/wiki/Parsoid/HTML_based_LST +#### ---------------------------------------------------------------- + +!!test +LST Sections: 1. Simple section start and end +!! wikitext +<section begin="2011-05-16" /> +<section end="2014-04-10 (MW 1.23wmf22)" /> +!! html/parsoid +<p><meta typeof="mw:Extension/LabeledSectionTransclusion/begin" content="2011-05-16"/> +<meta typeof="mw:Extension/LabeledSectionTransclusion/end" content="2014-04-10 (MW 1.23wmf22)"/></p> +!! end + +#--------- Test stripping of empty nodes in template content ---------- +!!test +Empty LI and TR nodes should be stripped from template content +!!wikitext +{{EmptyLITest}} +{{EmptyTRTest}} +!!html/parsoid +<ul about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"EmptyLITest","href":"./Template:EmptyLITest"},"params":{},"i":0}}]}'> +<li>a</li> +<li>b</li> +</ul> +<table about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"EmptyTRTest","href":"./Template:EmptyTRTest"},"params":{},"i":0}}]}'> +<tbody> +<tr> +<td>foo</td> +</tr> +<tr> +<td>bar</td> +</tr> +</tbody> +</table> +!!end + +!!test +Empty LI and TR nodes should not be stripped from top-level content +!!wikitext +* a +* +* b +{| +|- +|- +|foo +|} +!!html/parsoid +<ul> +<li> a</li> +<li></li> +<li> b</li> +</ul> +<table> +<tbody> +<tr></tr> +<tr> +<td>foo</td> +</tr> +</tbody> +</table> +!!end + +!!test +Empty TR nodes should not be stripped if they have any attributes set +!!wikitext +{{EmptyTRWithHTMLAttrTest}} +!!html/parsoid +<table about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"EmptyTRWithHTMLAttrTest","href":"./Template:EmptyTRWithHTMLAttrTest"},"params":{},"i":0}}]}'> +<tr align="center"></tr> +<tr><td>foo</td></tr> +<tr align="center"></tr> +<tr><td>bar</td></tr> +</table> +!!end + +#### ---------------------------------------------------------------- #### The following section of tests are primarily to test #### wikitext escaping capabilities of Parsoid. Given that #### escaping can be done any number of ways, the wikitext (input) @@ -19376,11 +20883,22 @@ parsoid <p>=foo<i>a</i><span typeof="mw:Nowiki">=</span></p> !!end +# New headings and existing headings are handled differently !! test Headings: 1. Nested inside html -(New headings and existing headings are handled differently) !! options parsoid=html2wt +!! html +<h1>=foo=</h1> +<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> !! wikitext = =foo= = @@ -19395,23 +20913,16 @@ parsoid=html2wt =====<nowiki>=foo=</nowiki>===== ======<nowiki>=foo=</nowiki>====== -!! html -<h1>=foo=</h1> -<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> !!end !! test Headings: 2. Outside heading nest on a single line <h1>foo</h1>*bar !! options parsoid=html2wt +!! html +<h1>foo</h1>*bar +<h1>foo</h1>=bar +<h1>foo</h1>=bar= !! wikitext = foo = <nowiki>*</nowiki>bar @@ -19421,26 +20932,20 @@ parsoid=html2wt = foo = <nowiki>=bar=</nowiki> -!! html -<h1>foo</h1>*bar -<h1>foo</h1>=bar -<h1>foo</h1>=bar= !!end !! test Headings: 3. Nested inside html with wikitext split by html tags !! options -parsoid=html2wt +parsoid=html2wt,wt2wt !! wikitext = ='''bold'''<nowiki>foo=</nowiki> = -!! html -<h1>=<b>bold</b><span typeof="mw:Nowiki">foo=</span></h1> +!! html/parsoid +<h1>=<b>bold</b>foo=</h1> !!end !! test Headings: 4a. No escaping needed (testing just h1 and h2) -!! options -parsoid=html2wt !! wikitext = =foo = @@ -19454,33 +20959,33 @@ parsoid=html2wt == foo= == -= ''=''foo= = += = = -= <nowiki>=</nowiki> = -!! html += ''=''foo= = +!! html/parsoid <h1>=foo</h1> <h1>foo=</h1> <h1> =foo= </h1> <h1>=foo= bar</h1> <h2>=foo</h2> <h2>foo=</h2> +<h1>=</h1> <h1><i>=</i>foo=</h1> -<h1><span typeof="mw:Nowiki">=</span></h1> !!end !! test Headings: 4b. No escaping needed (inside p-tags) !! options parsoid=html2wt -!! wikitext -=== -=foo= x -=foo= <s></s> !! html <p>=== =foo= x =foo= <s></s> </p> +!! wikitext +=== +=foo= x +=foo= <s></s> !!end !! test @@ -19584,12 +21089,30 @@ parsoid Headings: 6d. Heading chars in SOL context (No escaping needed) !! options parsoid=html2wt -!! wikitext -=a=<div>b</div> !! html =a=<div>b</div> +!! wikitext +=a=<div>b</div> !!end +!! test +Headings: 7. Insert a newline between new content and headings +!! options +parsoid=html2wt +!! html +<h2>NEW</h2> +<p>new</p> +<h2 data-parsoid='{"dsr":[0,5,2,2]}'>A</h2> +<p data-parsoid='{"dsr":[6,7,0,0]}'>a</p> +!! wikitext +== NEW == +new + +==A== +a + +!! end + #### --------------- Lists --------------- #### 0. Outside nests (*foo, etc.) #### 1. Nested inside html <ul><li>*foo</li></ul> @@ -19714,33 +21237,36 @@ Lists: 5. No unnecessary escapes !! wikitext * bar <span><nowiki>[[foo]]</nowiki></span> -*=bar <span><nowiki>[[foo]]</nowiki></span> +* =bar <span><nowiki>[[foo]]</nowiki></span> -*[[bar <span><nowiki>[[foo]]</nowiki></span> +* [[bar <span><nowiki>[[foo]]</nowiki></span> -*]]bar <span><nowiki>[[foo]]</nowiki></span> +* ]]bar <span><nowiki>[[foo]]</nowiki></span> -*=bar <span>foo]]</span>= +* =bar <span>foo]]</span>= * <s></s>: a + +* ''* foo'' !! html <ul><li> bar <span>[[foo]]</span></li></ul> -<ul><li>=bar <span>[[foo]]</span></li></ul> -<ul><li>[[bar <span>[[foo]]</span></li></ul> -<ul><li>]]bar <span>[[foo]]</span></li></ul> -<ul><li>=bar <span>foo]]</span>=</li></ul> +<ul><li> =bar <span>[[foo]]</span></li></ul> +<ul><li> [[bar <span>[[foo]]</span></li></ul> +<ul><li> ]]bar <span>[[foo]]</span></li></ul> +<ul><li> =bar <span>foo]]</span>=</li></ul> <ul><li> <s></s>: a</li></ul> +<ul><li> <i>* foo</i></li></ul> !!end !! test Lists: 6. Escape bullets in SOL position !! options -parsoid -!! wikitext -<!--cmt--><nowiki>*foo</nowiki> +parsoid=html2wt !! html -<p><!--cmt--><span typeof="mw:Nowiki">*foo</span></p> +<p><!--cmt-->*foo</p> +!! wikitext +<!--cmt--><nowiki>*</nowiki>foo !!end !! test @@ -19754,22 +21280,33 @@ a </p> !!end +!! test +Lists: 8. Escape colons only if not present in tags +!! options +parsoid=html2wt +!! html +<dl><dt>a:b<i>c:d</i></dt></dl> +!! wikitext +; <nowiki>a:b</nowiki>''c:d'' +!! end + #### --------------- HRs --------------- #### 1. Single line #### ----------------------------------- !! test HRs: 1. Single line -!! options -parsoid !! wikitext ----<nowiki>----</nowiki> ----=foo= ----*foo -!! html -<hr><span typeof="mw:Nowiki">----</span> -<hr>=foo= -<hr>*foo +!! html+tidy +<hr /> +<p>----</p> +<hr /> +<p>=foo=</p> +<hr /> +<p>*foo</p> !! end #### --------------- Tables --------------- @@ -19833,127 +21370,196 @@ Tables: 1d. No escaping needed Tables: 2a. Nested in td !! options parsoid=html2wt +!! html/parsoid +<table><tbody><tr> +<td>foo|bar</td></tr> +<tr><td>x<div>a|b</div></td> +</tbody></table> !! wikitext {| |<nowiki>foo|bar</nowiki> |- |x<div><nowiki>a|b</nowiki></div> |} -!! html -<table><tbody><tr> -<td>foo|bar</td></tr> -<tr><td>x<div>a|b</div></td> -</tbody></table> +!! html/php+tidy +<table> +<tr> +<td>foo|bar</td> +</tr> +<tr> +<td>x +<div>a|b</div> +</td> +</tr> +</table> !! end !! test Tables: 2b. Nested in td !! options -parsoid +parsoid=html2wt +!! html/parsoid +<table><tbody><tr> +<td>foo||bar</td> +<td>a<i>b||c</i></td> +<td>a<i><div>b||c</div></i></td> +</tr></tbody></table> !! wikitext {| |<nowiki>foo||bar</nowiki> -|''it''<nowiki>foo||bar</nowiki> +|a''<nowiki>b||c</nowiki>'' +|a''<div><nowiki>b||c</nowiki></div>'' |} -!! html -<table><tbody><tr> -<td><span typeof="mw:Nowiki">foo||bar</span></td> -<td><i>it</i><span typeof="mw:Nowiki">foo||bar</span></td></tr></tbody></table> +!! html/php +<table> +<tr> +<td>foo||bar +</td> +<td>a<i>b||c</i> +</td> +<td>a<i><div>b||c</div></i> +</td></tr></table> + !! end !! test Tables: 2c. Nested in td -- no escaping needed -!! options -parsoid !! wikitext {| + |foo!!bar |} -!! html -<table><tbody><tr><td>foo!!bar -</td></tr></tbody></table> +!! html/* +<table> + +<tr> +<td>foo!!bar +</td></tr></table> !! end !! test Tables: 3a. Nested in th -!! options -parsoid !! wikitext {| + !foo!bar |} -!! html -<table><tbody><tr><th>foo!bar -</th></tr></tbody></table> +!! html/* +<table> + +<tr> +<th>foo!bar +</th></tr></table> !! end !! test Tables: 3b. Nested in th !! options -parsoid +parsoid=html2wt +!! html/parsoid +<table><tbody> +<tr><th>foo!!bar</th> +<th><i>foo|bar</i></th> +<th><i>foo!!bar</i></th> +<th><i><span>foo!!bar</span></i></th> +</tr></tbody></table> !! wikitext {| !<nowiki>foo!!bar</nowiki> +!''<nowiki>foo|bar</nowiki>'' +!''<nowiki>foo!!bar</nowiki>'' +!''<span><nowiki>foo!!bar</nowiki></span>'' |} -!! html +!! html/php <table> -<tbody><tr><th><span typeof="mw:Nowiki">foo!!bar</span></th></tr> -</tbody></table> +<tr> +<th>foo!!bar +</th> +<th><i>foo|bar</i> +</th> +<th><i>foo!!bar</i> +</th> +<th><i><span>foo!!bar</span></i> +</th></tr></table> + !! end !! test -Tables: 3c. Nested in th -- no escaping needed +Tables: 3c. Nested in th !! options -parsoid +parsoid=html2wt +!! html/parsoid +<table><tbody> +<tr><th>foo||bar</th> +<th><span typeof="mw:Nowiki">foo||bar</span></th> +</tr></tbody></table> !! wikitext {| !<nowiki>foo||bar</nowiki> +!<nowiki>foo||bar</nowiki> |} -!! html -<table><tbody><tr> -<th><span typeof="mw:Nowiki">foo||bar</span></th></tr></tbody></table> +!! html/php +<table> +<tr> +<th>foo||bar +</th> +<th>foo||bar +</th></tr></table> + !! end !! test Tables: 4a. Escape - !! options -parsoid +parsoid=html2wt +!! html/* +<table> + +<tr> +<th>-bar +</th></tr> +<tr> +<td>-bar +</td></tr></table> + !! wikitext {| + !-bar + |- |<nowiki>-bar</nowiki> |} -!! html -<table><tbody> -<tr><th>-bar</th></tr> -<tr> -<td><span typeof="mw:Nowiki">-bar</span></td></tr></tbody></table> !! end !! test Tables: 4b. Escape + !! options -parsoid +parsoid=html2wt +!! html/* +<table> + +<tr> +<th>+bar +</th></tr> +<tr> +<td>+bar +</td></tr></table> + !! wikitext {| + !+bar + |- |<nowiki>+bar</nowiki> |} -!! html -<table><tbody> -<tr><th>+bar</th></tr> -<tr> -<td><span typeof="mw:Nowiki">+bar</span></td></tr></tbody></table> !! end !! test Tables: 4c. No escaping needed -!! options -parsoid !! wikitext {| |foo-bar @@ -19970,7 +21576,31 @@ bar|baz |x <div>a|b</div> |} -!! html +!! html/php +<table> +<tr> +<td>foo-bar +</td> +<td>foo+bar +</td></tr> +<tr> +<td><i>foo</i>-bar +</td> +<td><i>foo</i>+bar +</td></tr> +<tr> +<td>foo +<p>bar|baz ++bar +-bar +</p> +</td></tr> +<tr> +<td>x +<div>a|b</div> +</td></tr></table> + +!! html/parsoid <table><tbody> <tr><td>foo-bar</td><td>foo+bar</td></tr> <tr><td><i>foo</i>-bar</td><td><i>foo</i>+bar</td></tr> @@ -19985,15 +21615,23 @@ bar|baz !! test Tables: 4d. No escaping needed -!! options -parsoid !! wikitext {| |[[Foo]]-bar ||+1 ||-2 |} -!! html +!! html/php +<table> +<tr> +<td><a href="/wiki/Foo" title="Foo">Foo</a>-bar +</td> +<td>+1 +</td> +<td>-2 +</td></tr></table> + +!! html/parsoid <table> <tbody><tr><td><a rel="mw:WikiLink" href="./Foo" title="Foo">Foo</a>-bar</td> <td data-parsoid='{"startTagSrc":"|","attrSepSrc":"|"}'>+1</td> @@ -20026,23 +21664,39 @@ parsoid=wt2html #### 5. Extlinks: No escapes needed #### -------------------------------------- !! test -Links 1. Quote marks in link text -!! options -parsoid +Links 1. WikiLinks: No escapes needed !! wikitext -[[Foo|Foo<nowiki>''boo''</nowiki>]] -!! html -<a rel="mw:WikiLink" href="Foo">Foo''boo''</a> +[[Foo|Foo''boo'']] +[[Foo|[Foobar]]] +[[Foo|x [Foobar] x]] +!! html/php +<p><a href="/wiki/Foo" title="Foo">Foo<i>boo</i></a> +<a href="/wiki/Foo" title="Foo">[Foobar]</a> +<a href="/wiki/Foo" title="Foo">x [Foobar] x</a> +</p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="Foo" title="Foo">Foo<i>boo</i></a> +<a rel="mw:WikiLink" href="Foo" title="Foo">[Foobar]</a> +<a rel="mw:WikiLink" href="Foo" title="Foo">x [Foobar] x</a></p> !! end !! test Links 2. WikiLinks: Escapes needed !! options -parsoid +parsoid=html2wt +!! html/parsoid +<a href="Foo" rel="mw:WikiLink">Foobar]</a> +<a href="Foo" rel="mw:WikiLink">x [http://google.com g] x</a> +<a href="Foo" rel="mw:WikiLink">[[Bar]]</a> +<a href="Foo" rel="mw:WikiLink">x [[Bar]] x</a> +<a href="Foo" rel="mw:WikiLink">|Bar</a> +<a href="Foo" rel="mw:WikiLink">]]bar</a> +<a href="Foo" rel="mw:WikiLink">[[bar</a> +<a href="Foo" rel="mw:WikiLink">x [[ y</a> +<a href="Foo" rel="mw:WikiLink">x ]] y</a> +<a href="Foo" rel="mw:WikiLink">x ]] y [[ z</a> !! wikitext -[[Foo|[Foobar]]] [[Foo|<nowiki>Foobar]</nowiki>]] -[[Foo|x [Foobar] x]] [[Foo|x <nowiki>[http://google.com g]</nowiki> x]] [[Foo|<nowiki>[[Bar]]</nowiki>]] [[Foo|<nowiki>x [[Bar]] x</nowiki>]] @@ -20052,37 +21706,43 @@ parsoid [[Foo|<nowiki>x [[ y</nowiki>]] [[Foo|<nowiki>x ]] y</nowiki>]] [[Foo|<nowiki>x ]] y [[ z</nowiki>]] -!! html -<a href="Foo" rel="mw:WikiLink">[Foobar]</a> -<a href="Foo" rel="mw:WikiLink">Foobar]</a> -<a href="Foo" rel="mw:WikiLink">x [Foobar] x</a> -<a href="Foo" rel="mw:WikiLink">x [http://google.com g] x</a> -<a href="Foo" rel="mw:WikiLink">[[Bar]]</a> -<a href="Foo" rel="mw:WikiLink">x [[Bar]] x</a> -<a href="Foo" rel="mw:WikiLink">|Bar</a> -<a href="Foo" rel="mw:WikiLink">]]bar</a> -<a href="Foo" rel="mw:WikiLink">[[bar</a> -<a href="Foo" rel="mw:WikiLink">x [[ y</a> -<a href="Foo" rel="mw:WikiLink">x ]] y</a> -<a href="Foo" rel="mw:WikiLink">x ]] y [[ z</a> +!! html/php +<p><a href="/wiki/Foo" title="Foo">Foobar]</a> +<a href="/wiki/Foo" title="Foo">x [http://google.com g] x</a> +<a href="/wiki/Foo" title="Foo">[[Bar]]</a> +<a href="/wiki/Foo" title="Foo">x [[Bar]] x</a> +<a href="/wiki/Foo" title="Foo">|Bar</a> +<a href="/wiki/Foo" title="Foo">]]bar</a> +<a href="/wiki/Foo" title="Foo">[[bar</a> +<a href="/wiki/Foo" title="Foo">x [[ y</a> +<a href="/wiki/Foo" title="Foo">x ]] y</a> +<a href="/wiki/Foo" title="Foo">x ]] y [[ z</a> +</p> !! end !! test Links 3. WikiLinks: No escapes needed -!! options -parsoid !! wikitext [[Foo|[Foobar]] [[Foo|foo|bar]] -!! html -<a href="Foo" rel="mw:WikiLink">[Foobar</a> -<a href="Foo" rel="mw:WikiLink">foo|bar</a> +!! html/php +<p><a href="/wiki/Foo" title="Foo">[Foobar</a> +<a href="/wiki/Foo" title="Foo">foo|bar</a> +</p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="Foo">[Foobar</a> +<a rel="mw:WikiLink" href="Foo" title="Foo">foo|bar</a></p> !! end !! test Links 4. ExtLinks: Escapes needed !! options -parsoid +parsoid=html2wt +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://google.com">[google]</a> +<a rel="mw:ExtLink" href="http://google.com">google]</a></p> +<p>[http://google.com]</p> +<p>[http://google.com google]</p> !! wikitext [http://google.com <nowiki>[google]</nowiki>] [http://google.com <nowiki>google]</nowiki>] @@ -20091,21 +21751,23 @@ parsoid <nowiki>[http://google.com google]</nowiki> -!! html -<p><a href="http://google.com" rel="mw:ExtLink">[google]</a> -<a href="http://google.com" rel="mw:ExtLink">google]</a></p> -<p>[http://google.com]</p> -<p>[http://google.com google]</p> +!! html/php +<p><a rel="nofollow" class="external text" href="http://google.com">[google]</a> +<a rel="nofollow" class="external text" href="http://google.com">google]</a> +</p><p>[http://google.com] +</p><p>[http://google.com google] +</p> !! end !! test Links 5. ExtLinks: No escapes needed -!! options -parsoid !! wikitext [http://google.com [google] -!! html -<a href="http://google.com" rel="mw:ExtLink">[google</a> +!! html/php +<p><a rel="nofollow" class="external text" href="http://google.com">[google</a> +</p> +!! html/parsoid +<p><a rel="mw:ExtLink" href="http://google.com">[google</a></p> !! end !! test @@ -20162,61 +21824,90 @@ y (http://example.com) foo http://example.com, http://example.com, foo +!! html/php +<p>x +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a> +y +"<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>" +(<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>) +(<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>) foo +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>, +<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>, foo +</p> !! end -## Parsoid currently fails wt2html on this one! !! test Links 7b. Don't add spurious <nowiki/>s between text-nodes and url-links (bug 64300) !! html/parsoid -<p><a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"stx":"url"}'>http://example.com</a>.,;:!?</p> +<p><a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"stx":"url"}'>http://example.com</a>.,;:!?\ +-<a rel="mw:ExtLink" href="http://example.com">http://example.com</a>:</p> !! wikitext -http://example.com.,;:!? +http://example.com.,;:!?\ +-http://example.com: +!! html/php +<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>.,;:!?\ +-<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>: +</p> !! end !! test Links 8. Add <nowiki/>s between text-nodes and RFC-links when required (bug 64300) !! html/parsoid -<p><a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>4</p> +<p><a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>4 +<a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>y +X<a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>y</p> !! wikitext RFC 123<nowiki/>4 +RFC 123<nowiki/>y +X<nowiki/>RFC 123<nowiki/>y !! end !! test Links 9. Don't add spurious <nowiki/>s between text-nodes and RFC-links (bug 64300) !! html/parsoid -<p>x<a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>y -X<a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>y -<a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>?foo +<p><a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>?foo <a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>&foo +-<a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>RFC 123</a>- </p> !! wikitext -xRFC 123y -XRFC 123y RFC 123?foo RFC 123&foo +-RFC 123- +!! html/php +<p><a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc123">RFC 123</a>?foo +<a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc123">RFC 123</a>&foo +-<a class="external mw-magiclink-rfc" rel="nofollow" href="//tools.ietf.org/html/rfc123">RFC 123</a>- +</p> !! end !! test Links 10. Add <nowiki/>s between text-nodes and PMID-links when required (bug 64300) !! html/parsoid <p><a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>PMID 123</a>4 +<a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>PMID 123</a>y +X<a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>PMID 123</a>y !! wikitext PMID 123<nowiki/>4 +PMID 123<nowiki/>y +X<nowiki/>PMID 123<nowiki/>y !! end !! test Links 11. Don't add spurious <nowiki/>s between text-nodes and PMID-links (bug 64300) !! html/parsoid -<p>x<a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>PMID 123</a>y -X<a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>PMID 123</a>y -<a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>PMID 123</a>?foo +<p><a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>PMID 123</a>?foo <a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>PMID 123</a>&foo +-<a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>PMID 123</a>- </p> !! wikitext -xPMID 123y -XPMID 123y PMID 123?foo PMID 123&foo +-PMID 123- +!! html/php +<p><a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract">PMID 123</a>?foo +<a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract">PMID 123</a>&foo +-<a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract">PMID 123</a>- +</p> !! end !! test @@ -20224,20 +21915,47 @@ Links 12. Add <nowiki/>s between text-nodes and ISBN-links when required (bug 64 !! html/parsoid <p><a href="./Special:BookSources/1234567890" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 1234567890</a>1 <a href="./Special:BookSources/1234567890" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 1234567890</a>x -<a href="./Special:BookSources/1234567890" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 1234567890</a>b +a<a href="./Special:BookSources/1234567890" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 1234567890</a>b </p> !! wikitext ISBN 1234567890<nowiki/>1 ISBN 1234567890<nowiki/>x -ISBN 1234567890<nowiki/>b +a<nowiki/>ISBN 1234567890<nowiki/>b !! end !! test -Links 12. Don't add spurious <nowiki/>s between text-nodes and ISBN-links (bug 64300) +Links 13. Don't add spurious <nowiki/>s between text-nodes and ISBN-links (bug 64300) !! html/parsoid -<p><a href="./Special:BookSources/1234567890" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 1234567890</a>'s +<p>-<a href="./Special:BookSources/1234567890" rel="mw:ExtLink" data-parsoid='{"stx":"magiclink"}'>ISBN 1234567890</a>'s +!! wikitext +-ISBN 1234567890's +!! html/php +<p>-<a href="/wiki/Special:BookSources/1234567890" class="internal mw-magiclink-isbn">ISBN 1234567890</a>'s +</p> +!! end + +!! test +Links 14. Protect link-like plain text. (Parsoid bug T78425) +!! options +parsoid=html2wt +!! html/* +<p>this is not a link: http://example.com +</p> +!! wikitext +this is not a link: <nowiki>http://example.com</nowiki> +!! end + +!! test +Links 15. Link trails can't become link prefixes. +!! options +language=is !! wikitext -ISBN 1234567890's +[[Söfnuður]]-[[00]] +!! html/php +<p><a href="/wiki/S%C3%B6fnu%C3%B0ur" title="Söfnuður">Söfnuður-</a><a href="/wiki/00" title="00">00</a> +</p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="Söfnuður" title="Söfnuður" data-parsoid='{"stx":"simple","tail":"-"}'>Söfnuður-</a><a rel="mw:WikiLink" href="00" title="00">00</a></p> !! end #### --------------- Quotes --------------- @@ -20247,28 +21965,31 @@ ISBN 1234567890's #### 4. No escaping needed #### -------------------------------------- !! test -1. Quotes inside <b> and <i> +1a. Quotes inside <b> and <i> !! options parsoid=html2wt,wt2wt !! wikitext -''<nowiki>'foo'</nowiki>'' +''<nowiki/>'foo''' ''<nowiki>''foo''</nowiki>'' ''<nowiki>'''foo'''</nowiki>'' ''foo''<nowiki/>'s -'''<nowiki>'foo'</nowiki>''' +'''<nowiki/>'foo'''' '''<nowiki>''foo''</nowiki>''' '''<nowiki>'''foo'''</nowiki>''' -'''<nowiki>foo'</nowiki>''<nowiki>bar'</nowiki>''baz''' +'''foo'<nowiki/>''bar'<nowiki/>''baz''' '''foo'''<nowiki/>'s '''foo'' ''foo''<nowiki/>' -'<nowiki/>''foo''<nowiki/>' +''foo'''<nowiki/>' +'''foo''<nowiki/>' ''''foo''' '''foo'''<nowiki/>' -'<nowiki/>'''foo'''<nowiki/>' +''''foo'''<nowiki/>' ''fools'<span> errand</span>'' ''<span>fool</span>'s errand'' -!! html +'<nowiki/>''foo'' bar '''baz'' +a|!*#-:;+-~[]{}b'''x'' +!! html/* <p><i>'foo'</i> <i>''foo''</i> <i>'''foo'''</i> @@ -20280,12 +22001,42 @@ parsoid=html2wt,wt2wt <b>foo</b>'s '<i>foo</i> <i>foo</i>' +<i>foo'</i>' '<i>foo</i>' '<b>foo</b> <b>foo</b>' -'<b>foo</b>'</p> +'<b>foo</b>' <i>fools'<span> errand</span></i> <i><span>fool</span>'s errand</i> +'<i>foo</i> bar '<i>baz</i> +a|!*#-:;+-~[]{}b'<i>x</i> +</p> +!! end + +!! test +1b. Quotes inside <b> and <i> with other tags on same line +!! options +parsoid=html2wt,wt2wt +!! wikitext +'''a'' foo ''[[bar]]'' +''a''' foo ''[[bar]]'' +''a''' foo '''{{echo|[[bar]]}}''' +[[foo]] x'''[[bar]]'' +'''foo'' <ref>test</ref> +'''foo'' <div title="name">test</div> +'''foo'' and <br> bar +<references /> +!! html +'<i>a</i> foo <i><a rel="mw:WikiLink" href="Bar" title="Bar">bar</a></i> +<i>a'</i> foo <i><a rel="mw:WikiLink" href="Bar" title="Bar">bar</a></i> +<i>a'</i> foo <b><a rel="mw:WikiLink" href="Bar" title="Bar" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[bar]]"}},"i":0}}]}'>bar</a></b> +<a rel="mw:WikiLink" href="Foo" title="Foo">foo</a> x'<i><a href="Bar" rel="mw:WikiLink" title="Bar">bar</a></i> +'<i>foo</i> <span class="reference" id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span> +'<i>foo</i> <div title="name">test</div> +'<i>foo</i> and <br data-parsoid='{"stx":"html","noClose":true}'/> bar +<ol class="references" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text" data-parsoid="{}">test</span></li> +</ol> !! end !! test @@ -20300,10 +22051,10 @@ parsoid=html2wt,wt2wt </p> !! end +# FIXME: Escaping one or both of [[ and ]] is also acceptable -- +# this is one of the shortcomings of this format !! test 3. Link fragments inside <i> and <b> -(FIXME: Escaping one or both of [[ and ]] is also acceptable -- - this is one of the shortcomings of this format) !! wikitext ''[[foo''<nowiki>]]</nowiki> @@ -20319,9 +22070,11 @@ parsoid=html2wt,wt2wt !! wikitext '<span>''bar''</span>' '<span>'''bar'''</span>' +'a:b'foo !! html <p>'<span><i>bar</i></span>' '<span><b>bar</b></span>' +'a:b'foo </p> !! end @@ -20397,8 +22150,13 @@ parsoid !! wikitext foo <ref>''a'' b</ref> +<references /> !! html -<p>foo <span about="#mwt2" class="reference" data-mw='{"name":"ref","body":{"html":"<i data-parsoid='{\"dsr\":[9,14,2,2]}'>a</i>\n b"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span></p> +<p>foo <span about="#mwt2" class="reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="#cite_note-1">[1]</a></span></p> +<ol class="references" typeof="mw:Extension/references" about="#mwt4" data-mw='{"name":"references","attrs":{}}'> +<li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1">↑</a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text"><i data-parsoid='{"dsr":[9,14,2,2]}'>a</i> + b</span></li> +</ol> !! end !! test @@ -20426,9 +22184,8 @@ parsoid parsoid !! wikitext [[File:Foobar.jpg|thumb|caption]] -!! html !! 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/3/3a/Foobar.jpg" 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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>caption</figcaption></figure> !! end !! test @@ -20446,22 +22203,22 @@ parsoid=html2wt 1. Valid behavior switches should be escaped !! options parsoid=html2wt -!! wikitext -<nowiki>__TOC__</nowiki> -''<nowiki>__TOC__</nowiki>'' !! html __TOC__ <i>__TOC__</i> +!! wikitext +<nowiki>__TOC__</nowiki> +''<nowiki>__TOC__</nowiki>'' !! end !! test 2. Invalid behavior switches should not be escaped !! options parsoid=html2wt -!! wikitext +!! html __TOO__ __|__ -!! html +!! wikitext __TOO__ __|__ !! end @@ -20485,12 +22242,14 @@ parsoid !! test 2. other tags !! wikitext -<nowiki><div>foo</div> -<div style="color:red">foo</div></nowiki> +* <nowiki><div>foo</div></nowiki> +* <nowiki><div style="color:red">foo</div></nowiki> +* <nowiki><td></nowiki> !! html -<p><div>foo</div> -<div style="color:red">foo</div> -</p> +<ul><li> <div>foo</div></li> +<li> <div style="color:red">foo</div></li> +<li> <td></li></ul> + !! end !! test @@ -20570,18 +22329,6 @@ a>b </p> !! end - -# This was a bug in the PHP parser (see bug 17663 and its dups, -# https://bugzilla.wikimedia.org/show_bug.cgi?id=17663) -!! test -Tag names followed by punctuation should not be recognized as tags -!! wikitext -<s.ome> text -!! html -<p><s.ome> text -</p> -!! end - !! test HTML tag with necessary entities in attributes !! wikitext @@ -20650,7 +22397,7 @@ Table with broken attribute value quoting on consecutive lines | title="Hello world|Foo | style="color:red|Bar |} -!! html +!! html/php <table> <tr> <td>Foo @@ -20658,18 +22405,7 @@ Table with broken attribute value quoting on consecutive lines <td>Bar </td></tr></table> -!! end - -!! test -Parsoid-only: Table with broken attribute value quoting on consecutive lines -!! options -parsoid -!! wikitext -{| -| title="Hello world|Foo -| style="color:red|Bar -|} -!! html +!! html/parsoid <table><tbody> <tr> <td title="Hello world">Foo @@ -20783,9 +22519,9 @@ RT-ed inter-element separators should be valid separators !!end +# Parsoid-only since PHP parser relies on Tidy for correct output !!test Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out -(Parsoid-only since PHP parser relies on Tidy for correct output) !!options parsoid !! wikitext @@ -20798,6 +22534,14 @@ bar |<small>foo<small> |} !! html +<table> +<tbody><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td data-parsoid='{"autoInsertedEnd":true}'><small data-parsoid='{"stx":"html","autoInsertedEnd":true}'>foo +<p>bar</p></small></td></tr> +</tbody></table> + +<table> +<tbody><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td data-parsoid='{"autoInsertedEnd":true}'><small data-parsoid='{"stx":"html","autoInsertedEnd":true}'>foo<small data-parsoid='{"stx":"html","autoInsertedEnd":true}'></small></small></td></tr> +</tbody></table> !!end !!test @@ -20838,6 +22582,29 @@ Indented table with an empty td !!end +## We have some newline diffs RT-ing this edge case +## and it is not important enough -- we seem to be emitting +## at most 2 newlines after a </tr> and this is unrelated to +## the issue from T85627 that this is testing. +!!test +Indented table with blank lines in between (T85627) +!! options +parsoid=wt2html +!! wikitext + {| + |foo + + + |} +!! html +<table> + +<tr> +<td>foo +</td></tr></table> + +!!end + !!test Indented block & table !! wikitext @@ -20874,15 +22641,15 @@ Indent and comment before table row </td></tr></table> !! html/parsoid -<table data-parsoid='{}'> - <!--hi--><tbody data-parsoid='{}'><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'> +<table> + <!--hi--><tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'> <td data-parsoid='{"autoInsertedEnd":true}'> there</td></tr> </tbody></table> !! end +# Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext !!test Empty TR followed by a template-generated TR -(Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext) !!options parsoid !! wikitext @@ -20925,32 +22692,29 @@ parsoid !!test Multi-line image caption generated by templates with/without trailing newlines -!!options -parsoid !! wikitext -[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]] -[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]] -!! html -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&wpDestFile=Foo.jpg" class="new" title="File:Foo.jpg">File:Foo.jpg</a> <div class="thumbcaption">foo\nA\nB\nC</div></div></div> -<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&wpDestFile=Foo.jpg" class="new" title="File:Foo.jpg">File:Foo.jpg</a> <div class="thumbcaption">foo\nA\nB\nC\n\n</div></div></div> - +[[File:Foobar.jpg|thumb|300x300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]] +[[File:Foobar.jpg|thumb|300x300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]] +!! 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/300px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300"/></a><figcaption>foo\n<span about="#mwt9" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"A"}},"i":0}}]}'>A</span>\n<span about="#mwt10" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"B"}},"i":0}}]}'>B</span>\n<span about="#mwt11" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"C"}},"i":0}}]}'>C</span></figcaption></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/300px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="34" width="300"/></a><figcaption>foo\n<span about="#mwt12" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"A"}},"i":0}}]}'>A</span>\n<span about="#mwt13" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"B"}},"i":0}}]}'>B</span>\n<span about="#mwt14" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"C"}},"i":0}}]}'>C</span>\n\n</figcaption></figure> !!end !! test New element inserted (without intervening newlines) after an old sol-transparent node should serialize correctly !! options parsoid=html2wt +!! html +<meta typeof="mw:Includes/IncludeOnly" data-parsoid='{"src":"<includeonly>foo</includeonly>"}'/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid='{"src":""}'/><p>new para</p> + +<link rel="mw:PageProp/Category" href="./Category:Foo" data-parsoid='{}'/><h1>new heading</h1> !! wikitext <includeonly>foo</includeonly> new para -[[./Category:Foo]] +[[Category:Foo]] = new heading = -!! html -<meta typeof="mw:Includes/IncludeOnly" data-parsoid='{"src":"<includeonly>foo</includeonly>"}'/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid='{"src":""}'/><p>new para</p> - -<link rel="mw:PageProp/Category" href="./Category:Foo" data-parsoid=''/><h1>new heading</h1> !! end ## PHP emits broken html for this, and since this is primarily @@ -20993,20 +22757,20 @@ plain text !!end !!test -1. Ensure fostered text content is wrapped in spans +1. Ensure fostered text content is wrapped in element nodes !!options parsoid=wt2html !! wikitext <table>hi</table><table>ho</table> !! html -<span>hi</span> +<p>hi</p> <table></table> -<span>ho</span> +<p>ho</p> <table></table> !!end !!test -2. Ensure fostered text content is wrapped in spans (traps regressions around fostered marker on the span getting lost) +2. Ensure fostered text content is wrapped in element nodes (traps regressions around fostered marker on the element getting lost) !!options parsoid=wt2html,wt2wt !! wikitext @@ -21015,11 +22779,9 @@ parsoid=wt2html,wt2wt <td> a </table> !! html -<span> || ||</span> -<table> -<tbody> -<tr> -<td> a</td></tr> +<p> || || +</p><table> +<tbody><tr><td> a</td></tr> </tbody></table> !!end @@ -21030,14 +22792,7 @@ parsoid=wt2html,wt2wt !! wikitext {{echo|<table>foo<tr><td>bar</td></tr></table>}} !! html -<span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" -<table>foo -<tr> -<td>bar</td></tr></table>"}},"i":0}}]}">foo</span> -<table> -<tbody> -<tr> -<td>bar</td></tr></tbody></table> +<span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<table>foo<tr><td>bar</td></tr></table>"}},"i":0}}]}">foo</span><table><tbody><tr><td>bar</td></tr></tbody></table> !!end !!test @@ -21047,14 +22802,13 @@ parsoid=wt2wt,wt2html !! wikitext <table>{{echo|foo<tr><td>bar</td></tr>}}</table> !! html -<span typeof="mw:Transclusion" data-mw="{"parts":[" -<table>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo -<tr> -<td>bar</td></tr>"}},"i":0}},"</table>"]}">foo</span> -<table> +<p typeof="mw:Transclusion" data-mw="{"parts":["<table>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo<tr><td>bar</td></tr>"}},"i":0}},"</table>"]}">foo</p><table> <tbody> <tr> -<td>bar</td></tr></tbody></table> +<td>bar</td> +</tr> +</tbody> +</table> !!end !!test @@ -21064,15 +22818,14 @@ parsoid=wt2wt,wt2html !! wikitext <table><div>{{echo|foo}}</div><tr><td>bar</td></tr></table> !! html -<div typeof="mw:Transclusion" data-mw="{"parts":[" -<table> -<div>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}},"</div> -<tr> -<td>bar</td></tr></table>"]}">foo</div> +<div typeof="mw:Transclusion" data-mw="{"parts":["<table><div>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}},"</div><tr><td>bar</td></tr></table>"]}">foo</div> <table> <tbody> <tr> -<td>bar</td></tr></tbody></table> +<td>bar</td> +</tr> +</tbody> +</table> !!end !!test @@ -21082,17 +22835,16 @@ parsoid=wt2wt,wt2html !! wikitext <table><div><p>{{echo|foo</p></div><tr><td>}}bar</td></tr></table> !! html -<div typeof="mw:Transclusion" data-mw="{"parts":[" -<table> -<div> -<p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div> -<tr> -<td>"}},"i":0}},"bar</td></tr></table>"]}"> -<p>foo</p></div> +<div typeof="mw:Transclusion" data-mw="{"parts":["<table><div><p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div><tr><td>"}},"i":0}},"bar</td></tr></table>"]}"> +<p>foo</p> +</div> <table> <tbody> <tr> -<td>bar</td></tr></tbody></table> +<td>bar</td> +</tr> +</tbody> +</table> !!end !!test @@ -21102,17 +22854,16 @@ parsoid=wt2wt,wt2html !! wikitext <table><div><p>{{echo|foo</p></div><tr><td>}}bar</td></tr></table> !! html -<div typeof="mw:Transclusion" data-mw="{"parts":[" -<table> -<div> -<p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div> -<tr> -<td>"}},"i":0}},"bar</td></tr></table>"]}"> -<p>foo</p></div> +<div typeof="mw:Transclusion" data-mw="{"parts":["<table><div><p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div><tr><td>"}},"i":0}},"bar</td></tr></table>"]}"> +<p>foo</p> +</div> <table> <tbody> <tr> -<td>bar</td></tr></tbody></table> +<td>bar</td> +</tr> +</tbody> +</table> !!end !!test @@ -21122,18 +22873,18 @@ parsoid=wt2wt,wt2html !! wikitext <table><tr><td><div><p>{{echo|foo</p></div></td>foo}}</tr></table> !! html -<span typeof="mw:Transclusion" data-mw="{"parts":[" -<table> -<tr> -<td> -<div> -<p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div></td>foo"}},"i":0}},"</tr></table>"]}">foo</span> +<p typeof="mw:Transclusion" data-mw="{"parts":["<table><tr><td><div><p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div></td>foo"}},"i":0}},"</tr></table>"]}">foo</p> <table> <tbody> <tr> <td> <div> -<p>foo</p></div></td></tr></tbody></table> +<p>foo</p> +</div> +</td> +</tr> +</tbody> +</table> !!end !!test @@ -21143,18 +22894,18 @@ parsoid=wt2wt,wt2html !! wikitext <table><tr><td><div><p>{{echo|foo</p></div></td>foo</tr></table>}}<p>ok</p> !! html -<span typeof="mw:Transclusion" data-mw="{"parts":[" -<table> -<tr> -<td> -<div> -<p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div></td>foo</tr></table>"}},"i":0}}]}">foo</span> +<p typeof="mw:Transclusion" data-mw="{"parts":["<table><tr><td><div><p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div></td>foo</tr></table>"}},"i":0}}]}">foo</p> <table> <tbody> <tr> <td> <div> -<p>foo</p></div></td></tr></tbody></table> +<p>foo</p> +</div> +</td> +</tr> +</tbody> +</table> <p>ok</p> !!end @@ -21165,14 +22916,14 @@ parsoid=wt2wt,wt2html !! wikitext <table>{{echo|<p>foo</p>}}<td>bar</td></table> !! html -<p typeof="mw:Transclusion" data-mw="{"parts":[" -<table>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" -<p>foo</p>"}},"i":0}}," -<td>bar</td></table>"]}">foo</p> +<p typeof="mw:Transclusion" data-mw="{"parts":["<table>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<p>foo</p>"}},"i":0}},"<td>bar</td></table>"]}">foo</p> <table> <tbody> <tr> -<td>bar</td></tr></tbody></table> +<td>bar</td> +</tr> +</tbody> +</table> !!end !!test @@ -21186,11 +22937,13 @@ parsoid=wt2wt,wt2html |b |} !! html -<p typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a\n"}},"i":0}}]}">a</p><span typeof="mw:Transclusion" data-mw="{"parts":["{|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"style":{"wt":"'color:red'"}},"i":0}},"\n|-\n|b\n|}"]}">{{{1}}}</span> -<table> +<p typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a\n"}},"i":0}}]}">a</p><p typeof="mw:Transclusion" data-mw="{"parts":["{|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"style":{"wt":"'color:red'"}},"i":0}},"\n|-\n|b\n|}"]}">{{{1}}}</p><table> <tbody> <tr> -<td>b</td></tr></tbody></table> +<td>b</td> +</tr> +</tbody> +</table> !!end !!test @@ -21200,8 +22953,7 @@ parsoid=wt2wt,wt2html !! wikitext <table>{{echo|hi</table>hello}} !! html -<span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":["<table>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"hi</table>hello"}},"i":0}}]}' data-parsoid='{"fostered":true,"autoInsertedEnd":true,"autoInsertedStart":true,"pi":[[{"k":"1","spc":["","","",""]}]]}'>hi</span> -<table about="#mwt2" data-parsoid='{"stx":"html"}'></table><span about="#mwt2" data-parsoid="{}">hello</span> +<p about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":["<table>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"hi</table>hello"}},"i":0}}]}' data-parsoid='{"fostered":true,"autoInsertedEnd":true,"autoInsertedStart":true,"pi":[[{"k":"1","spc":["","","",""]}]]}'>hi</p><table about="#mwt2" data-parsoid='{"stx":"html"}'></table><p about="#mwt2">hello</p> !!end !!test @@ -21216,7 +22968,7 @@ parsoid=wt2html,wt2wt </div> |} !! html -<div about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"OpenTable","href":"./Template:OpenTable"},"params":{},"i":0}},"\n<div>"]}' data-parsoid='{"stx":"html","autoInsertedEnd":true,"pi":[[]]}'></div><span about="#mwt1" data-parsoid="{}"> +<div about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"OpenTable","href":"./Template:OpenTable"},"params":{},"i":0}},"\n<div>"]}' data-parsoid='{"stx":"html","autoInsertedEnd":true,"pi":[[]]}'></div><span about="#mwt1"> </span> <table about="#mwt1" data-parsoid='{"autoInsertedEnd":true}'></table> @@ -21234,7 +22986,7 @@ Properly encapsulate empty-content transclusions in fosterable positions }} </table> !! html/parsoid -<table about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["<table>\n",{"template":{"target":{"wt":"#if:","function":"#if"},"params":{"1":{"wt":"\n<td>foo</td>\n"}},"i":0}},"\n</table>"]}' data-parsoid='{"stx":"html","pi":[[{"k":"1","spc":["","","",""]}]],"src":"<table>\n{{#if:|\n<td>foo</td>\n}}\n</table>"}'> +<table about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["<table>\n",{"template":{"target":{"wt":"#if:","function":"#if"},"params":{"1":{"wt":"\n<td>foo</td>\n"}},"i":0}},"\n</table>"]}' data-parsoid='{"stx":"html","pi":[[{"k":"1","spc":["","","",""]}]]}'> </table> !! end @@ -21243,12 +22995,23 @@ Properly encapsulate empty-content transclusions in fosterable positions Support <object> element with .data attribute !!options parsoid=html2wt -!! wikitext -<object data="test.swf"></object> !! html <object data="test.swf"></object> +!! wikitext +<object data="test.swf"></object> !!end +!! test +Don't block XML namespace declaration +!! wikitext +<span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">MediaWiki</span> +!! html/php +<p><span>MediaWiki</span> +</p> +!! html/parsoid +<p><span xmlns:dct="http://purl.org/dc/terms/" data-x-property="dct:title" data-parsoid='{"stx":"html"}'>MediaWiki</span></p> +!! end + # ----------------------------------------------------------------- # The following section of tests are primarily to spec requirements # around serialization of new/edited content. @@ -21256,15 +23019,101 @@ parsoid=html2wt # All these tests are marked Parsoid html2wt and html2html only # ---------------------------------------------------------------- +# 'mi' is a localinterwiki prefix as well as a language !! test Serialize interwiki links pointing to the current wiki as plain wiki links (bug 65869) !! options parsoid=html2wt -language=es +!! html +<p><a rel="mw:ExtLink" href="http://mi.wikipedia.org/wiki/Foo">Foo</a></p> !! wikitext [[Foo]] +!! end + +# See T93839 +!! test +New wikilinks should be serialized properly +!! options +parsoid=html2wt !! html -<p><a rel="mw:ExtLink" href="http://es.wikipedia.org/wiki/Foo">Foo</a></p> +<a rel="mw:WikiLink" href="./Foo" title="Foo" data-parsoid='{}'>Foo</a> +<a rel="mw:WikiLink" href="./Foo" title="Foo">Foo</a> +!! wikitext +[[Foo]] +[[Foo]] +!! end + +!! test +New wiki links (href variations) +!! options +parsoid=html2wt +!! html +<a rel="mw:WikiLink" href="./Foo_bar">Foo_bar</a> +<a rel="mw:WikiLink" href="Foo_bar">Foo_bar</a> +<a rel="mw:WikiLink" href="Foo bar">Foo_bar</a> +<a rel="mw:WikiLink" href="./Toxine_bact%C3%A9rienne">Toxine bactérienne</a> +!! wikitext +[[Foo_bar]] +[[Foo_bar]] +[[Foo_bar]] +[[Toxine bactérienne]] +!! end + +!! test +New wiki links (content string variations) +!! options +parsoid=html2wt +!! html +<a rel="mw:WikiLink" href="./Foo_bar">Foo_bar</a> +<a rel="mw:WikiLink" href="./Foo_bar">Foo bar</a> +<a rel="mw:WikiLink" href="./Foo_bar">./Foo_bar</a> +!! wikitext +[[Foo_bar]] +[[Foo bar]] +[[Foo_bar|./Foo_bar]] +!! end + +!! test +New category links (href variations) +!! options +parsoid=html2wt +!! html +<link rel="mw:PageProp/Category" href="./Category:Toxine_bactérienne" /> +<link rel="mw:PageProp/Category" href="./Category:Toxine_bact%C3%A9rienne" /> +<link rel="mw:PageProp/Category" href="Category:Toxine_bact%C3%A9rienne" /> +!! wikitext +[[Category:Toxine bactérienne]] +[[Category:Toxine bactérienne]] +[[Category:Toxine bactérienne]] +!! end + +!! test +New sol transparent links don't need indent-pre nowiki protection +!! options +parsoid=html2wt +language=de +!! html + <link rel="mw:PageProp/redirect" href="./Main_Page"> +<!-- this is good --> <link rel="mw:PageProp/Category" href="./Category:Good" /> +<!-- this is great --> <link rel="mw:PageProp/Category" href="./Kategorie:Great" /> +!! wikitext + #WEITERLEITUNG [[Main Page]] +<!-- this is good --> [[Category:Good]] +<!-- this is great --> [[Kategorie:Great]] +!! end + +!! test +New interlanguage links (href variations) +!! options +parsoid=html2wt +!! html +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Toxine bactérienne" /> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Toxine_bactérienne" /> +<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Toxine_bact%C3%A9rienne" /> +!! wikitext +[[es:Toxine bactérienne]] +[[es:Toxine_bactérienne]] +[[es:Toxine_bactérienne]] !! end !! test @@ -21401,7 +23250,7 @@ parsoid !! wikitext [[File:Foobar.jpg|thumb|alt=|bar]] !! html -<figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"alt","ak":"alt="},{"ck":"caption","ak":"bar"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img alt="" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" height="25" width="220" data-parsoid='{"a":{"alt":"","resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"alt":"alt=","resource":"File:Foobar.jpg"}}'/></a><figcaption>bar</figcaption></figure> +<figure class="mw-default-size" typeof="mw:Image/Thumb" data-parsoid='{"optList":[{"ck":"thumbnail","ak":"thumb"},{"ck":"alt","ak":"alt="},{"ck":"caption","ak":"bar"}]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"}}'><img alt="" 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":"","resource":"./File:Foobar.jpg","height":"25","width":"220"},"sa":{"alt":"alt=","resource":"File:Foobar.jpg"}}'/></a><figcaption>bar</figcaption></figure> !! end #!! test @@ -21409,37 +23258,34 @@ parsoid #!! options #parsoid=html2wt #language=ar -#!! input +#!! html +#<figure class="mw-default-size mw-halign-right" typeof="mw:Image/Thumb"><a href="Imagen:Foobar.jpg"><img resource="./Imagen:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="20" width="180"/></a></figure> +#!! wikitext #[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]] -#!! result -#<figure class="mw-default-size mw-halign-right" typeof="mw:Image/Thumb"><a href="Imagen:Foobar.jpg"><img resource="./Imagen:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="20" width="180"/></a></figure> #!! end !! test Image: Block level image should have \n before and after -!! options -parsoid !! wikitext 123 [[File:Foobar.jpg|right|thumb|150x150px]] 456 -!! html -<p>123</p><figure typeof="mw:Image/Thumb" class="mw-halign-right"><a href="./File:Foobar.png"><img src="http://192.168.142.128/mw/images/thumb/b/bc/Foobar.png/131px-Foobar.png" width="131" height="150" resource="./File:Foobar.png" data-parsoid='{"a":{"resource":"./File:Foobar.png","width":"131"},"sa":{"resource":"File:Foobar.png","width":"150"}}'></a></figure><p>456</p> +!! 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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="17" width="150"/></a></figure> +<p>456</p> !!end !! test -Image: New block level image should have \n before and after (existing -content) -!! options -parsoid +Image: New block level image should have \n before and after (existing content) !! wikitext 123 [[File:Foobar.jpg|right|thumb|150x150px]] 456 -!! html -<p data-parsoid='{"dsr":[0,3,0,0]}'>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"}],"dsr":[4,45,2,2]}'><a href="./File:Foobar.jpg" data-parsoid='{"a":{"href":"./File:Foobar.jpg"},"dsr":[6,43,null,null]}'><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/150px-Foobar.jpg" height="17" width="150" data-parsoid='{"a":{"resource":"./File:Foobar.jpg","height":"17","width":"150"},"sa":{"resource":"File:Foobar.jpg"}}'/></a></figure> -<p data-parsoid='{"dsr":[46,49,0,0]}'>456</p> +!! 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> +<p>456</p> !!end !! test @@ -21451,7 +23297,9 @@ parsoid [[File:Foobar.jpg|thumb|upright=0.5|caption]] [[File:Foobar.jpg|thumb|500x500px|upright=0.5|caption]] !! html -<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="19" width="170"/></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/3/3a/Foobar.jpg" height="12" width="110"/></a><figcaption>caption</figcaption></figure><figure typeof="mw:Image/Thumb"><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="57" width="500"/></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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="19" width="170"/></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/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="12" width="110"/></a><figcaption>caption</figcaption></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="57" width="500"/></a><figcaption>caption</figcaption></figure> !!end !! test @@ -21461,7 +23309,7 @@ parsoid !! wikitext [[File:Foobar.jpg|500x500px|upright=0.5|caption]] !! html -<p><span typeof="mw:Image" data-mw='{"caption":"caption"}'><a href="File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" height="57" width="500"/></a></span></p> +<p><span typeof="mw:Image" data-mw='{"caption":"caption"}'><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="57" width="500"/></a></span></p> !!end !! test @@ -21470,7 +23318,7 @@ Image: from basic HTML (1) parsoid=html2wt !! html/parsoid <span typeof="mw:Image"> - <img src="File:Foobar.jpg" width=100 height=100 alt="Alt"> + <img src="./File:Foobar.jpg" width=100 height=100 alt="Alt"> </span> !! wikitext [[File:Foobar.jpg|link=|alt=Alt|100x100px]] @@ -21481,7 +23329,7 @@ Image: from basic HTML (2) !! options parsoid=html2wt !! html/parsoid -<img src="File:Foobar.jpg" width=100 height=100 alt="Alt"> +<img src="./File:Foobar.jpg" width=100 height=100 alt="Alt"> !! wikitext [[File:Foobar.jpg|link=|alt=Alt|100x100px]] !! end @@ -21491,7 +23339,7 @@ Image: from basic HTML (3) !! options parsoid=html2wt !! html/parsoid -<a href="Main"><img src="File:Foobar.jpg" width=100 height=100 alt="Alt"></a> +<a href="Main"><img src="./File:Foobar.jpg" width=100 height=100 alt="Alt"></a> !! wikitext [[File:Foobar.jpg|link=Main|alt=Alt|100x100px]] !! end @@ -21501,7 +23349,7 @@ Image: from basic HTML (4) !! options parsoid=html2wt !! html/parsoid -<img src="File:Foobar.jpg"> +<img src="./File:Foobar.jpg"> !! wikitext [[File:Foobar.jpg|link=]] !! end @@ -21510,28 +23358,41 @@ parsoid=html2wt Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does) !! options parsoid=html2wt -!! wikitext -* foo !! html <ul> <li><p>foo</p></li> </ul> +!! wikitext +* foo !! end !! test Lists: Serialize correctly even when list tags has unneeded whitespace between tags !! options parsoid=html2wt -!! wikitext -* foo !! html <ul> <li>foo</li></ul> +!! wikitext +* foo !! end !! test Don't strip leading whitespace when handling indent-pre suppressing tags !! options parsoid=html2wt +!! html +<table> + <tr><td> indented row</td></tr> +</table> +<blockquote><p> + <b>This is very bold of you!</b> +</p> +<table><tr><td> + indented cell (no pre-wrapping!) +</td></tr></table> +</blockquote> +<p>foo</p> + <div>bar</div> !! wikitext {| | indented row @@ -21546,19 +23407,6 @@ parsoid=html2wt </blockquote> foo <div>bar</div> -!! html -<table> - <tr><td> indented row</td></tr> -</table> -<blockquote><p> - <b>This is very bold of you!</b> -</p> -<table><tr><td> - indented cell (no pre-wrapping!) -</td></tr></table> -</blockquote> -<p>foo</p> - <div>bar</div> !! end !! test @@ -21597,33 +23445,38 @@ foo Lists: Add space after bullets !! options parsoid=html2wt -!! wikitext -* foo -* bar -* <span> baz</span> !! html <ul> <li>foo</li> <li> bar</li> <li><span> baz</span></li> </ul> +!! wikitext +* foo +* bar +* <span> baz</span> !! end !! test Lists: Dont insert newlines in a serialized list item. !! options parsoid=html2wt +!! html +<ul><li>a<br>b</li><li>c</li></ul> !! wikitext * a<br>b * c -!! html -<ul><li>a<br>b</li><li>c</li></ul> !! end !! test Headings: Add space before/after == (Bug 51744) !! options parsoid=html2wt +!! html +<h2>foo</h2> +<h2> bar</h2> +<h2>baz </h2> +<h2><span> baz</span></h2> !! wikitext == foo == @@ -21632,25 +23485,32 @@ parsoid=html2wt == baz == == <span> baz</span> == -!! html -<h2>foo</h2> -<h2> bar</h2> -<h2>baz </h2> -<h2><span> baz</span></h2> !! end !! test -Parsoid: Serialize positional parameters with = in them as named parameter +Headings: Force metas to serialize before/after !! options parsoid=html2wt +!! html +<h2>hello there<link href="Category:A1" rel="mw:PageProp/Category" /></h2> +<h2><link href="Category:A2" rel="mw:PageProp/Category" />hi pal</h2> + +<h2><!--foo--> <link href="Category:A3" rel="mw:PageProp/Category" /> how goes it</h2> !! wikitext -{{echo|1 = f=oo}} +== hello there == +[[Category:A1]] -{{echo|1 = f=oo|2 = bar}} +[[Category:A2]] +== hi pal == -<!--Orig params with data-parsoid has heuristics for handling = chars--> -<!--FIXME: But maybe the heuristic needs fixing to apply to new params as well--> -{{echo|<nowiki>f=oo</nowiki>|bar}} +<!--foo--> [[Category:A3]] +== how goes it == +!! end + +!! test +Parsoid: Serialize positional parameters with = in them as named parameter +!! options +parsoid=html2wt !! html <p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"f=oo"}},"i":0}}]}'>foo</p> @@ -21661,12 +23521,37 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"}, <!--Orig params with data-parsoid has heuristics for handling = chars--> <!--FIXME: But maybe the heuristic needs fixing to apply to new params as well--> <p data-parsoid='{"pi":[[{"k":"1","spc":["","","",""]},{"k":"2","spc":["","","",""]}]]}' about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"f=oo"},"2":{"wt":"bar"}},"i":0}}]}'>foo</p> +!! wikitext +{{echo|1 = f=oo}} + +{{echo|1 = f=oo|2 = bar}} + +<!--Orig params with data-parsoid has heuristics for handling = chars--> +<!--FIXME: But maybe the heuristic needs fixing to apply to new params as well--> +{{echo|<nowiki>f=oo</nowiki>|bar}} +!! end + +!! test +Parsoid: Serialize positional parameters with = in extlink as named parameter +!! options +parsoid=html2wt +!! html +<p><a rel="mw:ExtLink" href="http://stuff?is=ok" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"http://stuff?is=ok"}},"i":0}}]}'>http://stuff?is=ok</a></p> +!! wikitext +{{echo|1 = http://stuff?is=ok}} !! end !! test Parsoid: Correctly serialize block-node children when they are a combination of text and p-nodes !! options parsoid=html2wt +!! html +<div>a<p>b</p></div> +<div>a +<p>b</p></div> +<div> +a +<p>b</p></div> !! wikitext <div>a b @@ -21679,23 +23564,32 @@ a b </div> -!! html -<div>a<p>b</p></div> -<div>a -<p>b</p></div> -<div> -a -<p>b</p></div> !! end !! test Substrings resembling wikitext in hrefs should not get nowiki escapes !! options parsoid=html2wt +!! html +<a rel="mw:WikiLink" href="./Foo''bar''baz">Foo''bar''baz</a> !! wikitext [[Foo''bar''baz]] +!! end + +!! test +Enforce single-line context in the serializer +!! options +parsoid=html2wt !! html -<a rel="mw:WikiLink" href="./Foo''bar''baz">Foo''bar''baz</a> +<h2>testing +123</h2> + +<ul><li>asd +sdf</li></ul> +!! wikitext +== testing 123 == + +* asd sdf !! end #----------------------------- @@ -21706,6 +23600,15 @@ parsoid=html2wt 1. I/B quote minimization: wikitext-only tags should be combined !! options parsoid=html2wt +!! html +<p><i>A</i><i>B</i></p> +<p><b>A</b><b>B</b></p> +<p><i>A</i><b><i>B</i></b></p> +<p><b>A</b><i><b>B</b></i></p> +<p><b>A</b><i><b>B</b><b>C</b></i><b>D</b></p> +<p><i><b>A</b></i><i><b>B</b></i></p> +<p><i><b>A</b></i><b><i>B</i></b></p> +<p><b><i>A</i></b><i><b>B</b></i></p> !! wikitext ''AB'' @@ -21722,57 +23625,78 @@ parsoid=html2wt '''''AB''''' '''''AB''''' -!! html -<p><i>A</i><i>B</i></p> -<p><b>A</b><b>B</b></p> -<p><i>A</i><b><i>B</i></b></p> -<p><b>A</b><i><b>B</b></i></p> -<p><b>A</b><i><b>B</b><b>C</b></i><b>D</b></p> -<p><i><b>A</b></i><i><b>B</b></i></p> -<p><i><b>A</b></i><b><i>B</i></b></p> -<p><b><i>A</i></b><i><b>B</b></i></p> !! end !! test 2. I/B quote minimization: wikitext and html tags should not be combined !! options parsoid=html2wt -!! wikitext -''A''<i>B</i> - -''A'''''<i>B</i>''' !! html <p><i>A</i><i data-parsoid='{"stx":"html"}'>B</i></p> <p><i>A</i><b><i data-parsoid='{"stx":"html"}'>B</i></b></p> +!! wikitext +''A''<i>B</i> + +''A''<nowiki/>'''<i>B</i>''' !! end !! test 3. I/B quote minimization: templated content stops minimization !! options parsoid=html2wt +!! html +<p><i>A</i><i about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"''B''"}},"i":0}}]}'>B</i> +<p><i>A</i><b about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"'''''B'''''"}},"i":0}}]}'><i>B</i></b> !! wikitext ''A''{{echo|''B''}} ''A''{{echo|'''''B'''''}} -!! html -<p><i>A</i><i about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"''B''"}},"i":0}}]}'>B</i> -<p><i>A</i><b about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"'''''B'''''"}},"i":0}}]}'><i>B</i></b> !! end !! test 4. I/B quote minimization: new content should be mimimized with adjacent old content !! options parsoid=html2wt +!! html +<p><i>A</i><i>B</i></p> +<p><b>A</b><b>B</b></p> +<p><i>A</i><b><i>B</i></b></p> !! wikitext ''AB'' '''AB''' ''A'''B''''' -!! html -<p><i>A</i><i data-parsoid='{}'>B</i></p> -<p><b data-parsoid='{}'>A</b><b>B</b></p> -<p><i>A</i><b data-parsoid='{}'><i data-parsoid='{}'>B</i></b></p> +!! end + +!! test +5a. Merge adjacent quote nodes if they've been edited +!! options +parsoid={ + "modes": ["wt2wt", "selser"], + "changes": [ + ["p", "contents", "remove", ":contains('b')"] + ] +} +!! wikitext +''a''b''c'' +!! wikitext/edited +''ac'' +!! end + +!! test +5b. Merge adjacent quote nodes if they've been edited +!! options +parsoid={ + "modes": ["wt2wt", "selser"], + "changes": [ + ["#x", "remove"] + ] +} +!! wikitext +''a''<span id="x">b</span>''c'' +!! wikitext/edited +''ac'' !! end #------------------------------------ @@ -21796,16 +23720,6 @@ parsoid=html2wt Magic words !! options parsoid=html2wt -!! wikitext -__TOC__ -__NOTOC__ -__FORCETOC__ -__INDEX__ -__NOINDEX__ -__NOGALLERY__ -__NOEDITSECTION__ -__NOTITLECONVERT__ -__NOCONTENTCONVERT__ !! html <meta property='mw:PageProp/toc' /> <meta property='mw:PageProp/notoc' /> @@ -21817,12 +23731,34 @@ __NOCONTENTCONVERT__ <meta property='mw:PageProp/notitleconvert' /> <meta property='mw:PageProp/nocontentconvert' /> <meta property='mw:PageProp/unknownproperty' /> +!! wikitext +__TOC__ +__NOTOC__ +__FORCETOC__ +__INDEX__ +__NOINDEX__ +__NOGALLERY__ +__NOEDITSECTION__ +__NOTITLECONVERT__ +__NOCONTENTCONVERT__ !! end !! test Consecutive <pre>s should not get merged !! options parsoid=html2wt,html2html +!! html +<pre>a</pre><pre>b</pre> + +<pre>c +</pre><pre> +d</pre> + +<pre>e + +</pre><pre> + +f</pre> !! wikitext a @@ -21837,58 +23773,209 @@ parsoid=html2wt,html2html f -!! html -<pre>a</pre><pre>b</pre> - -<pre>c -</pre><pre> -d</pre> - -<pre>e - -</pre><pre> - -f</pre> !! end !! test Edited ISBN links not serializable as ISBN links should serialize as wikilinks !! options parsoid=html2wt -!! wikitext -[[Special:BookSources/1234567890|ISBN 1234567895]] !! html <a rel="mw:ExtLink" href="./Special:BookSources/1234567890">ISBN 1234567895</a> +!! wikitext +[[Special:BookSources/1234567890|ISBN 1234567895]] !! end !! test Edited RFC links not serializable as RFC links should serialize as extlinks !! options parsoid=html2wt -!! wikitext -[//tools.ietf.org/html/rfc123 New RFC] !! html <a href="//tools.ietf.org/html/rfc123" rel="mw:ExtLink">New RFC</a> +!! wikitext +[//tools.ietf.org/html/rfc123 New RFC] !! end !! test Edited PMID links not serializable as PMID links should serialize as extlinks !! options parsoid=html2wt -!! wikitext -[//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID] !! html <a href="//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract" rel="mw:ExtLink">New PMID</a> +!! wikitext +[//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID] +!! end + +!! test +WTS of autolinks with trailing/surrounding context +!! options +parsoid=html2wt +!! html/parsoid +<p><a href="http://cscott.net">http://cscott.net</a><b>foo</b></p> +<p><a href="http://cscott.net">http://cscott.net</a><b data-parsoid='{"stx":"html"}'>foo</b></p> +<p><b><a href="http://cscott.net">http://cscott.net</a></b></p> +<p><b><a href="http://cscott.net">http://cscott.net</a> </b></p> +<p><b><a href="http://cscott.net">http://cscott.net</a>x</b></p> +<p><a href="http://cscott.net">http://cscott.net</a>x</p> +!! wikitext +http://cscott.net<nowiki/>'''foo''' + +http://cscott.net<b>foo</b> + +'''http://cscott.net<nowiki/>''' + +'''http://cscott.net ''' + +'''http://cscott.net<nowiki/>x''' + +http://cscott.net<nowiki/>x +!! end + +!! test +WTS of autolinks with nowikis (round-trip) +!! wikitext +x<nowiki/>http://cscott.net<nowiki/>x +!! html/parsoid +<p>x<a rel="mw:ExtLink" href="http://cscott.net">http://cscott.net</a>x</p> +!! end + +# this is the "easy" test because it leaves in place all the +# data-parsoid information indicating this is an autolink +!! test +WTS of autolinks with escapes (editing) +!! options +parsoid={ + "modes": ["wt2wt"], + "changes": [ + [ "meta", "remove" ] + ] +} +!! wikitext +x<nowiki/>http://cscott.net<nowiki/>x +!! wikitext/edited +x<nowiki/>http://cscott.net<nowiki/>x !! end !! test Edited Redirect link should emit a non-piped wikitext link !! options parsoid=html2wt +!! html +<link rel="mw:PageProp/redirect" href="Bar" data-parsoid='{"a":{"href":"./Foo"},"sa":{"href":"Foo"}}'> !! wikitext #REDIRECT [[Bar]] +!! end + +!! test +T75121: Infer extension name from typeOf if data-mw is not present +!! options +parsoid=html2wt +!! html +<div typeOf="mw:Extension/foo"></div> +!! wikitext +<foo /> +!! end + +# Note that the <p> wrapping isn't present in PHP parser output +# The important thing for this test is that P-wrapping doesn't +# interfere with the <nowiki> protection for leading - in <td> +# (which isn't necessary for <th>). +!! test +T88318: p-wrapped dash in table. +!! options +parsoid=html2wt,wt2wt +!! html/parsoid +<table><tbody> +<tr><th><p>-</p></th><th><p>- </p></th></tr> +<tr><td><p>-</p></td><td><p>- </p></td></tr> +<tr><td><small>-</small></td><td><br/><p>-</p></td><td><br/>-</td></tr> +</tbody></table> +!! wikitext +{| +!- +!- +|- +|<nowiki>-</nowiki> +|<nowiki>- </nowiki> +|- +|<small>-</small> +|<br> +- +|<br> +- +|} +!! html/php+tidy +<table> +<tr> +<th>-</th> +<th>-</th> +</tr> +<tr> +<td>-</td> +<td>-</td> +</tr> +<tr> +<td><small>-</small></td> +<td><br /> +<p>-</p> +</td> +<td><br /> +<p>-</p> +</td> +</tr> +</table> +!! end + +!! test +HTML id attribute with Parsoid-like element ids should not be serialized to wikitext +!! options +parsoid=html2wt +!! html +<table id='mwAb'> +<td id='mwAc'>foo</td> +<td id='serialize-this'>bar</td> +</table> +!! wikitext +{| +|foo +| id="serialize-this" |bar +|} +!! end + +!! test +Parsoid-like element ids should not be serialized to wikitext unless shadowed +!! options +parsoid=html2wt !! html -<link rel="mw:PageProp/redirect" href="Bar" data-parsoid='{"src":"#REDIRECT ","a":{"href":"./Foo"},"sa":{"href":"Foo"}}'> +<div id="mwAQ" data-parsoid='{"stx":"html","a":{"id":"mwAQ"},"sa":{"id":"hello"}}'>ok</div> +!! wikitext +<div id="hello">ok</div> +!! end + +!! test +WTS change modes +!! options +parsoid={ + "modes": ["wt2wt"], + "changes": [ + [ "#xyz", "before", "<b>before</b> stuff " ], + [ "#xyz", "after", " stuff <i>after</i>" ], + [ "#xyz", "html", "x <b>y</b> z" ] + ] +} +!! wikitext +<span id="xyz">hello</span> +!! wikitext/edited +'''before''' stuff <span id="xyz">x '''y''' z</span> stuff ''after'' +!! end + +!! test +Never serialize a-tag as html, regardless of what data-parsoid has to say +!! options +parsoid=html2wt +!! html +<a rel="mw:WikiLink" href="./Foo" title="Foo" data-parsoid='{"stx":"html"}'>Foo</a> +!! wikitext +[[Foo]] !! end # ----------------------------------------------------------------- @@ -21896,6 +23983,53 @@ parsoid=html2wt # of new content # ----------------------------------------------------------------- +# ----------------------------------------------------------------- +# The following section of tests are primarily to spec behavior of +# the selective serializer. All these tests have manual selser +# changes. The automated selser changes for all tests handle the +# wide variation of changes, but these tests here capture specs +# deterministically. +# ---------------------------------------------------------------- + +## T90517 +!! test +1. Selser: New comments should not be lost +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "#a", "after", "<!--c1-->" ], + [ "#b", "before", "<!--c2-->" ] + ] +} +!! wikitext +<span id="a">a</span> + +<span id="b">b</span> +!! wikitext/edited +<span id="a">a</span><!--c1--> + +<!--c2--><span id="b">b</span> +!! end + +## T89383 +!! test +2. Selser: Check for validity of DSR before using it +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "#a", "before", "<meta property='mw:PageProp/displaytitle' content='foo'>" ] + ] +} +!! wikitext +<span id="a">a</span> +!! wikitext/edited +{{DISPLAYTITLE:foo}} +<span id="a">a</span> +!! end + + TODO: more images more tables diff --git a/tests/parser/parserTestsParserHook.php b/tests/parser/parserTestsParserHook.php index c8b3e897..221fc79a 100644 --- a/tests/parser/parserTestsParserHook.php +++ b/tests/parser/parserTestsParserHook.php @@ -29,6 +29,7 @@ class ParserTestParserHook { static function setup( &$parser ) { $parser->setHook( 'tag', array( __CLASS__, 'dumpHook' ) ); + $parser->setHook( 'tåg', array( __CLASS__, 'dumpHook' ) ); $parser->setHook( 'statictag', array( __CLASS__, 'staticTagHook' ) ); return true; } diff --git a/tests/parser/preprocess/All_system_messages.expected b/tests/parser/preprocess/All_system_messages.expected index 078d8f0d..2ee805e0 100644 --- a/tests/parser/preprocess/All_system_messages.expected +++ b/tests/parser/preprocess/All_system_messages.expected @@ -2207,13 +2207,6 @@ Log in </td><td> <template lineStart="1"><title>int:Login</title></template> </td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginend&action=edit loginend]<br> -[[MediaWiki_talk:Loginend|Talk]] -</td><td> -&amp;nbsp; -</td><td> -<template lineStart="1"><title>int:Loginend</title></template> -</td></tr><tr><td> [http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginerror&action=edit loginerror]<br> [[MediaWiki_talk:Loginerror|Talk]] </td><td> diff --git a/tests/parser/preprocess/All_system_messages.txt b/tests/parser/preprocess/All_system_messages.txt index 3c30da94..4a30f56f 100644 --- a/tests/parser/preprocess/All_system_messages.txt +++ b/tests/parser/preprocess/All_system_messages.txt @@ -2207,13 +2207,6 @@ Log in </td><td> {{int:Login}} </td></tr><tr><td> -[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginend&action=edit loginend]<br> -[[MediaWiki_talk:Loginend|Talk]] -</td><td> -&nbsp; -</td><td> -{{int:Loginend}} -</td></tr><tr><td> [http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Loginerror&action=edit loginerror]<br> [[MediaWiki_talk:Loginerror|Talk]] </td><td> diff --git a/tests/parserTests.php b/tests/parserTests.php index 9965c438..5d21319b 100644 --- a/tests/parserTests.php +++ b/tests/parserTests.php @@ -70,10 +70,6 @@ if ( $wgDBtype == 'sqlite' ) { } } -# There is a convention that the parser should never -# refer to $wgTitle directly, but instead use the title -# passed to it. -$wgTitle = Title::newFromText( 'Parser test script do not use' ); $tester = new ParserTest( $options ); if ( isset( $options['file'] ) ) { diff --git a/tests/phpunit/LessFileCompilationTest.php b/tests/phpunit/LessFileCompilationTest.php index 71e0f4b2..df4690a4 100644 --- a/tests/phpunit/LessFileCompilationTest.php +++ b/tests/phpunit/LessFileCompilationTest.php @@ -38,7 +38,7 @@ class LessFileCompilationTest extends ResourceLoaderTestCase { "$thisString must refer to a readable file" ); - $rlContext = static::getResourceLoaderContext(); + $rlContext = $this->getResourceLoaderContext(); // Bleh $method = new ReflectionMethod( $this->module, 'getLessCompiler' ); diff --git a/tests/phpunit/Makefile b/tests/phpunit/Makefile index c3e2a303..a33b86a3 100644 --- a/tests/phpunit/Makefile +++ b/tests/phpunit/Makefile @@ -1,4 +1,4 @@ -.PHONY: help test phpunit install coverage warning destructive parser noparser safe databaseless list-groups +.PHONY: help test phpunit coverage warning destructive parser noparser safe databaseless list-groups .DEFAULT: warning SHELL = /bin/sh @@ -35,9 +35,6 @@ destructive: phpunit phpunit: ${PU} -install: - ./install-phpunit.sh - tap: ${PU} --tap @@ -83,7 +80,7 @@ help: # You will need the Xdebug PHP extension for the later. # [no]parser Skip or only run Parser tests # - # list-groups List availabe Tests groups. + # list-groups List available Tests groups. # # Options: # CONFIG_FILE Path to a PHPUnit configuration file (default: suite.xml) diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 995853ea..72cac051 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -104,7 +104,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { ObjectCache::$instances[CACHE_DB] = new HashBagOStuff; $needsResetDB = false; - $logName = get_class( $this ) . '::' . $this->getName( false ); if ( $this->needsDB() ) { // set up a DB connection for this test to use @@ -117,34 +116,22 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { $this->checkDbIsSupported(); if ( !self::$dbSetup ) { - wfProfileIn( $logName . ' (clone-db)' ); - // switch to a temporary clone of the database self::setupTestDB( $this->db, $this->dbPrefix() ); if ( ( $this->db->getType() == 'oracle' || !self::$useTemporaryTables ) && self::$reuseDB ) { $this->resetDB(); } - - wfProfileOut( $logName . ' (clone-db)' ); } - - wfProfileIn( $logName . ' (prepare-db)' ); $this->addCoreDBData(); $this->addDBData(); - wfProfileOut( $logName . ' (prepare-db)' ); - $needsResetDB = true; } - wfProfileIn( $logName ); parent::run( $result ); - wfProfileOut( $logName ); if ( $needsResetDB ) { - wfProfileIn( $logName . ' (reset-db)' ); $this->resetDB(); - wfProfileOut( $logName . ' (reset-db)' ); } } @@ -198,7 +185,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { } protected function setUp() { - wfProfileIn( __METHOD__ ); parent::setUp(); $this->called['setUp'] = true; @@ -223,12 +209,15 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { $this->db->ignoreErrors( false ); } - wfProfileOut( __METHOD__ ); + DeferredUpdates::clearPendingUpdates(); + } - protected function tearDown() { - wfProfileIn( __METHOD__ ); + protected function addTmpFiles( $files ) { + $this->tmpFiles = array_merge( $this->tmpFiles, (array)$files ); + } + protected function tearDown() { $this->called['tearDown'] = true; // Cleaning up temporary files foreach ( $this->tmpFiles as $fileName ) { @@ -271,7 +260,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { } parent::tearDown(); - wfProfileOut( __METHOD__ ); } /** @@ -429,6 +417,35 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { } /** + * Insert a new page. + * + * Should be called from addDBData(). + * + * @since 1.25 + * @param string $pageName Page name + * @param string $text Page's content + * @return array Title object and page id + */ + protected function insertPage( $pageName, $text = 'Sample page for unit test.' ) { + $title = Title::newFromText( $pageName, 0 ); + + $user = User::newFromName( 'UTSysop' ); + $comment = __METHOD__ . ': Sample page for unit test.'; + + // Avoid memory leak...? + // LinkCache::singleton()->clear(); + // Maybe. But doing this absolutely breaks $title->isRedirect() when called during unit tests.... + + $page = WikiPage::factory( $title ); + $page->doEditContent( ContentHandler::makeContent( $text, $title ), $comment, 0, false, $user ); + + return array( + 'title' => $title, + 'id' => $page->getId(), + ); + } + + /** * Stub. If a test needs to add additional data to the database, it should * implement this method and do so * @@ -453,7 +470,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { 'page_namespace' => 0, 'page_title' => ' ', 'page_restrictions' => null, - 'page_counter' => 0, 'page_is_redirect' => 0, 'page_is_new' => 0, 'page_random' => 0, @@ -464,7 +480,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { User::resetIdByNameCache(); - //Make sysop user + // Make sysop user $user = User::newFromName( 'UTSysop' ); if ( $user->idForName() == 0 ) { @@ -476,7 +492,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { $user->saveSettings(); } - //Make 1 page with 1 revision + // Make 1 page with 1 revision $page = WikiPage::factory( Title::newFromText( 'UTPage' ) ); if ( $page->getId() == 0 ) { $page->doEditContent( @@ -484,7 +500,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { 'UTPageSummary', EDIT_NEW, false, - User::newFromName( 'UTSysop' ) ); + $user + ); } } @@ -603,7 +620,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { if ( isset( $compatibility[$func] ) ) { return call_user_func_array( array( $this, $compatibility[$func] ), $args ); } else { - throw new MWException( "Called non-existant $func method on " + throw new MWException( "Called non-existent $func method on " . get_class( $this ) ); } } @@ -614,7 +631,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @param string $msg */ private function assertEmpty2( $value, $msg ) { - return $this->assertTrue( $value == '', $msg ); + $this->assertTrue( $value == '', $msg ); } private static function unprefixTable( $tableName ) { @@ -630,7 +647,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { /** * @since 1.18 * - * @param DataBaseBase $db + * @param DatabaseBase $db * * @return array */ @@ -753,7 +770,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { /** * Utility method taking an array of elements and wrapping - * each element in it's own array. Useful for data providers + * each element in its own array. Useful for data providers * that only return a single argument. * * @since 1.20 @@ -1120,9 +1137,23 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { } /** + * @param array $matcher + * @param string $actual + * @param bool $isHtml + * + * @return bool + */ + private static function tagMatch( $matcher, $actual, $isHtml = true ) { + $dom = PHPUnit_Util_XML::load( $actual, $isHtml ); + $tags = PHPUnit_Util_XML::findNodes( $dom, $matcher, $isHtml ); + return count( $tags ) > 0 && $tags[0] instanceof DOMNode; + } + + /** * Note: we are overriding this method to remove the deprecated error * @see https://bugzilla.wikimedia.org/show_bug.cgi?id=69505 * @see https://github.com/sebastianbergmann/phpunit/issues/1292 + * @deprecated * * @param array $matcher * @param string $actual @@ -1132,10 +1163,21 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { public static function assertTag( $matcher, $actual, $message = '', $isHtml = true ) { //trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED); - $dom = PHPUnit_Util_XML::load( $actual, $isHtml ); - $tags = PHPUnit_Util_XML::findNodes( $dom, $matcher, $isHtml ); - $matched = count( $tags ) > 0 && $tags[0] instanceof DOMNode; + self::assertTrue( self::tagMatch( $matcher, $actual, $isHtml ), $message ); + } + + /** + * @see MediaWikiTestCase::assertTag + * @deprecated + * + * @param array $matcher + * @param string $actual + * @param string $message + * @param bool $isHtml + */ + public static function assertNotTag( $matcher, $actual, $message = '', $isHtml = true ) { + //trigger_error(__METHOD__ . ' is deprecated', E_USER_DEPRECATED); - self::assertTrue( $matched, $message ); + self::assertFalse( self::tagMatch( $matcher, $actual, $isHtml ), $message ); } } diff --git a/tests/phpunit/ResourceLoaderTestCase.php b/tests/phpunit/ResourceLoaderTestCase.php index f5f302e0..deecb31e 100644 --- a/tests/phpunit/ResourceLoaderTestCase.php +++ b/tests/phpunit/ResourceLoaderTestCase.php @@ -1,7 +1,12 @@ <?php abstract class ResourceLoaderTestCase extends MediaWikiTestCase { - protected static function getResourceLoaderContext( $lang = 'en' ) { + /** + * @param string $lang + * @param string $dir + * @return ResourceLoaderContext + */ + protected function getResourceLoaderContext( $lang = 'en', $dir = 'ltr' ) { $resourceLoader = new ResourceLoader(); $request = new FauxRequest( array( 'lang' => $lang, @@ -10,7 +15,14 @@ abstract class ResourceLoaderTestCase extends MediaWikiTestCase { 'skin' => 'vector', 'target' => 'test', ) ); - return new ResourceLoaderContext( $resourceLoader, $request ); + $ctx = $this->getMockBuilder( 'ResourceLoaderContext' ) + ->setConstructorArgs( array( $resourceLoader, $request ) ) + ->setMethods( array( 'getDirection' ) ) + ->getMock(); + $ctx->expects( $this->any() )->method( 'getDirection' )->will( + $this->returnValue( $dir ) + ); + return $ctx; } protected function setUp() { @@ -86,10 +98,3 @@ class ResourceLoaderTestModule extends ResourceLoaderModule { class ResourceLoaderFileModuleTestModule extends ResourceLoaderFileModule { } - -class ResourceLoaderWikiModuleTestModule extends ResourceLoaderWikiModule { - // Override expected via PHPUnit mocks and stubs - protected function getPages( ResourceLoaderContext $context ) { - return array(); - } -} diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index 121aade9..a5c8ef61 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -15,14 +15,7 @@ EOF; } class MediaWikiPHPUnitBootstrap { - - public function __construct() { - wfProfileIn( __CLASS__ ); - } - public function __destruct() { - wfProfileOut( __CLASS__ ); - // Return to real wiki db, so profiling data is preserved MediaWikiTestCase::teardownTestDB(); diff --git a/tests/phpunit/data/composer/composer.json b/tests/phpunit/data/composer/composer.json new file mode 100644 index 00000000..bcd196f4 --- /dev/null +++ b/tests/phpunit/data/composer/composer.json @@ -0,0 +1,48 @@ +{ + "name": "mediawiki/core", + "description": "Free software wiki application developed by the Wikimedia Foundation and others", + "keywords": ["mediawiki", "wiki"], + "homepage": "https://www.mediawiki.org/", + "authors": [ + { + "name": "MediaWiki Community", + "homepage": "https://www.mediawiki.org/wiki/Special:Version/Credits" + } + ], + "license": "GPL-2.0", + "support": { + "issues": "https://bugzilla.wikimedia.org/", + "irc": "irc://irc.freenode.net/mediawiki", + "wiki": "https://www.mediawiki.org/" + }, + "require": { + "leafo/lessphp": "0.5.0", + "php": ">=5.3.3", + "psr/log": "1.0.0", + "cssjanus/cssjanus": "1.1.1", + "cdb/cdb": "1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-fileinfo": "*", + "ext-mbstring": "*", + "ext-wikidiff2": "*", + "ext-apc": "*", + "monolog/monolog": "*" + }, + "autoload": { + "psr-0": { + "ComposerHookHandler": "includes/composer" + } + }, + "scripts": { + "pre-update-cmd": "ComposerHookHandler::onPreUpdate", + "pre-install-cmd": "ComposerHookHandler::onPreInstall" + }, + "config": { + "prepend-autoloader": false, + "optimize-autoloader": true + } +} diff --git a/tests/phpunit/data/composer/composer.lock b/tests/phpunit/data/composer/composer.lock new file mode 100644 index 00000000..cae6a478 --- /dev/null +++ b/tests/phpunit/data/composer/composer.lock @@ -0,0 +1,1195 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "a3bb80b0ac4c4a31e52574d48c032923", + "packages": [ + { + "name": "composer/installers", + "version": "v1.0.19", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "89d77bfbee79e16653f7162c86e602cc188471db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/89d77bfbee79e16653f7162c86e602cc188471db", + "reference": "89d77bfbee79e16653f7162c86e602cc188471db", + "shasum": "" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "4.1.*" + }, + "type": "composer-installer", + "extra": { + "class": "Composer\\Installers\\Installer", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Composer\\Installers\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "http://composer.github.com/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Hurad", + "MODX Evo", + "OXID", + "Thelia", + "WolfCMS", + "agl", + "annotatecms", + "bitrix", + "cakephp", + "chef", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "elgg", + "fuelphp", + "grav", + "installer", + "joomla", + "kohana", + "laravel", + "lithium", + "magento", + "mako", + "mediawiki", + "modulework", + "moodle", + "phpbb", + "piwik", + "ppi", + "puppet", + "roundcube", + "shopware", + "silverstripe", + "symfony", + "typo3", + "wordpress", + "zend", + "zikula" + ], + "time": "2014-11-29 01:29:17" + }, + { + "name": "cssjanus/cssjanus", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/cssjanus/php-cssjanus.git", + "reference": "62a9c32e6e140de09082b40a6e99d868ad14d4e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cssjanus/php-cssjanus/zipball/62a9c32e6e140de09082b40a6e99d868ad14d4e0", + "reference": "62a9c32e6e140de09082b40a6e99d868ad14d4e0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "0.8.*", + "phpunit/phpunit": "3.7.*", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-0": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Convert CSS stylesheets between left-to-right and right-to-left.", + "time": "2014-11-14 20:00:50" + }, + { + "name": "leafo/lessphp", + "version": "v0.5.0", + "source": { + "type": "git", + "url": "https://github.com/leafo/lessphp.git", + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/leafo/lessphp/zipball/0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", + "shasum": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "lessc.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT", + "GPL-3.0" + ], + "authors": [ + { + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" + } + ], + "description": "lessphp is a compiler for LESS written in PHP.", + "homepage": "http://leafo.net/lessphp/", + "time": "2014-11-24 18:39:20" + }, + { + "name": "mediawiki/translate", + "version": "2014.12", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/mediawiki-extensions-Translate.git", + "reference": "2bc100763f3150380412faceea258c7378ce7ea0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Translate/zipball/2bc100763f3150380412faceea258c7378ce7ea0", + "reference": "2bc100763f3150380412faceea258c7378ce7ea0", + "shasum": "" + }, + "require": { + "composer/installers": ">=1.0.1", + "mediawiki/universal-language-selector": "*", + "php": ">=5.3.0" + }, + "suggest": { + "mediawiki/babel": "Users can easily indicate their language proficiency on their user page", + "mediawiki/translation-notifications": "Manage communication with translators", + "mustangostang/spyc": "More recent version of the bundled spyc library" + }, + "type": "mediawiki-extension", + "autoload": { + "files": [ + "Translate.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Niklas Laxström", + "email": "niklas.laxstrom@gmail.com", + "role": "Lead nitpicker" + }, + { + "name": "Siebrand Mazeland", + "email": "s.mazeland@xs4all.nl", + "role": "Developer" + } + ], + "description": "The only standard solution to translate any kind of text with an avant-garde web interface within MediaWiki, including your documentation and software", + "homepage": "https://www.mediawiki.org/wiki/Extension:Translate", + "keywords": [ + "g11n", + "i18n", + "internationalization", + "l10n", + "localization", + "m17n", + "mediawiki", + "translatewiki.net", + "translation" + ], + "time": "2014-12-30 15:21:24" + }, + { + "name": "mediawiki/universal-language-selector", + "version": "2014.12", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelector.git", + "reference": "f730b0f47e2828001c1e03ec40d4681bfb0bff2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-UniversalLanguageSelector/zipball/f730b0f47e2828001c1e03ec40d4681bfb0bff2d", + "reference": "f730b0f47e2828001c1e03ec40d4681bfb0bff2d", + "shasum": "" + }, + "require": { + "composer/installers": ">=1.0.1", + "php": ">=5.3.0" + }, + "suggest": { + "mediawiki/cldr": "Language names in all languages" + }, + "type": "mediawiki-extension", + "autoload": { + "files": [ + "UniversalLanguageSelector.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+", + "MIT" + ], + "description": "The primary aim is to allow users to select a language and configure its support in an easy way. Main features are language selection, input methods and web fonts.", + "homepage": "https://www.mediawiki.org/wiki/Extension:UniversalLanguageSelector", + "keywords": [ + "Input methods", + "Language selection", + "Web fonts", + "mediawiki" + ], + "time": "2014-12-30 15:21:25" + }, + { + "name": "oojs/oojs-ui", + "version": "v0.6.0", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/oojs-ui.git", + "reference": "50fa12637ad377f00bdbf1913406a3bfe9c1689e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/oojs-ui/zipball/50fa12637ad377f00bdbf1913406a3bfe9c1689e", + "reference": "50fa12637ad377f00bdbf1913406a3bfe9c1689e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "php/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "homepage": "https://www.mediawiki.org/wiki/OOjs_UI", + "time": "2014-12-16 20:50:05" + }, + { + "name": "psr/log", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2012-12-21 11:40:51" + }, + { + "name": "wikimedia/cdb", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/cdb.git", + "reference": "3b7d5366c88eccf2517ebac57c59eb557c82f46c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/cdb/zipball/3b7d5366c88eccf2517ebac57c59eb557c82f46c", + "reference": "3b7d5366c88eccf2517ebac57c59eb557c82f46c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "Tim Starling", + "email": "tstarling@wikimedia.org" + }, + { + "name": "Chad Horohoe", + "email": "chad@wikimedia.org" + } + ], + "description": "Constant Database (CDB) wrapper library for PHP. Provides pure-PHP fallback when dba_* functions are absent.", + "homepage": "https://www.mediawiki.org/wiki/CDB", + "time": "2014-12-08 19:26:44" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", + "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "2.0.*@ALPHA" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Instantiator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2014-10-13 12:58:55" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.0.14", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ca158276c1200cc27f5409a5e338486bc0b4fc94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca158276c1200cc27f5409a5e338486bc0b4fc94", + "reference": "ca158276c1200cc27f5409a5e338486bc0b4fc94", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "~1.0", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4.1" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2014-12-26 13:28:33" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", + "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "File/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2013-10-10 15:34:57" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "Text/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2014-01-30 17:20:04" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2013-08-02 07:42:54" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "f8d5d08c56de5cfd592b3340424a81733259a876" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876", + "reference": "f8d5d08c56de5cfd592b3340424a81733259a876", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2014-08-31 06:12:13" + }, + { + "name": "phpunit/phpunit", + "version": "4.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "6a5e49a86ce5e33b8d0657abe145057fc513543a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6a5e49a86ce5e33b8d0657abe145057fc513543a", + "reference": "6a5e49a86ce5e33b8d0657abe145057fc513543a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpunit/php-code-coverage": "~2.0", + "phpunit/php-file-iterator": "~1.3.2", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "~1.0.2", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.0", + "sebastian/diff": "~1.1", + "sebastian/environment": "~1.1", + "sebastian/exporter": "~1.0", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2014-12-28 07:57:05" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "c63d2367247365f688544f0d500af90a11a44c65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", + "reference": "c63d2367247365f688544f0d500af90a11a44c65", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "~1.0,>=1.0.1", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.3" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2014-10-03 05:12:11" + }, + { + "name": "sebastian/comparator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "c484a80f97573ab934e37826dba0135a3301b26a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/c484a80f97573ab934e37826dba0135a3301b26a", + "reference": "c484a80f97573ab934e37826dba0135a3301b26a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.1", + "sebastian/exporter": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2014-11-16 21:32:38" + }, + { + "name": "sebastian/diff", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", + "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2014-08-15 10:29:00" + }, + { + "name": "sebastian/environment", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", + "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2014-10-25 08:00:45" + }, + { + "name": "sebastian/exporter", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2014-09-10 00:51:36" + }, + { + "name": "sebastian/global-state", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2014-10-06 09:23:50" + }, + { + "name": "sebastian/version", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/a77d9123f8e809db3fbdea15038c27a95da4058b", + "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2014-12-15 14:25:24" + }, + { + "name": "symfony/yaml", + "version": "v2.6.1", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", + "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2014-12-02 20:19:20" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "platform": { + "php": ">=5.3.3" + }, + "platform-dev": [] +} diff --git a/tests/phpunit/data/composer/new-composer.json b/tests/phpunit/data/composer/new-composer.json new file mode 100644 index 00000000..0634c2dd --- /dev/null +++ b/tests/phpunit/data/composer/new-composer.json @@ -0,0 +1,48 @@ +{ + "name": "mediawiki/core", + "description": "Free software wiki application developed by the Wikimedia Foundation and others", + "keywords": ["mediawiki", "wiki"], + "homepage": "https://www.mediawiki.org/", + "authors": [ + { + "name": "MediaWiki Community", + "homepage": "https://www.mediawiki.org/wiki/Special:Version/Credits" + } + ], + "license": "GPL-2.0", + "support": { + "issues": "https://bugzilla.wikimedia.org/", + "irc": "irc://irc.freenode.net/mediawiki", + "wiki": "https://www.mediawiki.org/" + }, + "require": { + "leafo/lessphp": "0.5.0", + "php": ">=5.3.3", + "psr/log": "1.0.0", + "cssjanus/cssjanus": "1.1.1", + "wikimedia/cdb": "1.0.1" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-fileinfo": "*", + "ext-mbstring": "*", + "ext-wikidiff2": "*", + "ext-apc": "*", + "monolog/monolog": "*" + }, + "autoload": { + "psr-0": { + "ComposerHookHandler": "includes/composer" + } + }, + "scripts": { + "pre-update-cmd": "ComposerHookHandler::onPreUpdate", + "pre-install-cmd": "ComposerHookHandler::onPreInstall" + }, + "config": { + "prepend-autoloader": false, + "optimize-autoloader": true + } +} diff --git a/tests/phpunit/data/cssmin/circle.svg b/tests/phpunit/data/cssmin/circle.svg new file mode 100644 index 00000000..6b7d1afd --- /dev/null +++ b/tests/phpunit/data/cssmin/circle.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8"> +<circle cx="4" cy="4" r="2"/> +</svg> diff --git a/tests/phpunit/data/gitinfo/info-testValidJsonData.json b/tests/phpunit/data/gitinfo/info-testValidJsonData.json index e955a2b6..8cf21bda 100644 --- a/tests/phpunit/data/gitinfo/info-testValidJsonData.json +++ b/tests/phpunit/data/gitinfo/info-testValidJsonData.json @@ -1 +1,7 @@ -{
"head": "refs/heads/master",
"headSHA1": "0123456789abcdef0123456789abcdef01234567",
"headCommitDate": "1070884800",
"branch": "master",
"remoteURL": "https://gerrit.wikimedia.org/r/mediawiki/core"
}
\ No newline at end of file +{ + "head": "refs/heads/master", + "headSHA1": "0123456789abcdef0123456789abcdef01234567", + "headCommitDate": "1070884800", + "branch": "master", + "remoteURL": "https://gerrit.wikimedia.org/r/mediawiki/core" +} diff --git a/tests/phpunit/data/helpers/WellProtectedClass.php b/tests/phpunit/data/helpers/WellProtectedClass.php new file mode 100644 index 00000000..99c7f642 --- /dev/null +++ b/tests/phpunit/data/helpers/WellProtectedClass.php @@ -0,0 +1,21 @@ +<?php + +class WellProtectedClass { + protected $property; + + public function __construct() { + $this->property = 1; + } + + protected function incrementPropertyValue() { + $this->property++; + } + + public function getProperty() { + return $this->property; + } + + protected function whatSecondArg( $a, $b = false ) { + return $b; + } +} diff --git a/tests/phpunit/data/media/Soccer_ball_animated.svg b/tests/phpunit/data/media/Soccer_ball_animated.svg index 6bd82fc4..183e43d8 100644 --- a/tests/phpunit/data/media/Soccer_ball_animated.svg +++ b/tests/phpunit/data/media/Soccer_ball_animated.svg @@ -1,55 +1,55 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg>
-<svg width="150" height="150" viewBox="-105 -105 210 210" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs>
- <clipPath id="ball">
- <circle r="100" stroke-width="0"/>
- </clipPath>
- <radialGradient id="shadow1" cx=".4" cy=".3" r=".8">
- <stop offset="0" stop-color="white" stop-opacity="1"/>
- <stop offset=".4" stop-color="white" stop-opacity="1"/>
- <stop offset=".8" stop-color="#EEEEEE" stop-opacity="1"/>
- </radialGradient>
- <radialGradient id="shadow2" cx=".5" cy=".5" r=".5">
- <stop offset="0" stop-color="white" stop-opacity="0"/>
- <stop offset=".8" stop-color="white" stop-opacity="0"/>
- <stop offset=".99" stop-color="black" stop-opacity=".3"/>
- <stop offset="1" stop-color="black" stop-opacity="1"/>
- </radialGradient>
- <g id="black_stuff" stroke-linejoin="round" clip-path="url(#ball)">
- <g fill="black">
- <path d="M 6,-32 Q 26,-28 46,-19 Q 57,-35 64,-47 Q 50,-68 37,-76 Q 17,-75 1,-68 Q 4,-51 6,-32"/>
- <path d="M -26,-2 Q -45,-8 -62,-11 Q -74,5 -76,22 Q -69,40 -50,54 Q -32,47 -17,39 Q -23,15 -26,-2"/>
- <path d="M -95,22 Q -102,12 -102,-8 V 80 H -85 Q -95,45 -95,22"/>
- <path d="M 55,24 Q 41,41 24,52 Q 28,65 31,79 Q 55,78 68,67 Q 78,50 80,35 Q 65,28 55,24"/>
- <path d="M 0,120 L -3,95 Q -25,93 -42,82 Q -50,84 -60,81"/>
- <path d="M -90,-48 Q -80,-52 -68,-49 Q -52,-71 -35,-77 Q -35,-100 -40,-100 H -100"/>
- <path d="M 100,-55 L 87,-37 Q 98,-10 97,5 L 100,6"/>
- </g>
- <g fill="none">
- <path d="M 6,-32 Q -18,-12 -26,-2
- M 46,-19 Q 54,5 55,24
- M 64,-47 Q 77,-44 87,-37
- M 37,-76 Q 39,-90 36,-100
- M 1,-68 Q -13,-77 -35,-77
- M -62,-11 Q -67,-25 -68,-49
- M -76,22 Q -85,24 -95,22
- M -50,54 Q -49,70 -42,82
- M -17,39 Q 0,48 24,52
- M 31,79 Q 20,92 -3,95
- M 68,67 L 80,80
- M 80,35 Q 90,25 97,5
- "/>
- </g>
- </g>
- </defs>
- <circle r="100" fill="white" stroke="none"/>
- <circle r="100" fill="url(#shadow1)" stroke="none"/>
- <g><animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0" to="360" begin="0s" dur="3s" repeatCount="indefinite"/>
- <use xlink:href="#black_stuff" stroke="#EEE" stroke-width="7"/>
- <use xlink:href="#black_stuff" stroke="#DDD" stroke-width="4"/>
- <use xlink:href="#black_stuff" stroke="#999" stroke-width="2"/>
- <use xlink:href="#black_stuff" stroke="black" stroke-width="1"/>
- </g>
- <circle r="100" fill="url(#shadow2)" stroke="none"/>
-</svg>
+<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE svg> +<svg width="150" height="150" viewBox="-105 -105 210 210" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <defs> + <clipPath id="ball"> + <circle r="100" stroke-width="0"/> + </clipPath> + <radialGradient id="shadow1" cx=".4" cy=".3" r=".8"> + <stop offset="0" stop-color="white" stop-opacity="1"/> + <stop offset=".4" stop-color="white" stop-opacity="1"/> + <stop offset=".8" stop-color="#EEEEEE" stop-opacity="1"/> + </radialGradient> + <radialGradient id="shadow2" cx=".5" cy=".5" r=".5"> + <stop offset="0" stop-color="white" stop-opacity="0"/> + <stop offset=".8" stop-color="white" stop-opacity="0"/> + <stop offset=".99" stop-color="black" stop-opacity=".3"/> + <stop offset="1" stop-color="black" stop-opacity="1"/> + </radialGradient> + <g id="black_stuff" stroke-linejoin="round" clip-path="url(#ball)"> + <g fill="black"> + <path d="M 6,-32 Q 26,-28 46,-19 Q 57,-35 64,-47 Q 50,-68 37,-76 Q 17,-75 1,-68 Q 4,-51 6,-32"/> + <path d="M -26,-2 Q -45,-8 -62,-11 Q -74,5 -76,22 Q -69,40 -50,54 Q -32,47 -17,39 Q -23,15 -26,-2"/> + <path d="M -95,22 Q -102,12 -102,-8 V 80 H -85 Q -95,45 -95,22"/> + <path d="M 55,24 Q 41,41 24,52 Q 28,65 31,79 Q 55,78 68,67 Q 78,50 80,35 Q 65,28 55,24"/> + <path d="M 0,120 L -3,95 Q -25,93 -42,82 Q -50,84 -60,81"/> + <path d="M -90,-48 Q -80,-52 -68,-49 Q -52,-71 -35,-77 Q -35,-100 -40,-100 H -100"/> + <path d="M 100,-55 L 87,-37 Q 98,-10 97,5 L 100,6"/> + </g> + <g fill="none"> + <path d="M 6,-32 Q -18,-12 -26,-2 + M 46,-19 Q 54,5 55,24 + M 64,-47 Q 77,-44 87,-37 + M 37,-76 Q 39,-90 36,-100 + M 1,-68 Q -13,-77 -35,-77 + M -62,-11 Q -67,-25 -68,-49 + M -76,22 Q -85,24 -95,22 + M -50,54 Q -49,70 -42,82 + M -17,39 Q 0,48 24,52 + M 31,79 Q 20,92 -3,95 + M 68,67 L 80,80 + M 80,35 Q 90,25 97,5 + "/> + </g> + </g> + </defs> + <circle r="100" fill="white" stroke="none"/> + <circle r="100" fill="url(#shadow1)" stroke="none"/> + <g><animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0" to="360" begin="0s" dur="3s" repeatCount="indefinite"/> + <use xlink:href="#black_stuff" stroke="#EEE" stroke-width="7"/> + <use xlink:href="#black_stuff" stroke="#DDD" stroke-width="4"/> + <use xlink:href="#black_stuff" stroke="#999" stroke-width="2"/> + <use xlink:href="#black_stuff" stroke="black" stroke-width="1"/> + </g> + <circle r="100" fill="url(#shadow2)" stroke="none"/> +</svg> diff --git a/tests/phpunit/data/media/Tux.svg b/tests/phpunit/data/media/Tux.svg index 39561078..e48b7353 100644 --- a/tests/phpunit/data/media/Tux.svg +++ b/tests/phpunit/data/media/Tux.svg @@ -1,902 +1,902 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="100%" width="100%" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="0 0 349.46883 405.12272">
- <title>Tux</title>
- <desc>For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg</desc>
- <radialGradient id="ag" gradientUnits="userSpaceOnUse" cy="-551.04" cx="274.822" gradientTransform="matrix(.5671 0 0 -.2835 81.263 201.645)" r="165.384">
- <stop stop-opacity=".502" offset="0"/>
- <stop stop-opacity="0" offset="1"/>
- </radialGradient>
- <path fill="url(#ag)" d="m330.892 357.885c0 25.898-41.989 46.893-93.785 46.893-51.795 0-93.784-20.994-93.784-46.893s41.989-46.893 93.784-46.893c51.795 0.001 93.785 20.995 93.785 46.893z"/>
- <radialGradient id="ak" gradientUnits="userSpaceOnUse" cy="-551.042" cx="268.794" gradientTransform="matrix(.5823 0 0 -.2835 -61.6052 201.14)" r="165.383">
- <stop stop-opacity=".502" offset="0"/>
- <stop stop-opacity="0" offset="1"/>
- </radialGradient>
- <path fill="url(#ak)" d="m191.223 357.381c0 25.897-43.117 46.892-96.306 46.892-53.188 0-96.305-20.994-96.305-46.892s43.117-46.893 96.305-46.893c53.188 0.001 96.306 20.995 96.306 46.893z"/>
- <g transform="translate(8.99996 9.00046)">
- <path d="m292.327 256.606c-4.752 19.584-28.872 60.48-41.688 78.48-12.815 18.072-11.231 34.344-34.92 28.008-23.616-6.336-30.24-5.184-54.647-3.744-24.265 1.439-19.009-0.721-34.2 6.12-15.12 6.84-65.88-82.944-69.984-99.647-4.031-16.705-5.976-14.689 4.536-32.761 10.513-18.071 12.024-35.928 25.92-57.816 13.896-21.96 29.952-33.12 28.8-49.896-4.535-62.28-8.136-93.384 19.513-107.784 26.352-13.68 48.384-5.544 57.096-0.864 3.744 2.016 11.376 5.904 17.064 12.744 5.688 6.696 10.8 16.848 13.68 29.664 5.904 25.704-2.448 17.208 4.248 46.656 6.624 29.375 20.088 43.775 36.504 67.031 16.414 23.257 33.55 61.633 28.078 83.809z"/>
- <g transform="translate(-12.4048,10.0005)">
- <path fill="#666" d="m148.47 94.049c4.319-1.728 3.592-1.958 6.472-8.222 2.304-4.824 4.328-6.898 4.256-14.242 0-7.2-2.232-9.648-5.616-14.328-3.24-4.464-8.424-4.68-11.664-4.104-1.872 0.288-4.319 2.664-5.976 6.192-1.08 2.376-1.944 5.4-2.017 8.568-0.216 8.496 0.505 11.736 2.448 17.496 2.305 6.769 7.921 10.297 12.097 8.64z"/>
- <path fill="#6d6d6d" d="m148.47 94.023c4.293-1.717 3.563-1.954 6.425-8.178 2.289-4.793 4.312-6.861 4.271-14.164 0.027-7.152-2.162-9.702-5.488-14.201-3.296-4.345-8.376-4.509-11.593-3.953-1.916 0.283-4.354 2.569-6.038 5.968-1.159 2.31-2.016 5.353-2.087 8.535-0.212 8.438 0.547 11.691 2.46 17.417 2.268 6.731 7.901 10.221 12.05 8.576z"/>
- <path fill="#757575" d="m148.471 93.996c4.264-1.706 3.533-1.95 6.377-8.133 2.273-4.762 4.296-6.823 4.288-14.085 0.053-7.105-2.093-9.756-5.363-14.075-3.35-4.225-8.327-4.338-11.52-3.801-1.961 0.278-4.389 2.474-6.099 5.744-1.242 2.245-2.089 5.305-2.16 8.501-0.207 8.38 0.591 11.647 2.473 17.34 2.231 6.691 7.881 10.144 12.004 8.509z"/>
- <path fill="#7c7c7c" d="m148.471 93.969c4.235-1.694 3.506-1.946 6.329-8.089 2.26-4.731 4.28-6.786 4.304-14.006 0.081-7.058-2.021-9.811-5.236-13.948-3.403-4.105-8.278-4.167-11.446-3.649-2.006 0.273-4.424 2.379-6.16 5.519-1.322 2.179-2.161 5.257-2.232 8.468-0.202 8.323 0.636 11.603 2.486 17.261 2.191 6.654 7.859 10.068 11.955 8.444z"/>
- <path fill="#848484" d="m148.471 93.943c4.209-1.684 3.477-1.942 6.282-8.045 2.245-4.7 4.266-6.749 4.319-13.928 0.107-7.01-1.95-9.864-5.109-13.821-3.458-3.985-8.23-3.996-11.375-3.498-2.049 0.268-4.458 2.284-6.222 5.295-1.403 2.114-2.233 5.21-2.303 8.435-0.198 8.265 0.679 11.559 2.498 17.183 2.156 6.615 7.842 9.992 11.91 8.379z"/>
- <path fill="#8c8c8c" d="m148.471 93.916c4.181-1.672 3.448-1.938 6.235-8 2.23-4.668 4.249-6.711 4.335-13.85 0.134-6.962-1.88-9.918-4.982-13.695-3.513-3.865-8.183-3.825-11.303-3.347-2.094 0.263-4.492 2.189-6.283 5.07-1.484 2.049-2.306 5.163-2.375 8.401-0.193 8.207 0.723 11.515 2.511 17.105 2.118 6.58 7.821 9.919 11.862 8.316z"/>
- <path fill="#939393" d="m148.472 93.889c4.152-1.661 3.419-1.934 6.188-7.956 2.215-4.638 4.233-6.674 4.35-13.771 0.161-6.915-1.809-9.972-4.854-13.568-3.567-3.746-8.134-3.654-11.23-3.195-2.138 0.259-4.527 2.094-6.345 4.847-1.564 1.983-2.378 5.115-2.447 8.368-0.188 8.149 0.767 11.47 2.523 17.026 2.079 6.54 7.8 9.841 11.815 8.249z"/>
- <path fill="#9b9b9b" d="m148.472 93.863c4.125-1.65 3.391-1.93 6.141-7.912 2.2-4.607 4.217-6.637 4.366-13.693 0.188-6.868-1.739-10.026-4.729-13.441-3.621-3.626-8.085-3.484-11.157-3.044-2.183 0.253-4.562 1.999-6.406 4.622-1.646 1.918-2.45 5.068-2.52 8.335-0.185 8.091 0.811 11.426 2.535 16.948 2.044 6.502 7.782 9.766 11.77 8.185z"/>
- <path fill="#a3a3a3" d="m148.472 93.836c4.097-1.639 3.361-1.926 6.094-7.867 2.185-4.576 4.201-6.599 4.382-13.614 0.214-6.82-1.669-10.081-4.603-13.315-3.676-3.506-8.036-3.313-11.084-2.893-2.229 0.249-4.598 1.904-6.47 4.398-1.726 1.852-2.521 5.021-2.591 8.301-0.18 8.034 0.854 11.382 2.548 16.87 2.008 6.465 7.763 9.691 11.724 8.12z"/>
- <path fill="#aaa" d="m148.472 93.809c4.069-1.628 3.334-1.922 6.047-7.823 2.17-4.544 4.185-6.562 4.396-13.536 0.242-6.772-1.597-10.134-4.475-13.188-3.73-3.387-7.989-3.142-11.013-2.741-2.271 0.243-4.632 1.809-6.53 4.173-1.808 1.787-2.594 4.974-2.662 8.268-0.176 7.976 0.897 11.337 2.56 16.792 1.97 6.427 7.743 9.615 11.677 8.055z"/>
- <path fill="#b2b2b2" d="m148.473 93.782c4.041-1.617 3.304-1.918 5.999-7.778 2.154-4.514 4.169-6.524 4.412-13.458 0.269-6.725-1.526-10.188-4.349-13.062-3.784-3.267-7.939-2.971-10.939-2.589-2.316 0.238-4.666 1.714-6.592 3.949-1.888 1.721-2.667 4.926-2.734 8.234-0.171 7.918 0.941 11.293 2.572 16.713 1.933 6.391 7.723 9.541 11.631 7.991z"/>
- <path fill="#bababa" d="m148.473 93.756c4.014-1.606 3.275-1.914 5.951-7.734 2.141-4.482 4.153-6.487 4.43-13.379 0.295-6.678-1.457-10.243-4.223-12.935-3.839-3.147-7.892-2.8-10.867-2.438-2.36 0.233-4.701 1.619-6.653 3.725-1.969 1.656-2.739 4.879-2.806 8.201-0.167 7.86 0.984 11.249 2.585 16.636 1.895 6.35 7.702 9.462 11.583 7.924z"/>
- <path fill="#c1c1c1" d="m148.473 93.729c3.985-1.595 3.247-1.91 5.904-7.69 2.125-4.451 4.138-6.45 4.445-13.3 0.321-6.63-1.387-10.297-4.096-12.808-3.894-3.028-7.844-2.629-10.795-2.287-2.405 0.229-4.735 1.524-6.716 3.5-2.049 1.59-2.811 4.831-2.878 8.167-0.161 7.802 1.029 11.205 2.599 16.557 1.859 6.314 7.683 9.389 11.537 7.861z"/>
- <path fill="#c9c9c9" d="m148.473 93.702c3.958-1.583 3.219-1.906 5.857-7.646 2.11-4.42 4.121-6.412 4.46-13.222 0.35-6.583-1.315-10.351-3.969-12.682-3.947-2.908-7.794-2.458-10.722-2.135-2.45 0.224-4.771 1.429-6.777 3.276-2.13 1.525-2.883 4.784-2.95 8.135-0.157 7.745 1.073 11.16 2.611 16.479 1.821 6.276 7.663 9.313 11.49 7.795z"/>
- <path fill="#d1d1d1" d="m148.474 93.676c3.93-1.573 3.188-1.902 5.809-7.601 2.097-4.389 4.107-6.375 4.477-13.144 0.375-6.535-1.245-10.404-3.842-12.555-4.002-2.788-7.747-2.287-10.65-1.984-2.493 0.219-4.805 1.334-6.837 3.052-2.213 1.459-2.957 4.736-3.022 8.101-0.153 7.687 1.116 11.116 2.623 16.401 1.782 6.237 7.642 9.237 11.442 7.73z"/>
- <path fill="#d8d8d8" d="m148.474 93.649c3.901-1.562 3.16-1.898 5.762-7.557 2.082-4.358 4.091-6.338 4.493-13.065 0.401-6.487-1.176-10.458-3.716-12.428-4.057-2.668-7.698-2.116-10.578-1.832-2.538 0.214-4.839 1.239-6.899 2.827-2.292 1.394-3.029 4.689-3.094 8.068-0.148 7.629 1.16 11.072 2.636 16.322 1.746 6.2 7.623 9.161 11.396 7.665z"/>
- <path fill="#e0e0e0" d="m148.474 93.622c3.875-1.55 3.132-1.894 5.715-7.512 2.066-4.327 4.075-6.3 4.508-12.987 0.429-6.44-1.104-10.513-3.588-12.302-4.111-2.549-7.65-1.945-10.506-1.681-2.582 0.209-4.874 1.144-6.961 2.604-2.373 1.328-3.102 4.642-3.165 8.034-0.145 7.571 1.204 11.027 2.647 16.244 1.709 6.162 7.604 9.086 11.35 7.6z"/>
- <path fill="#e8e8e8" d="m148.474 93.596c3.847-1.54 3.104-1.89 5.668-7.468 2.052-4.296 4.059-6.263 4.523-12.908 0.456-6.393-1.034-10.567-3.462-12.175-4.165-2.429-7.601-1.774-10.433-1.529-2.627 0.204-4.908 1.049-7.023 2.379-2.453 1.263-3.173 4.594-3.236 8.001-0.141 7.514 1.247 10.983 2.659 16.166 1.673 6.123 7.585 9.008 11.304 7.534z"/>
- <path fill="#efefef" d="m148.475 93.569c3.817-1.528 3.073-1.886 5.62-7.424 2.036-4.265 4.043-6.226 4.539-12.83 0.482-6.345-0.964-10.621-3.336-12.048-4.219-2.31-7.552-1.604-10.359-1.378-2.672 0.199-4.943 0.954-7.084 2.155-2.535 1.197-3.246 4.546-3.311 7.967-0.135 7.456 1.292 10.939 2.673 16.087 1.636 6.087 7.565 8.935 11.258 7.471z"/>
- <path fill="#f7f7f7" d="m148.475 93.542c3.791-1.517 3.046-1.882 5.572-7.379 2.022-4.234 4.027-6.188 4.556-12.751 0.51-6.297-0.894-10.675-3.208-11.921-4.274-2.19-7.505-1.433-10.289-1.227-2.715 0.194-4.978 0.859-7.146 1.93-2.614 1.132-3.317 4.5-3.381 7.935-0.131 7.398 1.335 10.895 2.686 16.009 1.597 6.047 7.544 8.858 11.21 7.404z"/>
- <path fill="#fff" d="m148.475 93.516c3.763-1.506 3.017-1.878 5.525-7.335 2.007-4.203 4.012-6.151 4.571-12.673 0.536-6.25-0.823-10.729-3.082-11.795-4.328-2.07-7.456-1.262-10.216-1.075-2.76 0.189-5.012 0.764-7.207 1.706-2.696 1.066-3.39 4.452-3.453 7.901-0.126 7.34 1.379 10.85 2.698 15.931 1.561 6.01 7.525 8.782 11.164 7.34z"/>
- </g>
- <path d="m132.033 74.7465c2.16 0 4.896 1.44 6.191 3.384 1.368 1.944 2.376 4.68 2.376 7.776 0 4.608-0.504 9.72-3.239 11.304-0.864 0.504-2.736 0.936-3.816 0.936-2.448 0-2.664-1.584-4.968-3.96-0.792-0.864-3.168-5.04-3.168-8.496 0-2.16-0.504-5.256 1.368-7.992 1.296-2.016 2.952-2.952 5.256-2.952z"/>
- <g transform="translate(-12.4048,10.0005)">
- <path d="m143.862 68.608c0.844-1.305 4.222-0.69 5.45 1.996 1.229 2.687 0.998 8.522 0.153 8.829-2.226 0.691-1.535-2.534-3.454-5.451-1.919-2.762-2.994-4.067-2.149-5.374z"/>
- <path fill="#070707" d="m143.916 68.664c0.833-1.289 4.169-0.681 5.381 1.971 1.215 2.653 0.985 8.414 0.152 8.717-2.198 0.682-1.516-2.502-3.411-5.382-1.895-2.728-2.956-4.017-2.122-5.306z"/>
- <path fill="#0f0f0f" d="m143.97 68.719c0.822-1.272 4.114-0.673 5.312 1.945 1.198 2.619 0.973 8.306 0.15 8.605-2.169 0.673-1.497-2.47-3.367-5.313-1.871-2.692-2.918-3.964-2.095-5.237z"/>
- <path fill="#161616" d="m144.024 68.774c0.812-1.255 4.062-0.664 5.243 1.92 1.182 2.585 0.96 8.198 0.147 8.493-2.141 0.665-1.477-2.438-3.323-5.244-1.846-2.657-2.88-3.913-2.067-5.169z"/>
- <path fill="#1e1e1e" d="m144.078 68.829c0.801-1.239 4.008-0.655 5.174 1.895 1.167 2.551 0.947 8.09 0.146 8.381-2.113 0.656-1.458-2.405-3.28-5.174-1.821-2.623-2.842-3.863-2.04-5.102z"/>
- <path fill="#262626" d="m144.132 68.884c0.791-1.222 3.955-0.646 5.105 1.87 1.151 2.517 0.935 7.982 0.144 8.27-2.085 0.647-1.438-2.374-3.235-5.105-1.798-2.589-2.805-3.812-2.014-5.035z"/>
- <path fill="#2d2d2d" d="m144.186 68.939c0.779-1.206 3.9-0.638 5.036 1.844 1.135 2.483 0.922 7.874 0.142 8.158-2.057 0.639-1.419-2.341-3.192-5.037-1.773-2.552-2.766-3.758-1.986-4.965z"/>
- <path fill="#353535" d="m144.24 68.994c0.769-1.189 3.848-0.629 4.967 1.819 1.12 2.449 0.909 7.766 0.141 8.046-2.028 0.629-1.399-2.31-3.148-4.967-1.75-2.518-2.73-3.708-1.96-4.898z"/>
- <path fill="#3d3d3d" d="m144.294 69.049c0.76-1.172 3.794-0.621 4.898 1.793 1.104 2.415 0.896 7.658 0.138 7.934-2 0.621-1.38-2.277-3.104-4.898-1.725-2.482-2.691-3.655-1.932-4.829z"/>
- <path fill="#444" d="m144.348 69.104c0.748-1.156 3.74-0.612 4.829 1.768 1.088 2.38 0.884 7.55 0.136 7.822-1.973 0.612-1.36-2.245-3.062-4.829-1.699-2.448-2.651-3.604-1.903-4.761z"/>
- <path fill="#4c4c4c" d="m144.402 69.16c0.737-1.14 3.687-0.603 4.76 1.743 1.073 2.347 0.871 7.442 0.134 7.71-1.943 0.604-1.341-2.213-3.017-4.76-1.676-2.414-2.614-3.554-1.877-4.693z"/>
- <path fill="#545454" d="m144.456 69.215c0.727-1.123 3.634-0.595 4.691 1.717 1.057 2.313 0.857 7.334 0.132 7.598-1.916 0.595-1.321-2.181-2.973-4.691-1.652-2.378-2.577-3.501-1.85-4.624z"/>
- <path fill="#5b5b5b" d="m144.51 69.27c0.717-1.106 3.58-0.585 4.622 1.692 1.041 2.278 0.847 7.226 0.131 7.486-1.888 0.586-1.303-2.149-2.93-4.622-1.628-2.343-2.539-3.45-1.823-4.556z"/>
- <path fill="#636363" d="m144.564 69.325c0.705-1.09 3.526-0.577 4.553 1.667 1.026 2.245 0.833 7.118 0.128 7.375-1.858 0.577-1.282-2.117-2.885-4.553-1.604-2.309-2.501-3.399-1.796-4.489z"/>
- <path fill="#6b6b6b" d="m144.618 69.38c0.694-1.073 3.473-0.568 4.483 1.642 1.011 2.21 0.82 7.01 0.127 7.263-1.831 0.568-1.264-2.084-2.842-4.484-1.578-2.274-2.462-3.347-1.768-4.421z"/>
- <path fill="#727272" d="m144.672 69.435c0.685-1.057 3.42-0.56 4.414 1.617 0.995 2.176 0.81 6.902 0.125 7.15-1.803 0.56-1.243-2.053-2.798-4.415-1.554-2.238-2.425-3.295-1.741-4.352z"/>
- <path fill="#7a7a7a" d="m144.726 69.49c0.673-1.041 3.365-0.551 4.345 1.591 0.979 2.143 0.796 6.794 0.123 7.039-1.775 0.551-1.224-2.021-2.754-4.346-1.53-2.203-2.387-3.244-1.714-4.284z"/>
- <path fill="#828282" d="m144.78 69.545c0.662-1.023 3.313-0.542 4.276 1.566 0.964 2.108 0.782 6.686 0.121 6.926-1.746 0.542-1.204-1.988-2.711-4.276-1.505-2.167-2.348-3.192-1.686-4.216z"/>
- <path fill="#898989" d="m144.834 69.6c0.652-1.007 3.259-0.533 4.207 1.541s0.771 6.578 0.119 6.815c-1.718 0.534-1.185-1.956-2.666-4.207-1.482-2.134-2.311-3.142-1.66-4.149z"/>
- <path fill="#919191" d="m144.888 69.655c0.641-0.99 3.206-0.524 4.138 1.516 0.933 2.04 0.758 6.47 0.117 6.703-1.69 0.525-1.165-1.924-2.623-4.138-1.457-2.098-2.273-3.09-1.632-4.081z"/>
- <path fill="#999" d="m144.942 69.71c0.63-0.974 3.152-0.516 4.069 1.49s0.744 6.362 0.114 6.591c-1.662 0.516-1.146-1.892-2.579-4.069-1.432-2.062-2.234-3.037-1.604-4.012z"/>
- </g>
- <g transform="translate(-12.4048,10.0005)">
- <path fill="#666" d="m193.11 94.985c10.8-1.152 14.616-5.328 16.56-12.6 1.729-6.48 1.801-13.68-3.023-22.104-4.536-8.063-7.128-9.36-13.681-9.864-10.079-0.864-14.832 6.192-17.063 11.232-2.376 5.472-1.872 4.68-1.729 11.592 0.145 7.272 4.245 9.299 6.766 13.835 2.519 4.465 10.946 7.982 12.17 7.909z"/>
- <path fill="#6d6d6d" d="m193.115 94.944c10.759-1.131 14.618-5.354 16.515-12.569 1.701-6.525 1.785-13.686-3.002-21.912-4.434-7.797-7.038-9.081-13.512-9.581-10.049-0.861-14.941 5.873-17.181 10.874-2.304 5.28-1.878 4.718-1.726 11.539 0.16 7.268 4.268 9.223 6.784 13.76 2.521 4.475 10.898 7.962 12.122 7.889z"/>
- <path fill="#757575" d="m193.12 94.902c10.718-1.11 14.62-5.379 16.469-12.538 1.676-6.57 1.771-13.692-2.979-21.721-4.331-7.53-6.947-8.801-13.344-9.297-10.018-0.858-15.05 5.553-17.298 10.516-2.229 5.087-1.885 4.757-1.722 11.487 0.176 7.264 4.289 9.146 6.803 13.686 2.52 4.485 10.848 7.942 12.071 7.867z"/>
- <path fill="#7c7c7c" d="m193.126 94.861c10.675-1.09 14.621-5.405 16.423-12.507 1.648-6.616 1.756-13.698-2.958-21.529-4.229-7.263-6.856-8.522-13.176-9.014-9.985-0.854-15.158 5.234-17.414 10.158-2.156 4.895-1.891 4.795-1.719 11.434 0.193 7.26 4.31 9.07 6.822 13.611 2.52 4.495 10.798 7.922 12.022 7.847z"/>
- <path fill="#848484" d="m193.131 94.82c10.635-1.069 14.623-5.431 16.377-12.476 1.622-6.661 1.741-13.704-2.936-21.337-4.126-6.996-6.767-8.242-13.008-8.73-9.955-0.852-15.267 4.915-17.53 9.8-2.084 4.703-1.896 4.833-1.716 11.38 0.209 7.256 4.332 8.995 6.841 13.537 2.52 4.505 10.748 7.902 11.972 7.826z"/>
- <path fill="#8c8c8c" d="m193.136 94.778c10.593-1.048 14.625-5.457 16.331-12.445 1.596-6.706 1.726-13.709-2.913-21.145-4.025-6.729-6.678-7.963-12.841-8.447-9.924-0.848-15.375 4.595-17.647 9.441-2.01 4.51-1.903 4.872-1.712 11.328 0.225 7.251 4.354 8.918 6.858 13.462 2.521 4.517 10.7 7.883 11.924 7.806z"/>
- <path fill="#939393" d="m193.141 94.737c10.552-1.027 14.627-5.482 16.286-12.414 1.568-6.751 1.711-13.715-2.893-20.954-3.922-6.462-6.586-7.683-12.672-8.163-9.892-0.845-15.483 4.276-17.764 9.083-1.938 4.318-1.909 4.91-1.709 11.275 0.24 7.247 4.375 8.842 6.878 13.387 2.521 4.528 10.651 7.863 11.874 7.786z"/>
- <path fill="#9b9b9b" d="m193.146 94.695c10.51-1.007 14.63-5.508 16.241-12.382 1.542-6.796 1.694-13.721-2.87-20.762-3.82-6.195-6.496-7.404-12.504-7.879-9.861-0.842-15.592 3.956-17.882 8.725-1.863 4.126-1.915 4.949-1.706 11.223 0.258 7.243 4.397 8.766 6.897 13.313 2.521 4.535 10.601 7.841 11.824 7.762z"/>
- <path fill="#a3a3a3" d="m193.151 94.654c10.469-0.986 14.632-5.534 16.196-12.351 1.515-6.842 1.68-13.727-2.85-20.57-3.717-5.928-6.405-7.125-12.335-7.596-9.83-0.839-15.7 3.637-17.998 8.367-1.791 3.933-1.922 4.987-1.703 11.169 0.273 7.239 4.419 8.689 6.916 13.238 2.521 4.547 10.551 7.822 11.774 7.743z"/>
- <path fill="#aaa" d="m193.157 94.612c10.427-0.965 14.633-5.56 16.149-12.32 1.488-6.887 1.666-13.733-2.826-20.379-3.615-5.661-6.316-6.845-12.168-7.313-9.799-0.835-15.809 3.317-18.114 8.009-1.718 3.741-1.928 5.025-1.7 11.117 0.29 7.235 4.44 8.613 6.936 13.163 2.519 4.558 10.499 7.804 11.723 7.723z"/>
- <path fill="#b2b2b2" d="m193.162 94.571c10.386-0.944 14.635-5.585 16.104-12.289 1.462-6.932 1.649-13.739-2.806-20.188-3.512-5.394-6.225-6.565-11.999-7.029-9.768-0.833-15.917 2.998-18.23 7.651-1.646 3.549-1.935 5.064-1.697 11.064 0.306 7.231 4.462 8.537 6.954 13.088 2.52 4.569 10.451 7.784 11.674 7.703z"/>
- <path fill="#bababa" d="m193.167 94.529c10.345-0.923 14.638-5.611 16.059-12.258 1.436-6.977 1.636-13.744-2.782-19.995-3.41-5.127-6.135-6.286-11.832-6.746-9.736-0.829-16.025 2.679-18.347 7.293-1.572 3.356-1.941 5.103-1.694 11.011 0.322 7.227 4.484 8.461 6.973 13.014 2.519 4.579 10.4 7.764 11.623 7.681z"/>
- <path fill="#c1c1c1" d="m193.172 94.488c10.304-0.903 14.64-5.637 16.014-12.227 1.409-7.022 1.62-13.75-2.762-19.804-3.308-4.86-6.044-6.006-11.662-6.462-9.705-0.826-16.135 2.359-18.466 6.935-1.498 3.164-1.945 5.141-1.689 10.958 0.338 7.223 4.506 8.385 6.991 12.939 2.519 4.59 10.351 7.744 11.574 7.661z"/>
- <path fill="#c9c9c9" d="m193.177 94.447c10.262-0.882 14.641-5.663 15.967-12.196 1.383-7.068 1.605-13.756-2.738-19.612-3.206-4.593-5.954-5.727-11.496-6.179-9.673-0.823-16.242 2.04-18.581 6.577-1.425 2.972-1.952 5.179-1.687 10.906 0.354 7.219 4.526 8.308 7.01 12.865 2.52 4.598 10.302 7.723 11.525 7.639z"/>
- <path fill="#d1d1d1" d="m193.182 94.405c10.221-0.861 14.643-5.688 15.922-12.165 1.355-7.113 1.591-13.762-2.717-19.42-3.104-4.326-5.864-5.448-11.327-5.895-9.644-0.82-16.352 1.721-18.698 6.219-1.353 2.779-1.959 5.217-1.684 10.853 0.369 7.214 4.549 8.232 7.028 12.79 2.521 4.609 10.254 7.703 11.476 7.618z"/>
- <path fill="#d8d8d8" d="m193.187 94.364c10.179-0.841 14.645-5.714 15.876-12.133 1.33-7.158 1.576-13.768-2.694-19.229-3.001-4.059-5.773-5.168-11.16-5.612-9.61-0.817-16.459 1.401-18.813 5.861-1.279 2.586-1.965 5.256-1.682 10.8 0.387 7.21 4.571 8.156 7.049 12.715 2.519 4.619 10.202 7.684 11.424 7.598z"/>
- <path fill="#e0e0e0" d="m193.193 94.322c10.137-0.82 14.646-5.74 15.83-12.103 1.303-7.203 1.561-13.773-2.673-19.037-2.898-3.792-5.684-4.889-10.991-5.328-9.58-0.813-16.568 1.082-18.931 5.502-1.206 2.395-1.972 5.294-1.679 10.747 0.403 7.207 4.592 8.08 7.067 12.641 2.521 4.631 10.154 7.666 11.377 7.578z"/>
- <path fill="#e8e8e8" d="m193.198 94.281c10.096-0.799 14.648-5.766 15.785-12.071 1.275-7.249 1.545-13.779-2.651-18.845-2.796-3.525-5.593-4.609-10.823-5.044-9.549-0.81-16.677 0.762-19.048 5.145-1.133 2.202-1.978 5.333-1.675 10.694 0.419 7.202 4.614 8.003 7.086 12.566 2.52 4.638 10.103 7.643 11.326 7.555z"/>
- <path fill="#efefef" d="m193.203 94.239c10.055-0.778 14.65-5.792 15.739-12.04 1.25-7.293 1.531-13.785-2.629-18.653-2.694-3.258-5.502-4.33-10.655-4.761-9.517-0.807-16.785 0.443-19.165 4.786-1.059 2.01-1.983 5.372-1.671 10.642 0.435 7.198 4.636 7.928 7.104 12.492 2.52 4.649 10.055 7.624 11.277 7.534z"/>
- <path fill="#f7f7f7" d="m193.208 94.198c10.014-0.757 14.652-5.817 15.694-12.009 1.223-7.339 1.516-13.792-2.607-18.462-2.592-2.991-5.413-4.05-10.486-4.478-9.487-0.804-16.895 0.124-19.282 4.428-0.986 1.817-1.989 5.41-1.668 10.589 0.451 7.194 4.657 7.851 7.123 12.417 2.519 4.661 10.004 7.605 11.226 7.515z"/>
- <path fill="#fff" d="m193.213 94.156c9.973-0.737 14.654-5.843 15.648-11.978 1.197-7.384 1.501-13.797-2.585-18.27-2.489-2.724-5.322-3.771-10.319-4.194-9.455-0.801-17.002-0.196-19.397 4.07-0.913 1.625-1.996 5.448-1.665 10.536 0.467 7.19 4.679 7.775 7.142 12.342 2.519 4.671 9.954 7.586 11.176 7.494z"/>
- </g>
- <path d="m179.841 74.4585c5.4 0 8.568 4.824 9.648 11.016 0.432 2.808-0.216 6.048-1.944 8.28-1.944 2.592-5.4 4.176-8.208 4.176-2.664 0-5.688 0.432-7.271-1.728-1.584-2.232-1.944-7.2-1.944-10.728 0-3.96 1.152-6.768 3.168-9 1.511-1.657 4.247-2.016 6.551-2.016z"/>
- <g transform="translate(-12.4048,10.0005)">
- <path d="m192.591 66.68c0.98-0.653 2.612 0 4.489 2.122 2.039 2.285 2.938 4.08 0.489 5.385-1.877 0.98-2.448-1.958-3.59-3.182-1.795-1.959-3.346-3.02-1.388-4.325z"/>
- <path fill="#070707" d="m192.631 66.738c0.96-0.649 2.573 0 4.423 2.09 2.009 2.251 2.864 4.02 0.481 5.305-1.837 0.977-2.403-1.929-3.525-3.135-1.768-1.925-3.296-2.965-1.379-4.26z"/>
- <path fill="#0f0f0f" d="m192.671 66.797c0.939-0.645 2.534 0 4.356 2.059 1.978 2.217 2.792 3.958 0.474 5.225-1.798 0.974-2.357-1.9-3.46-3.087-1.742-1.895-3.247-2.913-1.37-4.197z"/>
- <path fill="#161616" d="m192.711 66.855c0.919-0.641 2.495 0 4.289 2.027 1.948 2.184 2.721 3.898 0.467 5.146-1.759 0.971-2.313-1.871-3.396-3.041-1.715-1.861-3.197-2.858-1.36-4.132z"/>
- <path fill="#1e1e1e" d="m192.751 66.914c0.899-0.637 2.457 0 4.223 1.996 1.918 2.149 2.647 3.838 0.46 5.065-1.72 0.968-2.269-1.842-3.331-2.993-1.689-1.83-3.148-2.805-1.352-4.068z"/>
- <path fill="#262626" d="m192.791 66.973c0.878-0.633 2.418 0 4.155 1.964 1.888 2.116 2.576 3.777 0.453 4.986-1.68 0.965-2.224-1.813-3.267-2.946-1.661-1.798-3.097-2.752-1.341-4.004z"/>
- <path fill="#2d2d2d" d="m192.831 67.031c0.858-0.629 2.379 0 4.089 1.933 1.857 2.082 2.503 3.717 0.445 4.906-1.641 0.961-2.178-1.784-3.201-2.898-1.636-1.767-3.048-2.7-1.333-3.941z"/>
- <path fill="#353535" d="m192.87 67.09c0.838-0.625 2.341 0 4.023 1.902 1.827 2.047 2.431 3.656 0.438 4.826-1.601 0.958-2.133-1.755-3.137-2.852-1.608-1.735-2.998-2.646-1.324-3.876z"/>
- <path fill="#3d3d3d" d="m192.91 67.148c0.818-0.621 2.302 0 3.956 1.87 1.797 2.014 2.359 3.596 0.431 4.746-1.562 0.956-2.088-1.726-3.071-2.804-1.583-1.702-2.95-2.592-1.316-3.812z"/>
- <path fill="#444" d="m192.95 67.207c0.798-0.617 2.263 0 3.889 1.839 1.768 1.98 2.287 3.535 0.425 4.666-1.523 0.952-2.043-1.697-3.008-2.757-1.556-1.671-2.899-2.539-1.306-3.748z"/>
- <path fill="#4c4c4c" d="m192.99 67.266c0.777-0.614 2.224 0 3.823 1.807 1.735 1.946 2.214 3.474 0.416 4.586-1.483 0.949-1.998-1.667-2.942-2.709-1.529-1.639-2.85-2.486-1.297-3.684z"/>
- <path fill="#545454" d="m193.03 67.325c0.757-0.61 2.185 0 3.756 1.775 1.706 1.912 2.143 3.414 0.409 4.506-1.444 0.946-1.953-1.639-2.878-2.663-1.502-1.606-2.799-2.431-1.287-3.618z"/>
- <path fill="#5b5b5b" d="m193.07 67.383c0.736-0.605 2.146 0 3.688 1.744 1.677 1.878 2.07 3.353 0.402 4.426-1.405 0.943-1.908-1.609-2.813-2.615-1.475-1.575-2.749-2.378-1.277-3.555z"/>
- <path fill="#636363" d="m193.11 67.442c0.716-0.602 2.106 0 3.622 1.712 1.646 1.844 1.998 3.293 0.395 4.347-1.364 0.94-1.862-1.581-2.748-2.568-1.449-1.543-2.701-2.326-1.269-3.491z"/>
- <path fill="#6b6b6b" d="m193.15 67.5c0.696-0.598 2.069 0 3.556 1.681 1.615 1.811 1.925 3.232 0.387 4.267-1.325 0.937-1.818-1.552-2.683-2.521-1.423-1.511-2.651-2.272-1.26-3.427z"/>
- <path fill="#727272" d="m193.19 67.559c0.675-0.594 2.03 0 3.489 1.649 1.585 1.777 1.853 3.172 0.38 4.187-1.287 0.935-1.774-1.522-2.619-2.473-1.396-1.48-2.601-2.219-1.25-3.363z"/>
- <path fill="#7a7a7a" d="m193.23 67.618c0.654-0.59 1.991 0 3.422 1.618 1.555 1.743 1.781 3.111 0.373 4.107-1.247 0.931-1.729-1.494-2.554-2.426-1.369-1.448-2.551-2.166-1.241-3.299z"/>
- <path fill="#828282" d="m193.269 67.677c0.635-0.586 1.953 0 3.355 1.586 1.525 1.708 1.709 3.05 0.366 4.026-1.208 0.928-1.684-1.464-2.489-2.378-1.342-1.416-2.501-2.112-1.232-3.234z"/>
- <path fill="#898989" d="m193.309 67.735c0.614-0.582 1.914 0 3.29 1.555 1.493 1.675 1.636 2.99 0.357 3.947-1.169 0.925-1.639-1.435-2.424-2.332-1.316-1.384-2.452-2.058-1.223-3.17z"/>
- <path fill="#919191" d="m193.349 67.794c0.595-0.578 1.875 0 3.223 1.523 1.464 1.641 1.564 2.93 0.351 3.867-1.129 0.922-1.594-1.406-2.359-2.284-1.29-1.352-2.403-2.005-1.215-3.106z"/>
- <path fill="#999" d="m193.389 67.853c0.573-0.574 1.836 0 3.155 1.492 1.435 1.607 1.492 2.869 0.345 3.787-1.091 0.919-1.55-1.377-2.295-2.237-1.263-1.32-2.353-1.953-1.205-3.042z"/>
- </g>
- <g transform="translate(-12.4048,10.0005)">
- <path d="m165.498 69.906c1.693-0.654 3.012-0.69 5.63 1.036 3.166 2.088 1.705 5.245-0.779 4.601-2.146-0.556-2.417-0.681-4.391-1.086-3.101-0.648-3.641-3.322-0.46-4.551z"/>
- <path fill="#050505" d="m165.564 70.033c1.658-0.629 2.973-0.656 5.555 1.026 3.066 2.009 1.654 5.012-0.805 4.38-2.131-0.547-2.345-0.656-4.284-1.052-3.055-0.634-3.587-3.173-0.466-4.354z"/>
- <path fill="#0a0a0a" d="m165.63 70.16c1.623-0.604 2.935-0.622 5.481 1.015 2.965 1.93 1.602 4.779-0.83 4.159-2.119-0.539-2.274-0.63-4.179-1.018-3.009-0.618-3.533-3.022-0.472-4.156z"/>
- <path fill="#0f0f0f" d="m165.696 70.287c1.587-0.579 2.895-0.587 5.406 1.005 2.864 1.851 1.551 4.546-0.855 3.938-2.105-0.53-2.203-0.605-4.073-0.983-2.963-0.604-3.48-2.873-0.478-3.96z"/>
- <path fill="#141414" d="m165.761 70.413c1.553-0.553 2.856-0.553 5.331 0.995 2.766 1.772 1.5 4.313-0.88 3.717-2.092-0.521-2.131-0.58-3.967-0.949-2.916-0.588-3.425-2.723-0.484-3.763z"/>
- <path fill="#191919" d="m165.827 70.54c1.519-0.528 2.818-0.519 5.258 0.984 2.664 1.693 1.448 4.079-0.905 3.497-2.079-0.513-2.06-0.554-3.861-0.915-2.873-0.573-3.373-2.573-0.492-3.566z"/>
- <path fill="#1e1e1e" d="m165.893 70.667c1.482-0.503 2.778-0.484 5.183 0.974 2.564 1.614 1.397 3.846-0.93 3.276-2.067-0.504-1.989-0.529-3.756-0.88-2.826-0.559-3.319-2.425-0.497-3.37z"/>
- <path fill="#232323" d="m165.959 70.793c1.447-0.478 2.74-0.45 5.108 0.964 2.464 1.535 1.345 3.613-0.955 3.055-2.053-0.496-1.917-0.503-3.651-0.846-2.779-0.543-3.264-2.274-0.502-3.173z"/>
- <path fill="#282828" d="m166.025 70.92c1.412-0.453 2.701-0.416 5.034 0.954 2.362 1.456 1.293 3.38-0.981 2.834-2.04-0.487-1.845-0.478-3.545-0.812-2.733-0.528-3.21-2.125-0.508-2.976z"/>
- <path fill="#2d2d2d" d="m166.09 71.047c1.378-0.428 2.663-0.382 4.96 0.943 2.264 1.377 1.242 3.146-1.006 2.613-2.026-0.478-1.773-0.453-3.438-0.777-2.688-0.513-3.158-1.974-0.516-2.779z"/>
- <path fill="#333" d="m166.156 71.173c1.343-0.402 2.624-0.347 4.885 0.933 2.163 1.298 1.191 2.914-1.029 2.392-2.015-0.47-1.703-0.428-3.334-0.743-2.642-0.498-3.104-1.824-0.522-2.582z"/>
- <path fill="#383838" d="m166.222 71.3c1.307-0.377 2.585-0.313 4.81 0.922 2.063 1.219 1.14 2.681-1.055 2.171-2.001-0.461-1.631-0.402-3.229-0.708-2.594-0.483-3.048-1.674-0.526-2.385z"/>
- <path fill="#3d3d3d" d="m166.288 71.427c1.272-0.352 2.546-0.279 4.736 0.913 1.962 1.14 1.088 2.447-1.081 1.95-1.988-0.452-1.56-0.377-3.122-0.674-2.55-0.469-2.995-1.526-0.533-2.189z"/>
- <path fill="#424242" d="m166.354 71.554c1.236-0.327 2.507-0.245 4.661 0.902 1.861 1.061 1.037 2.214-1.106 1.729-1.974-0.444-1.488-0.352-3.016-0.64-2.504-0.453-2.942-1.375-0.539-1.991z"/>
- <path fill="#474747" d="m166.419 71.68c1.203-0.302 2.469-0.21 4.587 0.892 1.762 0.982 0.986 1.98-1.13 1.508-1.962-0.435-1.417-0.326-2.911-0.606-2.458-0.437-2.888-1.224-0.546-1.794z"/>
- <path fill="#4c4c4c" d="m166.485 71.807c1.167-0.276 2.429-0.176 4.513 0.882 1.66 0.903 0.935 1.748-1.156 1.288-1.948-0.426-1.345-0.301-2.805-0.572-2.412-0.423-2.834-1.076-0.552-1.598z"/>
- <path fill="#515151" d="m166.551 71.934c1.133-0.251 2.391-0.142 4.438 0.871 1.56 0.824 0.883 1.515-1.181 1.067-1.936-0.417-1.274-0.275-2.699-0.537-2.366-0.408-2.781-0.926-0.558-1.401z"/>
- <path fill="#565656" d="m166.617 72.061c1.097-0.227 2.351-0.108 4.363 0.861 1.46 0.745 0.831 1.281-1.206 0.846-1.922-0.409-1.202-0.25-2.594-0.503-2.319-0.393-2.726-0.777-0.563-1.204z"/>
- <path fill="#5b5b5b" d="m166.683 72.187c1.062-0.201 2.312-0.073 4.289 0.851 1.358 0.666 0.778 1.048-1.231 0.625-1.91-0.4-1.131-0.225-2.489-0.469-2.274-0.377-2.672-0.626-0.569-1.007z"/>
- <path fill="#606060" d="m166.748 72.314c1.027-0.176 2.274-0.04 4.215 0.84 1.26 0.587 0.729 0.815-1.256 0.404-1.896-0.392-1.06-0.2-2.383-0.435-2.228-0.361-2.619-0.475-0.576-0.809z"/>
- <path fill="#666" d="m166.814 72.44c0.992-0.151 2.234-0.005 4.14 0.83 1.159 0.508 0.677 0.582-1.281 0.183-1.883-0.383-0.987-0.174-2.276-0.4-2.183-0.346-2.566-0.325-0.583-0.613z"/>
- </g>
- <g transform="translate(-12.4048,10.0005)">
- <path fill="#666" d="m159.99 128.249c-9.36 0.36-24.192-25.848-24.552-14.976-0.288 9.216 0.216 9.072 0.216 18 0 5.976-2.736 6.408-8.64 15.408-3.024 4.752-5.4 9.864-7.272 15.048-1.152 3.096-2.232 6.336-3.096 9.504-0.36 1.584-1.008 3.24-1.368 4.824-2.952 10.872-13.464 24.264-15.912 35.136-2.448 10.8-5.328 17.712-4.968 32.185 0.36 14.472 0.504 10.295 4.896 13.896 4.32 3.601 8.784 6.983 15.624 13.032 7.2 6.264 22.177 17.208 24.192 20.592 2.16 3.456 2.088 11.232 0.792 13.752-1.296 2.448-12.6 3.816-12.528 3.816-0.071 0 9.864 13.68 11.809 15.623 1.872 1.873 9.936 10.873 42.768 4.752 18.504-3.455 32.832-13.823 43.2-23.832 13.392-13.031 6.624-16.775 8.352-23.327 2.521-9.433 10.729-12.96 12.601-23.616 0.216-1.512 0.72-2.664 2.088-4.896 2.088-3.168 1.584-9.432 1.584-15.191 0-14.977-1.729-30.24-5.185-41.472-3.168-10.512-8.208-17.856-12.527-27.36-8.641-18.936-8.208-27.432-15.912-39.528-8.784-13.968-4.464-23.256-16.128-22.68-14.546 0.79-26.282 20.734-40.034 21.31z"/>
- <path fill="#6d6d6d" d="m159.973 129.334c-9.281 0.353-23.746-25.511-24.242-15.179-0.316 8.755 0.1 8.678 0.03 17.247-0.15 5.87-2.953 6.637-8.727 15.481-3.013 4.763-5.273 9.812-6.993 14.877-0.968 3.253-1.56 6.422-2.43 9.526-0.415 1.642-1.497 3.187-2.185 5.042-3.254 10.78-13.545 24.182-15.961 34.877-2.466 10.81-5.37 17.694-4.961 32.141 0.366 14 0.395 10.177 4.773 13.816 4.283 3.616 8.839 7.069 15.662 13.103 7.183 6.248 22.237 17.216 24.243 20.588 2.149 3.444 2.131 11.317 0.844 13.823-1.284 2.439-12.579 3.875-12.508 3.875-0.071 0 9.815 13.566 11.757 15.508 1.87 1.87 9.902 10.809 42.678 4.704 18.524-3.455 33.124-13.753 43.078-23.856 12.789-12.762 6.107-16.773 7.826-23.291 2.513-9.416 11.277-12.961 13.143-23.602 0.216-1.508 0.754-2.654 2.113-4.876 2.096-3.202 1.561-9.447 1.582-15.185 0.067-15.027-1.705-30.234-5.159-41.434-3.171-10.483-8.204-17.817-12.515-27.305-8.624-18.906-8.221-27.415-15.933-39.474-8.586-13.613-4.601-22.583-16.011-21.99-14.374 0.826-26.375 21.016-40.104 21.584z"/>
- <path fill="#757575" d="m159.955 130.419c-9.201 0.346-23.299-25.175-23.931-15.383-0.344 8.295-0.017 8.284-0.156 16.494-0.301 5.764-3.17 6.867-8.812 15.555-3.002 4.774-5.148 9.76-6.714 14.706-0.784 3.41-0.889 6.508-1.764 9.548-0.471 1.699-1.986 3.133-3.003 5.259-3.554 10.688-13.624 24.1-16.009 34.619-2.483 10.82-5.411 17.678-4.954 32.097 0.373 13.528 0.285 10.058 4.651 13.739 4.244 3.632 8.893 7.154 15.699 13.171 7.167 6.233 22.299 17.224 24.294 20.585 2.142 3.432 2.175 11.404 0.896 13.896-1.271 2.428-12.558 3.932-12.486 3.932-0.071 0 9.768 13.453 11.705 15.392 1.867 1.867 9.867 10.744 42.588 4.655 18.545-3.453 33.415-13.682 42.956-23.879 12.187-12.492 5.591-16.771 7.3-23.258 2.507-9.398 11.826-12.959 13.687-23.586 0.215-1.5 0.788-2.643 2.138-4.854 2.104-3.235 1.538-9.462 1.58-15.178 0.133-15.076-1.681-30.228-5.135-41.394-3.173-10.455-8.199-17.779-12.501-27.25-8.609-18.877-8.234-27.399-15.952-39.42-8.389-13.258-4.739-21.911-15.895-21.301-14.21 0.859-26.474 21.295-40.182 21.855z"/>
- <path fill="#7c7c7c" d="m159.938 131.504c-9.122 0.338-22.854-24.838-23.622-15.586-0.37 7.833-0.131 7.89-0.341 15.741-0.452 5.657-3.388 7.096-8.899 15.628-2.99 4.785-5.021 9.708-6.433 14.535-0.602 3.566-0.218 6.594-1.099 9.57-0.526 1.756-2.475 3.08-3.82 5.477-3.854 10.596-13.703 24.016-16.057 34.361-2.501 10.829-5.453 17.66-4.948 32.052 0.38 13.059 0.177 9.939 4.529 13.66 4.208 3.648 8.948 7.239 15.739 13.242 7.149 6.217 22.358 17.232 24.345 20.581 2.13 3.42 2.216 11.489 0.946 13.968-1.259 2.417-12.538 3.99-12.466 3.99-0.072 0 9.718 13.34 11.653 15.275 1.865 1.864 9.833 10.681 42.498 4.607 18.565-3.453 33.706-13.609 42.834-23.902 11.583-12.223 5.074-16.771 6.774-23.223 2.499-9.382 12.375-12.959 14.229-23.57 0.215-1.496 0.821-2.633 2.162-4.834 2.111-3.271 1.516-9.478 1.578-15.173 0.199-15.125-1.657-30.221-5.109-41.354-3.177-10.427-8.196-17.741-12.488-27.195-8.594-18.848-8.247-27.383-15.972-39.366-8.192-12.903-4.877-21.239-15.779-20.612-14.041 0.894-26.569 21.576-40.254 22.128z"/>
- <path fill="#848484" d="m159.921 132.589c-9.043 0.331-22.406-24.502-23.312-15.79-0.398 7.373-0.247 7.496-0.527 14.988-0.602 5.551-3.604 7.326-8.984 15.702-2.98 4.796-4.896 9.656-6.154 14.364-0.417 3.723 0.455 6.679-0.432 9.592-0.582 1.813-2.964 3.026-4.639 5.694-4.153 10.504-13.782 23.936-16.104 34.104-2.519 10.838-5.495 17.643-4.941 32.008 0.387 12.586 0.067 9.819 4.407 13.582 4.171 3.664 9.002 7.324 15.777 13.311 7.132 6.201 22.419 17.24 24.396 20.576 2.12 3.41 2.259 11.578 0.998 14.041-1.247 2.408-12.517 4.049-12.446 4.049-0.07 0 9.67 13.227 11.604 15.16 1.861 1.861 9.798 10.615 42.409 4.558 18.584-3.45 33.996-13.538 42.711-23.926 10.979-11.952 4.557-16.769 6.248-23.187 2.491-9.367 12.924-12.959 14.771-23.557 0.215-1.49 0.856-2.622 2.188-4.813 2.118-3.305 1.491-9.494 1.575-15.166 0.267-15.174-1.635-30.215-5.086-41.314-3.179-10.399-8.19-17.703-12.473-27.141-8.579-18.818-8.262-27.366-15.994-39.312-7.993-12.547-5.013-20.565-15.661-19.922-13.876 0.927-26.669 21.855-40.331 22.399z"/>
- <path fill="#8c8c8c" d="m159.903 133.674c-8.963 0.323-21.961-24.165-23.001-15.994-0.426 6.912-0.363 7.102-0.713 14.236-0.753 5.445-3.821 7.554-9.071 15.775-2.969 4.807-4.768 9.604-5.875 14.192-0.232 3.881 1.128 6.766 0.234 9.615-0.638 1.87-3.452 2.972-5.455 5.911-4.455 10.413-13.862 23.853-16.153 33.845-2.537 10.849-5.537 17.625-4.935 31.963 0.393 12.115-0.042 9.701 4.285 13.505 4.133 3.68 9.057 7.409 15.814 13.38 7.116 6.188 22.48 17.248 24.447 20.574 2.109 3.398 2.301 11.662 1.049 14.113-1.235 2.396-12.496 4.104-12.425 4.104-0.071 0 9.622 13.114 11.552 15.045 1.86 1.858 9.763 10.552 42.319 4.509 18.604-3.449 34.288-13.467 42.589-23.949 10.377-11 |