Download the PHP package mediawiki/alink without Composer
On this page you can find all versions of the php package mediawiki/alink. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mediawiki/alink
More information about mediawiki/alink
Files in mediawiki/alink
Package alink
Short Description Creates custom anchor links
License GPL-3.0-or-later
Homepage https://github.com/SimilisTools/mediawiki-alink
Informations about the package alink
Alink
MediaWiki extension (type: parserhook) that provides two parser functions for rendering raw HTML <a> and <img> tags with full attribute control.
- Version: 0.3.0
- License: GPL-3.0-or-later
- Requires: MediaWiki >= 1.35.0, PHP >= 7.2
- Repository: https://github.com/SimilisTools/mediawiki-alink
Installation
- Clone or extract into
extensions/Alink/. - Add to
LocalSettings.php:
Parser functions
#alink — anchor tag
Allowed attributes: href, rel, target, class, id, content, name, itemprop, and any data-* attribute.
Flags (no = sign):
| Flag | Effect |
|---|---|
nourlencode |
Skip urlencode() on the page name (useful for query strings with special characters) |
noprefix |
Strip namespace prefix from auto-generated link text |
Link text is the bare argument (no =). If omitted, falls back to the href value; with noprefix, falls back to the page title without namespace.
Internal vs external links: if href starts with http://, https://, or ftp://, the value is used as-is. Otherwise it is treated as a wiki page name and resolved through $wgArticlePath.
Examples
External link:
Internal wiki page:
Internal link with special characters in query string (skip URL encoding):
Internal link, display title without namespace:
With data-* attribute:
#aimg — image tag
Allowed attributes: src, rel, title, alt, class, id, content, itemprop, and any data-* attribute.
If src does not start with a recognized protocol, it is treated as a MediaWiki file name and resolved to its full URL via wfFindFile(). If the file does not exist in the wiki, src is left unchanged.
Examples
External image:
Wiki-hosted file:
Development
Install dependencies:
Lint (syntax check + executable-bit check):
Fix executable bits:
PHP CodeSniffer (requires mediawiki/mediawiki-codesniffer installed separately):
There are no automated unit tests. Manual testing requires a running MediaWiki instance with the extension loaded.
Notes
- Output is passed through
$parser->insertStripItem()to prevent further wiki parsing of the raw HTML. - Using raw
<a>tags bypasses MediaWiki's link tracking (incoming/outgoing links are not recorded in the database). Use standard wikitext links when link tracking matters.