diff --git a/CHANGELOG.md b/CHANGELOG.md index c5fad87f..08f89c57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 2.1.1 under development -- no changes in this release. +- New #89: Add method `nofollow()` to the `A` tag (soodssr) ## 2.1.0 September 23, 2021 diff --git a/src/Tag/A.php b/src/Tag/A.php index d4545fb9..4f21328d 100644 --- a/src/Tag/A.php +++ b/src/Tag/A.php @@ -37,6 +37,11 @@ public function mailto(?string $mail): self return $this->href($mail === null ? null : 'mailto:' . $mail); } + public function nofollow(): self + { + return $this->rel('nofollow'); + } + /** * @link https://www.w3.org/TR/html52/links.html#element-attrdef-a-rel */ diff --git a/tests/common/Tag/ATest.php b/tests/common/Tag/ATest.php index 61fbc07c..2acf2db2 100644 --- a/tests/common/Tag/ATest.php +++ b/tests/common/Tag/ATest.php @@ -84,6 +84,11 @@ public function testRel(string $expected, ?string $rel): void $this->assertSame($expected, (string)A::tag()->rel($rel)); } + public function testNofollow(): void + { + $this->assertSame('', (string)A::tag()->nofollow()); + } + public function dataTarget(): array { return [