src/Parser.php
/**
     * Adds an anchor link to the given HTML tag match.
     *
     * @param array $match The thing to match.
     * @return string
     */
Adds an anchor link to the given HTML tag match.
@param array $match The thing to match.
@return string
Adds an anchor link to the given HTML tag match . @param array $match The thing to match . @return string
private function _addAnchorToTagMatch($match): string
    {
        $anchorName = $this->generateAnchorName($match[3]);
        $heading = strip_tags(str_replace(['&nbsp;', ' '], ' ', $match[3]));
        return '<a'.($this->anchorClass ? ' class="'.$this->anchorClass.'"' : '').' name="'.$anchorName.'"></a>'.
            '<'.$match[1].$match[2].'>'.
            $match[3].
            ' <a'.($this->anchorLinkClass ? ' class="'.$this->anchorLinkClass.'"' : '').' href="#'.$anchorName.'" title="'.Craft::t('anchors', $this->anchorLinkTitleText, ['heading' => $heading]).'">'.$this->anchorLinkText.'</a>'.
            '</'.$match[1].'>';
    }
private function _addAnchorToTagMatch ( $ match ) : string { $ anchorName = $ this -> generateAnchorName ( $ match [ 3 ] ) ; $ heading = strip_tags ( str_replace ( [ '&nbsp;' , ' '] ,  ', m atch[ 3 ] ) ) ; return '<a' . ( $ this -> anchorClass ? ' class="' . $ this -> anchorClass . '"' : '' ) . ' name="' . $ anchorName . '"></a>' . '<' . $ match [ 1 ] . $ match [ 2 ] . '>' . $ match [ 3 ] . ' <a' . ( $ this -> anchorLinkClass ? ' class="' . $ this -> anchorLinkClass . '"' : '' ) . ' href="#' . $ anchorName . '" title="' . Craft :: t ( 'anchors' , $ this -> anchorLinkTitleText , [ 'heading' => $ heading ] ) . '">' . $ this -> anchorLinkText . '</a>' . '</' . $ match [ 1 ] . '>' ; }
Adds an anchor link to the given HTML tag match.
Adds an anchor link to the given HTML tag match .