Commit graph

6 commits

Author SHA1 Message Date
Bartosz Dziewoński
2f9383b270 diff: Avoid Phan warning with some Wikidiff2 versions
Something changed in WMF CI config that causes this warning to be
emitted, perhaps T397429#11035011.

Change-Id: Ib477c1812c48a96b252a4f687e09f1ca5c30c2f3
(cherry picked from commit 4b5fc06c5e34b0a9332c9228ac3c28fd0f750c6c)
2025-07-25 17:18:53 +00:00
Sam Wilson
3e1c6b74f5 diff: Change order of inline diff legend elements
To match the order that's used within the diff (deleted followed
by inserted).

Bug: T357150
Change-Id: I80dd954e8bfb699280dcf5791cc16e153b291e17
2024-02-15 12:59:19 +08:00
MusikAnimal
02e7fdb26a diffs: add line number headings to inline diffs
Adds new regex in BaseTextDiffer::localizeLineNumbers() to work with
wikidiff2 inline diffs as well as table diffs.

Since there are no "columns" in inline mode, we have a new message to
indicate how the line numbers changed from the old diff versus the new.

Deprecate DifferenceEngine::localiseLineNumbers() as no longer used and
redundant to BaseTextDiffer::localizeLineNumbers().

Bug: T346460
Change-Id: I7b195879b677e2242ad73070fe19ad82121576a8
2023-10-09 22:53:14 -04:00
Tim Starling
7887b66ade Include $wgWikidiff2Options in the diff cache key
Bug: T341754
Change-Id: I3b7d71f811d7ebd0cf83273164c479762e1a680b
2023-08-23 10:00:47 +10:00
Tim Starling
2ed4e600b4 Add support for wikidiff2_multi_format_diff()
Bug: T341754
Change-Id: I17396985d0b26516a06df17e9bd1343054521e01
2023-07-19 12:38:18 +10:00
Tim Starling
2aa87cdf2c Factor out TextDiffer hierarchy from TextSlotDiffRenderer
* Follow the TODO comment in TextSlotDiffRenderer
  ::getTextDiffInternal() by moving the code out to three parallel
  implementations, namely ExternalTextDiffer, PhpTextDiffer and
  Wikidiff2TextDiffer.
* Add a container/factory class ManifoldTextDiffer to glue them
  together and collate available formats.
* Move the inline legend to Wikidiff2TextDiffer. Not the toggle since
  the ability to toggle depends on the available format, not the current
  format.
* Update the diff cache keys so that ManifoldTextDiffer can store the
  engine=>format map it used to generate the diff.
* Drop support for the second parameter to TextSlotDiffRenderer
 ::setEngine(), since nothing used it anymore.
* Provide a format batch API, since some engines are able to efficiently
  generate multiple formats. This might be used by DifferenceEngine in
  future.

Needs risky change notification for the cache key change.

Bug: T339184
Depends-On: I8a35b9b8ec1622c9a36d2496bdd24f51bc52c85f
Change-Id: I5c506e39162855aff53dd420dd8145156739059c
2023-07-19 12:38:18 +10:00