Currently if you combine a valid percent encoding and a non
escaped character that is reserved in urls in a headline, the toc
link does not work. E.g. ==`%41== needs #`%2541 but we currently
generate #`%41 which matches ==`A== instead.
Tested in firefox and chrome
Bug: T238385
Change-Id: Ice2bbf79bed612d488ed6feb7510035e9dfb33af
Adds accessibility context to the automatically generated table
of contents div for a page. The div's role is navigation, and
its label is the heading "Contents".
JAWS, for example, can navigate to the table of contents by
region, and announces it as "Contents navigation region".
Bug: T139221
Change-Id: Ie9b291301f683d2be2cb2134f9d6ae3f7a6d831b
Done:
* Replace LanguageConverter::newConverter by LanguageConverterFactory::getLanguageConverter
* Remove LanguageConverter::newConverter from all subclasses
* Add LanguageConverterFactory integration tests which covers all languages by their code.
* Caching of LanguageConverters in factory
* Make all tests running (hope that's would be enough)
* Uncomment the deprecated functions.
* Rename FakeConverter to TrivialLanguageConverter
* Create ILanguageConverter to have shared ancestor
* Make the LanguageConverter class abstract.
* Create table with mapping between lang code and converter instead of using name convention
* ILanguageConverter @internal
* Clean up code
Change-Id: I0e4d77de0f44e18c19956a1ffd69d30e63cf51bf
Bug: T226833, T243332
The following were the most common cleanups required by switching to tidy:
* Inserting <tbody> in <table> output
* Inserting a space before the closing `/>` in <br>/<link>/<img>/<input> tags
* Entity encoding > and in the output
* Adding `class="mw-empty-elt"` to empty elements in the output, and
preserving some empty elements which the untidy mode's hacky "regex tidy"
would have removed
* Fix `title` attributes in section edit links (seems to have been a bug
in the non-tidy path, but no one noticed because that's not run in
production)
All tests now have a `php+tidy` clause. I've left some `php+untidy`
clauses in place to aid review; it makes it easier to see what tidy
did to the output. Eventually all the untidy clauses will be removed.
Bug: T174199
Bug: T198214
Change-Id: I40363339c615d915a5519650315c1a2682fb9786
Remove the deprecated Preprocessor_DOM class, which was hard-deprecated
in 1.34. This begins to simplify parser configuration and reduce redundant
code paths, but I've left two things for cleanup in a future patch:
1. The `preprocessorClass` configuration option to the parser, exposed
in `$wgParserConf`, ServiceWiring, ParserFactory, etc. There is no reason
for this to be exposed as configurable, but I've left this clean up to a
future patch.
2. The `$wgMaxGeneratedPPNodeCount` configuration, exposed also in
ParserOptions. Only Preprocessor_DOM calculated this count, and since
we are only using Preprocessor_Hash now, this configuration has no effect.
But since this value was exposed in ParserOptions and elsewhere, I've
deprecated where needed but left this clean up to a future patch.
Bug: T204945
Change-Id: I727f003f9a42d0c92bcbcce8a8289d5af6cd1298
This is step 1 of deprecating and then removing tests without a "tidy"
section. We're first adding support for marking test clauses explicitly
as 'untidy'. Then in a subsequent patch we're going to change the
default for otherwise-unmarked tests from 'untidy' to 'tidy'.
Bug: T174199
Bug: T198214
Change-Id: I1e2cbbd46282cb618178662ceaf8b1c36490d546
This now aligns with Parsoid commit ca588b2507926531d1b9c3d4936d641893ec0084
However, "Links 16. Link prefix using unicode \x{...} escapes (T235563)"
was altered (s/1923/Nineteentwentythree/) to account for Postgres not
being able to handle a page_title as an int.
Bug: T239645
Change-Id: I5c4a45d535965353f6b7ef33bfd0b858c91e36a3
* Deprecate WebRequest::checkUrlExtension() and have it always return
true. This reverts the security fixes made for T30235.
* Remove IEUrlExtension. This is a helper for checkUrlExtension() which
is not used in any extensions.
* Remove CSS sanitization code which is specific to IE6. This reverts
the changes made to fix T57332, and related followups. I confirmed
that the relevant test cases do not result in XSS on IE8.
* Remove related tests.
Bug: T232563
Change-Id: I7318ea4a63210252ebc64968691d4f62d79a63e9
I had to write a little test to understand what this loop is supposed
to do: All it really does is counting the number of consecutive empty
lines in the $this->lines array, starting at the offset $this->pos.
The only edge-case is when the array does not contain anything but empty
lines. In this case, the last empty line is skipped. This is because
explode( …, "\n\n\n" ) returns 4 elements, but we want to count the
number of newline characters, which is 3.
Change-Id: I74ae1ed6ba0a8d65a92a1dd07f681fd7ae4221b4
Not only the logic was wrong, it also completely failed to include
the second parameter both in doc comment and exception message,
leading to a lot of confusion.
Change-Id: Icc585214e94c82142ac585c748d1038769cd4db2
The following public methods were renamed and made private; the old name
is hard-deprecated and calls the new renamed private method:
Parser::doMagicLinks() => handleMagicLinks()
Parser::doDoubleUnderscore() => handleMagicLinks()
Parser::doHeadings() => handleHeadings()
Parser::doAllQuotes() => handleAllQuotes()
Parser::replaceExternalLinks() => handleExternalLinks()
Parser::replaceInternalLinks() => handleInternalLinks()
Parser::replaceInternalLinks2() => handleInternalLinks2()
Parser::getVariableValue() => expandMagicVariable()
Parser::initialiseVariables() => initializeVariables()
Parser::formatHeadings() => finalizeHeadings()
Parser::test{Pst,Preprocess,Srvus}() => fuzzTest{Pst,Preprocess,Srvus}()
Additionally, the following methods are not used externally, but are
used outside the Parser class by core code. They have been marked
@internal:
Parser::doQuotes() (used by {{#displaytitle}}),
Parser::getExternalLink{Rel,Attribs}() (used by Linker),
Parser::normalizeLinkUrl() (used by Special:LinkSearch and elsewhere).
Parser::{brace,arg,extension}Substitution() (used by PPFrame)
Code search query:
https://codesearch.wmflabs.org/deployed/?q=do%28MagicLinks%7CDoubleUnderscore%7CHeadings%7CAllQuotes%29%7Creplace%28ExternalLinks%7CInternalLinks%28%7C2%29%29%7CgetVariableValue%7CinitialiseVariables%7CformatHeadings%7Ctest%28Pst%7CPreprocess%7CSrvus%29%7CdoQuotes%7CgetExternalLink%28Rel%7CAttribs%29%7CnormalizeLinkUrl%7C%28brace%2Carg%2Cextension%29Substitution&i=nope&files=&repos=
Bug: T236810
Change-Id: I19a43ffc5dcfdd2981b51079c33422c964acb076
Add public, protected or private to function missing a visibility
Enable the tests folder for the phpcs sniff
Change-Id: Ibefce76ea9984c47e08c94889ea2eafca7565e2c
Not used since cfa70ea6d0. Also not used
by any extensions (WikiEditor and VisualEditor have their own messages).
The message 'sig-text' used to also be part of the old edit toolbar,
but it is currently still used by WikiEditor.
Bug: T224429
Change-Id: I342351aaa2c69b5a7dde865edd38f1f2f94cfb8c
This removes most of the pre-actor user and user_text columns, and the
$wgActorTableSchemaMigrationStage setting that used to determine
whether the columns were used.
rev_user and rev_user_text remain in the code, as on Wikimedia wikis the
revision table is too large to alter at this time. A future change will
combine that with the removal of rev_comment, rev_content_model, and
rev_content_format (and the addition of rev_comment_id and rev_actor).
ActorMigration's constructor continues to take a $stage parameter, and
continues to have the logic for handling it, for the benefit of
extensions that might need their own migration process. Code using
ActorMigration for accessing the core fields should be updated to use
the new actor fields directly. That will be done for in a followup.
Bug: T188327
Change-Id: Id35544b879af1cd708f3efd303fce8d9a1b9eb02
100% test coverage of code that appears to be working and used, in both
LockManagerGroupFactory and also LockManagerGroup. Where possible I
wrote it as unit tests. One preexisting code path seems to be broken and
I marked the test as skipped. Two methods look unused and perhaps not
especially helpful, so I didn't write tests for them yet in case we want
to just get rid of them instead.
Change-Id: Iaa7354f31c451b87773468609c674a3bf1d4382f
This parser test reflects the current behavior of the parser with
filenames containing single quotes. The behavior can changed by future
changes of the parser.
Change-Id: I6dbeb6c1b8ab356d9d4372597957cd0ad01040a2
After I0d7dacee3, wfGetDB returns a connection reference instead of
a real connection, which means it can't be passed to CloneDatabase
anymore, and testcase / test runner classes should avoid it.
Bug: T228928
Change-Id: I42be4214e33a4d4f8d53fafc925c8d708b4c0106
This can be used to avoid double parsed on save if the prior output
can be reused in-spite of involving a self content reference.
Change-Id: Idcd30a3fa3f7012dac76ce8bbf46625453ae331f
The Preprocessor_DOM implementation doesn't interact well with PHP memory
profiling, and has some limitations not present in the Preprocessor_Hash
implementation (see T216664). There is no reason to keep around two
versions of the preprocessor: it just complicates on-going wikitext
feature development.
Hard deprecate use of Preprocessor_DOM, so we can remove the redundant
code in a future release.
Bug: T204945
Depends-On: Id38c9360e4d02b570996dbf7a660f964f02f1a2c
Change-Id: Ica5d1ad5b1e677542962fc36d582a793f941155e