parent
289aed8420
commit
cb17590b71
|
@ -143,17 +143,17 @@ class DocParser
|
|||
}
|
||||
$path[] = $title;
|
||||
$id = implode('-', $path);
|
||||
$nofollow = true;
|
||||
$noFollow = true;
|
||||
} else {
|
||||
$nofollow = false;
|
||||
$noFollow = false;
|
||||
}
|
||||
if ($stack->isEmpty()) {
|
||||
$chapterId = $id;
|
||||
$section = new Section($id, $title, $level, $nofollow, $chapterId);
|
||||
$section = new Section($id, $title, $level, $noFollow, $chapterId);
|
||||
$tree->addRoot($section);
|
||||
} else {
|
||||
$chapterId = $stack->bottom()->getId();
|
||||
$section = new Section($id, $title, $level, $nofollow, $chapterId);
|
||||
$section = new Section($id, $title, $level, $noFollow, $chapterId);
|
||||
$tree->addChild($section, $stack->top());
|
||||
}
|
||||
$stack->push($section);
|
||||
|
|
|
@ -37,7 +37,7 @@ class Section implements Identifiable
|
|||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $nofollow;
|
||||
protected $noFollow;
|
||||
|
||||
/**
|
||||
* The ID of the chapter the section is part of
|
||||
|
@ -59,15 +59,15 @@ class Section implements Identifiable
|
|||
* @param string $id The ID of the section
|
||||
* @param string $title The title of the section
|
||||
* @param int $level The header level
|
||||
* @param bool $nofollow Whether to instruct search engines to not index the link to the section
|
||||
* @param bool $noFollow Whether to instruct search engines to not index the link to the section
|
||||
* @param string $chapterId The ID of the chapter the section is part of
|
||||
*/
|
||||
public function __construct($id, $title, $level, $nofollow, $chapterId)
|
||||
public function __construct($id, $title, $level, $noFollow, $chapterId)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->title = $title;
|
||||
$this->level = $level;
|
||||
$this->nofollow = $nofollow;
|
||||
$this->noFollow = $noFollow;
|
||||
$this->chapterId= $chapterId;
|
||||
}
|
||||
|
||||
|
@ -106,9 +106,9 @@ class Section implements Identifiable
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isNofollow()
|
||||
public function isNoFollow()
|
||||
{
|
||||
return $this->nofollow;
|
||||
return $this->noFollow;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,7 +69,7 @@ class Callback
|
|||
return sprintf(
|
||||
'<a %s%shref="%s"',
|
||||
strlen($match['attribs']) ? trim($match['attribs']) . ' ' : '',
|
||||
$section->isNofollow() ? 'rel="nofollow" ' : '',
|
||||
$section->isNoFollow() ? 'rel="nofollow" ' : '',
|
||||
$url->getAbsoluteUrl()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class TocRenderer extends Renderer
|
|||
$url->setAnchor($this->encodeAnchor($section->getId()));
|
||||
$this->content[] = sprintf(
|
||||
'<li><a %shref="%s">%s</a>',
|
||||
$section->isNofollow() ? 'rel="nofollow" ' : '',
|
||||
$section->isNoFollow() ? 'rel="nofollow" ' : '',
|
||||
$url->getAbsoluteUrl(),
|
||||
$view->escape($section->getTitle())
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue