| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* This ensures that when you have query params like (?useparsoid=1),
all cite links no longer take you to the non-Parsoid page but
resolve internally.
* Additionally, this also unbreaks reference previews in local testing
- not yet sure if this will fix all breakage in production.
* We don't have ready access to the title string and so this patch
extracts it from a link tag in the <head> of Parsoid HTML. That is
guaranteed to be correct and reliably present.
But, if in the future, this changes (whether by adding it to
ParserOptions, ParserOutput, or the $opts array), we can use that
directly.
* Added new unit tests that verify the new expectations.
Bug: T358242
Change-Id: Iaf482cc9803564b4cf4ae04f975573f61ff3b0e4
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
This is just a cleanup change. The exception should never happen,
but if it does, this can be reverted.
Change-Id: I26a7c4105d39d83015c09b779a2de3fd1ddacec1
|
|/
|
|
|
|
| |
Move the code to private methods in the only place that needs it.
Change-Id: I7aa038e055adc1aea9faafd17b86e304ee2ca758
|
|
|
|
|
|
| |
Move the code to a private method in the only place that needs it.
Change-Id: Ie68a5324b2c789f44ffc495d05eb6957234cb9c8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow-up to Ibce512b3c4a52f74b2d2124f0159e306f2689ea5.
HEADING_REGEX will now correctly match opening tags when one of the
attributes contains an unencoded > character.
In a better world, this would not use regular expressions. However,
while implementing it as a DOM transformation is easy enough, doing so
causes never-ending test failures due to changes in HTML serialization,
so we gave up on it for now in after discussion on the original patch.
Bug: T358810
Change-Id: Ibad4b29a988c2a4911ebe6512791042c46dd1a9b
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Discussion Tools runs *before* this stage runs, and so we end up
wrapping headings which have already been wrapped by discussion tools.
Check for an existing wrapper to avoid this.
In the future, we will probably add a new post-cache transform hook
which is at the very *end* of the pipeline, instead of in the middle,
to avoid this sort of ordering dependency between extensions and core.
Bug: T357826
Change-Id: I8cd28a3b42e55844be1258d639e605862952806f
|
|
|
|
|
|
|
|
| |
Bug: T166010
Co-Authored-By: Daimona Eaytoy <daimona.wiki@gmail.com>
Co-Authored-By: James Forrester <jforrester@wikimedia.org>
Co-Authored-By: Subramanya Sastry <ssastry@wikimedia.org>
Change-Id: I79b4e732c45095eedbaa80afa5eb7479b387ed8a
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I realized that this code path is also triggered by a special page
transclusion that outputs headings, e.g. `{{Special:RecentChanges}}`.
It doesn't seem worth it to try to handle all these cases distinctly.
Follow-up to b26db1f866c1f18d4e12466ccf191e7c65aa870d.
Change-Id: I389ea9210fcc184f41b6731409331dbd3d34d2ca
|
| |
| |
| |
| |
| | |
Bug: T269630
Change-Id: I9d5fb6348609642ad94743cc5dae81ce608be99d
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was formerly used by the REST api, but instead that code just
uses ParserOutput::getRawText() when it needs the full HTML document.
This option has been broken, with various passes like RenderDebugInfo
and AddWrapperDiv adding content in inappropriate places if
bodyContentOnly was false.
Change-Id: Ib45f95ded59c81c16d61803f977d1edbfe82b262
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make ContentDOMTransformStage handle Parsoid markup with PageBundle
information embedded in the ParserOutput.
Much of the complexity of this code should move to either Parsoid's
ContentUtils or else into the HtmlHolder abstraction (T347062).
Change-Id: Ib35ae38d84adc7df613d4c7de8930ed80e535634
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| | |
Bug: T353458
Change-Id: I088cbc53fbcdb974e5b05b45a62e91709dacc024
|
| |
| |
| |
| |
| | |
Bug: T357573
Change-Id: If80d0df6c927d0f6981ad56d01751f1aeaba83d3
|
|/
|
|
|
|
|
|
|
| |
The resource attribute is used in read views for magnify links and
imagemap description links. See Id46d1b2ab1af3baebff13e10f1485f3cfd9a4b37
and I20130fd39135dfd5074590ee9c2b6e01693384e4
Bug: T357573
Change-Id: I974701ba9eb77e8d0abc894d1091fcdd63b84684
|
|
|
|
|
|
|
|
|
| |
Split off from I4eae18d9d16f54391daba0de82ad05e50f07f9eb for
forward-compatibility, in case that patch needs to be reverted.
See that change for tests and explanation.
Bug: T13555
Change-Id: Ibce512b3c4a52f74b2d2124f0159e306f2689ea5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will allow the Translate extension to set this parser option
in the ArticleParserOptions hook, instead of mutating $options passed
to ParserOutput::getText() in the ParserOutputPostCacheTransform hook.
It ought to also help to handle the many places which call:
... = $parserOutput->getText( [
'enableSectionEditLinks' => false,
] );
by allowing them to set the appropriate ParserOption instead
of passing arguments to ::getText().
Bug: T350626
Change-Id: I719c115194059060f7f888608417a194ac80cc92
|
|
|
|
|
| |
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
|
|
|
|
|
|
|
| |
Follow-up to I53551ec6d6471569709c71c1155729e550f64de8.
Bug: T348253
Change-Id: Ia08624a6770070313bf8bbaa11df29e4ed30b73b
|
|
|
|
|
|
|
|
| |
It was using Mediawiki not MediaWiki
Follows-Up: Ibc46c34072eadb3e84f69df49a3a424f3864c952
Follows-Up: I53551ec6d6471569709c71c1155729e550f64de8
Change-Id: Ia37a6330d64c3179d7abc12ec3f6fc7daca2e371
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 82da9cf14be08e9458f58fa96be51966a2fe7cb1.
Passing through Remex seems to have unexpected consequences to be
investigated but, for the sake of unbreaking the UBN, let's revert this
first.
Bug: T353920
Change-Id: Iaac7942aa77aee5ab525852ac5b41dd516ff13c9
|
|
|
|
|
|
|
| |
Follow-up to a3f51c732d5d2d24ac205c0855df1e78abafb421.
Bug: T353793
Change-Id: I9a3ce95629ca0b75865ec375c9ad5734510952f8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous implementation was using an ad-hoc regular expression which
was matching inside the data-mw attribute of Parsoid output, eg:
<sup about="#mwt42" [...] typeof="mw:Extension/ref mw:Error" data-mw="{"name":"ref","attrs":{"name":"infobox_stats_ref_rail"},"body":{"html":"<style data-mw-deduplicate=\"TemplateStyles:r1133582631\" typeof=\"...">
After substitution, the <link> element inserted contained " instead of
" and so broke out of the attribute.
Instead use a proper HTML tokenizer (via wikimedia/remex-html) so that
we don't allow bogus matches inside attribute values.
To fix up tests:
* Don't deduplicate styles when parsing UX messages (also helps performance)
* Don't deduplicate styles in ContentHandler integration tests
* Don't deduplicate styles by default in parser tests
(unless explicit option is set)
Depends-On: Id9801a9ff540bd818a32bc6fa35c48a9cff12d3a
Depends-On: I5111f1fdb7140948b82113adbc774af286174ab3
Followup-To: Ic0b17e361bf6eb0e71c498abc17f5f67f82318f8
Change-Id: I32d3d1772243c3819e1e1486351d16871b6e21c4
|
|
|
|
|
|
|
| |
Most used non-namespaced class!
Bug: T353458
Change-Id: I4c2cbb0a808b3881a4d6ca489eee5d8c8ebf26cf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OutputPage::getParserOutputText/addParserOutputContent expects
ParserOutput to be mutated (e.g. by
PostCacheTransformHookRunner). Hence, cloning it before running the
pipeline is breaking DiscussionTools, probably among others.
Suppress the clone for the case where the output pipeline is invoked
from ParserOutput::getText() (which is a deprecated method anyway) and
additionally suppress the side-effects to ParserOutput::$mText on that
code path.
Bug: T353257
Co-Authored-By: C. Scott Ananian <cananian@wikimedia.org>
Co-Authored-By: Isabelle Hurbain-Palatin <ihurbainpalatin@wikimedia.org>
Change-Id: I85c690fd37b781cb27c21970467639e852113b2a
|
|
|
|
|
|
|
| |
Changes to the use statements done automatically via script
Addition of missing use statements and changes to docs done manually
Change-Id: I443aada1c18c8628b02671aa9fd6f441961e5c2e
|
|
|
|
|
|
|
|
|
| |
This subclass is used for transformations that apply to the DOM tree.
For now, we load the document from the string in ParserOutput and store
it back; ultimately, this will be replaced by a direct access to the DOM
content of the ContentHolder/HtmlHolder.
Change-Id: Ibc46c34072eadb3e84f69df49a3a424f3864c952
|
|
Bug: T348253
Change-Id: I53551ec6d6471569709c71c1155729e550f64de8
|