mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02:00
MINOR Making anchors more readable and predictable by using lowercase only
This commit is contained in:
parent
e571b5973f
commit
089c844892
@ -235,6 +235,7 @@ class DocumentationParser {
|
||||
$t = ereg_replace('[^A-Za-z0-9]+','-',$t);
|
||||
$t = ereg_replace('-+','-',$t);
|
||||
$t = trim($t, '-');
|
||||
$t = strtolower($t);
|
||||
|
||||
return $t;
|
||||
}
|
||||
|
@ -104,14 +104,14 @@ HTML;
|
||||
|
||||
*/
|
||||
|
||||
$this->assertContains('# Heading one {#Heading-one}', $result);
|
||||
$this->assertContains('# Heading one {#heading-one}', $result);
|
||||
$this->assertContains('# Heading with custom anchor {#custom-anchor}', $result);
|
||||
$this->assertNotContains('# Heading with custom anchor {#custom-anchor} {#Heading', $result);
|
||||
$this->assertContains('# Heading two {#Heading-two}', $result);
|
||||
$this->assertContains('# Heading three {#Heading-three}', $result);
|
||||
$this->assertContains('## Heading duplicate {#Heading-duplicate}', $result);
|
||||
$this->assertContains('## Heading duplicate {#Heading-duplicate-2}', $result);
|
||||
$this->assertContains('## Heading duplicate {#Heading-duplicate-3}', $result);
|
||||
$this->assertNotContains('# Heading with custom anchor {#custom-anchor} {#heading', $result);
|
||||
$this->assertContains('# Heading two {#heading-two}', $result);
|
||||
$this->assertContains('# Heading three {#heading-three}', $result);
|
||||
$this->assertContains('## Heading duplicate {#heading-duplicate}', $result);
|
||||
$this->assertContains('## Heading duplicate {#heading-duplicate-2}', $result);
|
||||
$this->assertContains('## Heading duplicate {#heading-duplicate-3}', $result);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user