Page MenuHomeWickedGov Phorge

ParsoidAnchorFormatter.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

ParsoidAnchorFormatter.php

<?php
declare( strict_types = 1 );
namespace Cite\Parsoid;
use Cite\AnchorFormatter;
/**
* Contains small pieces of additional knowledge that is specific to the Parsoid implementation and
* doesn't belong to the generic {@see AnchorFormatter}.
*
* @license GPL-2.0-or-later
*/
class ParsoidAnchorFormatter {
/**
* The clickable href="#…" link and id="…" target to jump from a footnote marker in the article
* down to the corresponding "note" item in the reference list.
*/
public static function getNoteIdentifier( RefGroupItem $ref ): string {
return AnchorFormatter::getNoteIdentifier( $ref->name, $ref->globalId );
}
/**
* Identifier for the inner <span class="mw-reference-text"> node.
*/
public static function getNoteTextIdentifier( RefGroupItem $ref ): string {
return AnchorFormatter::getNoteTextIdentifier( $ref->name, $ref->globalId );
}
/**
* The clickable href="#…" backlink and id="…" target to jump from the reference list back up to
* one of the possibly many footnote markers in the article.
*/
public static function getBackLinkIdentifier( RefGroupItem $ref, ?int $count = null ): string {
return AnchorFormatter::getBackLinkIdentifier( $ref->name, $ref->globalId,
$count ?? $ref->visibleNodes );
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 23:01 (1 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fd/21/d3bddfd597c9e01e1633743dcf59
Default Alt Text
ParsoidAnchorFormatter.php (1 KB)

Event Timeline