As stated in the doc it is possible to choose to replace only the link (just type the number) or replace both link and link-text (type 'r' followed by the number) but the 'r' command does not work as expected.
See this difflink where [[7 World Trade Center (alt)|7 World Trade Center]] was changed to [[World Trade Center 7|7 World Trade Center]] but the 'r' command was specified and [[World Trade Center 7]] was expected.
Description
Description
Details
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
[IMPR] Add [f]orce option to force link as visual content | pywikibot/core | master | +10 -3 |
Related Objects
Related Objects
- Mentioned Here
- T124016: solve_disambiguation.py - [r]eplace option
Event Timeline
Comment Actions
The 'r' does not work if the visual content differs from the link i.e. the link is labeled. One idea to solve it is replacing
# we want to throw away the original link text replaceit = link_text == page_title
with
# we want to throw away the original link text bracketless_link = pywikibot.Page(self.current_page.site, link_text) replaceit = bracketless_link.title( without_brackets=True) == page_title
to remove the bracket extenson of the title.
Another way would be a force option to take the new link for the visual content.
Comment Actions
Change 491714 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] Add [f]orce option to force link as visual content
Comment Actions
Change 491714 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [IMPR] Add [f]orce option to force link as visual content
This comment was removed by Pppery.