Commit graph

6 commits

Author SHA1 Message Date
Arlo Breault 0c88ab1abd Use Parsoid's extension API's getExternalLinkAttribs
Depends-On: I31a8c6a9bb2741899d5445c3457fd424e283397b
Change-Id: Iaf8531a37e8d9d3ce1bece9ab3086e5967dca08f
2024-03-04 18:00:04 -05:00
Arlo Breault 4d19d19f1d Fix matching external link rel
Introduced in I8d7bdf1bccc869b4dc17058a5822ef34968471e6

Change-Id: I52a8a993fbdd4058d40f4aeac3df37e90e686f3e
2024-02-15 21:24:59 -05:00
Alexander Mashin 754b722c56 Set target to $wgExternalLinkTarget
Set hyperlink 'target' attribute to $wgExternalLinkTarget.

In addition, set the 'rel' attribute according to the
$wgNoFollowLinks, $wgNoFollowDomainExceptions
and $wgNoFollowNsExceptions settings (bug T186241).

Bug: T356730
Change-Id: If4880e4e0b3cd2056521d44baf261ed848511bcd
2024-02-06 16:09:32 +07:00
Subramanya Sastry 66ec96d6b1 ParsoidImageMap: use wfMessage to localize description types
* The previously failing Parsoid test now passes.

Bug: T311523
Depends-On: Id7d9e82ee4ff20a79ba1a5b2433fa29bc5f76e68
Change-Id: I03115b91fd781b72f0bf2c66cb6c18963a772dab
2023-10-09 12:21:35 -05:00
Umherirrender 9b9ef62a4c Remove null fallback from DOMElement::getAttribute
Also set @phan-var to handle nullable parentNode
DOMNode::$parentNode is documented as nullable in php8.1
DOMElement::getAttribute is documented to return string in php8.1
Reported by phan running under php8.1

Change-Id: Ia4abd7bf03bc52d7d4ba2c69738bb90c55d01a2b
2023-10-06 20:08:08 +02:00
Subramanya Sastry d9a7fea019 Move Parsoid implementation of ImageMap from Parsoid repo
* There have been no changes to the code except for:
  - class is now called ParsoidImageMap with a matching file name
  - the namespace is changed to MediaWiki\Extension\ImageMap.
  - adding phan directives to deal with Parsoid's DOM proxies
    which phan doesn't seem to be see here.

* Parsoid's SiteConfig extension registration code simply overwrites
  the extConfig array for a tag name. So, keeping the config and
  implementation identical ensures that no matter which version of
  code is registered (based on load order), we get the same behavior.

* Once this rolls out on the next train, we can remove the code
  from Parsoid.

* Future patches might refactor the two implementations to extract
  common functionality or merge code into a single file.

Change-Id: I6cffa4420d2daa70174fa926d5c7a4d983792969
2023-09-19 16:21:40 -05:00