Commit graph

3 commits

Author SHA1 Message Date
Siddharth VP e1a747987f links: show links in live previews and preserve fragments in links
* Use wikipage.content hook event so that links are also applied on
content added through JS tools like live preview, real time preview,
DiscussionTools, etc. (Consider checking the diff with whitespaces
ignored.)
* Preserve fragments (anchors) in links by using mw.Title getUrl().

Bug: T368166
Change-Id: Ib3a4d03abf7401c39bc3261ca2056cce482edb13
2024-10-13 02:05:02 +05:30
Siddharth VP f455864c7b links: fix JS error due to a missing non-null check
Causing a console error on a COBOL code block on
https://en.wikipedia.org/wiki/Visual_FoxPro.

The optional chaining operator should ideally be used here, too bad
it's ES2020.

Bug: T376958
Change-Id: Id4c604e4897d83cb51218e785db9f553b3f32fda
2024-10-11 17:52:14 +05:30
Siddharth VP 4c9ed25619 Link page references in Scribunto modules
In Scribunto modules, link page names used in require(), mw.loadData()
and mw.loadJsonData() invocations.

Inspired from the CodeLinks gadget[0] but rewritten for brevity,
avoiding Wiktionary specific code, making the code more generic,
and thereby adding support for mw.loadJsonData().

[0]: https://en.wiktionary.org/wiki/MediaWiki:Gadget-CodeLinks.js

Bug: T368166
Change-Id: Idc554269ee52a05660fa41f065a2b3c73e2e1b9b
2024-09-24 22:47:56 +05:30