Page MenuHomePhabricator

pywikibot.Link.astext ignores anchor
Open, Needs TriagePublic

Description

Currently a pywikibot.Link.astext() returns something along the lines of [[site:namespace:title#section]], thus omitting the anchor (the bit after the pipe).

The documentation should either be updated to clarify that anchor is dropped, or the return format should be changed to something like [[site:namespace:title#section|anchor]].

To avoid a breaking change we could introduce a new arg (with_anchor=False) whoch triggers the anchor addition.


This was one of the @TODOs from gerrit:442168

Details