[anchor] bbcode tag, to make linking to parts of a page easier

This commit is contained in:
Shish
2014-08-24 16:55:00 +01:00
parent b1d634a8de
commit 9c71f59061
2 changed files with 8 additions and 0 deletions

View File

@ -71,6 +71,12 @@ class BBCodeUnitTest extends UnitTestCase {
"<a href=\"mailto:spam@shishnet.org\">spam@shishnet.org</a>");
}
public function testAnchor() {
$this->assertEqual(
$this->filter("[anchor=rules]Rules[/anchor]"),
"<a name=\"bb-rules\">Rules</a>");
}
private function filter($in) {
$bb = new BBCode();
return $bb->format($in);