This is still an experimental feature and not deployed
anywhere, but as we mute the timestamp to indicate it
is more part of the interface than the content, we should
do the same with this overflow menu button.
Change-Id: I30391912377692fffa9e67e8c4ca63db715878bf
In certain cases the parser could go back rather than forward after
finding a signature, causing it to find the same signature forever
until it ran out of memory.
Test cases coming later in a separate patch.
Bug: T356884
Change-Id: I8ac72b05e5e4ed45e6119c012a69708c9d8eda29
Follow-up to 8a8c7270cf.
I think this wasn't working becase we were doing it in the wrong
order (reply tool initialization would disable toggling section
state before toggler toggled it open).
Bug: T338920
Change-Id: I7ed3d5c149ddb3d33cb67010f032c63e175687f2
* Keep the information about this in the API result, which we were
previously omitting
* Use it instead of duplicating the logic client-side
Bug: T356131
Change-Id: I7e7342e9d94a171b5ef56e646871c18c8c39c44c
`decodeURI( fragment )` can throw if the fragment isn't correctly
encoded – e.g. when it's just '#%'.
Use mw.util.percentDecodeFragment() instead, which uses a more
resilient algorithm.
Change-Id: I8447771ad2ae33da52b71d4127981dd8a2018a7d
Section titles containing non-ASCII characters were being passed through
URL-encoded, resulting in no results being found.
Bug: T356199
Change-Id: Iac56ee434a37baf3d170aec992d2f2d8679b6f1f
This will be present in parser cache output and can
sometimes be mistaken for user page links.
Bug: T356142
Change-Id: I800b23d8466f72affcadfa336aab07abf7f8d79e
results[ 0 ] would be undefined, causing a later JS error before the
toast could be shown.
Bug: T355165
Change-Id: Ia591a1e4db0acfa377201c355938a32f680393ce
This prevents an exception being thrown if you open the
new topic tool when a reply widget is still loading.
Change-Id: I17da48ddf91394d05cc82613ce5517f1e176750b
Also rename CommentController#teardown to onReplyWidgetTeardown,
and NewTopicController#clear(Storage) to onReplyWidgetClear(Storage).
Change-Id: Ib1dd50ca69aac6f1836674d1a6aefa2402844c57
We shouldn't assume callers of this method have waited
for the replyWidget to be built.
Bug: T354292
Change-Id: Ic66b4f04b8786b07f520e329adda37efcf498dad
Makes the class more similar to PHP. The non-native
ranges exist for efficiency, but users will usually
want native ranges.
Change-Id: Ifd7dd034d2e0f3b9af050ecdab3e063df73dde5e
* Looks for heading IDs matching "h-<heading text>-%" that once
existed on the target page.
* For such IDs, finds where those items currently exist,
presumably in an archive.
Pros:
* Doesn't need to know anything about the local wiki's archiving
conventions, so can be deployed universally.
Cons:
* ID conflicts will return matches in unrelated archives, e.g.
MassMessages.
Bug: T349653
Change-Id: Ie94efd0503e9f4689d3421babe445f9f4e2b4fb7
* The :first-child pseudo-selector to suppress top border of the first
div.ext-discussiontools-init-section ends up suppressing top borders
of all these divs since they are the first child of a <section> tag
in Parsoid's HTML.
Add `.mw-parser-output >` to these selectors, so that they don't apply
when <section> wrappers are present in Parsoid's HTML.
* Re-implement the logic for suppressing top border with new selectors
that work correctly with Parsoid's <section> wrappers.
Note that one of the cases requires using the :has() selector, which
is not supported by all browsers yet. This should not be a big deal
in practice, as that case should be rare on Wikimedia projects.
* This can be reverted if T333031 decides to strip <section> tags
from Parsoid's read view HTML.
Bug: T333031
Bug: T341010
Change-Id: If513c90033e9a77c8885b3b1c937e016064cc5ba
(split off from I5ab9d3373a6911c1456c30d844b66576b278a1b5)
Bug: T13555
Depends-On: I44587461582d648b56ef0c9c7ae0c322895c69c2
Change-Id: Ia32d3b3ac0de2f17401fc1a26c1fe451f273c688
This was being overridden by a later rule that only affected reply
buttons on mobile.
Bug: T351542
Change-Id: Iad2f6b703827cccf46ad5909d11fe3912d7023d5
This was causing a misalignment on mobile pages that loaded the DT
styles but didn't have visual enhancements enabled.
Bug: T351044
Change-Id: Ib5e392943331467c3d29ee2b10d3bbe4995137d0
This requires something like an invalid timestamp, to produce a reply
link whose associated comment ID is going to not be findable.
Bug: T350633
Change-Id: Ib50c11096b9af9961b74309b60524a4b986e04aa
It does the same as before.
I think performance is not a concern here, and wasn't my motivation
either. But I hope this makes the code easier to read and to reason
with.
I added a pure unit test case (without involving an actual Language
object) to cover the previously uncovered digits feature.
Change-Id: I6a0fc86035817eabb42b55e58183ae094c052aa6
I was curious why running the CommentParserTest takes so long. I
found this is one of the bottlenecks because it's called so often,
but many link titles that are parsed as user names turn out to be
something else. This little hack speeds up the test by 15% and has
probably a similar impact in production scenarios.
Change-Id: I5a0b3a49ba5793c8a345baaa7118fed500c082b6