Skip to content

Commit

Permalink
Remove support for custom identifier when it breaks permalinks
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 4, 2024
1 parent 993d369 commit df2d475
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,17 @@ public function testHeadingsWithCustomAttributes()
public function testHeadingsWithCustomAttributesAndPermalinks()
{
$markdown = <<<'MARKDOWN'
## Heading {.custom-class #custom-id}
## Heading {.custom-class}
### Another Heading {data-test="value"}
MARKDOWN;

$html = (new MarkdownService($markdown, DocumentationPage::class))->parse();

$this->assertStringContainsString('id="custom-id"', $html);
$this->assertStringContainsString('class="custom-class"', $html);
$this->assertStringContainsString('data-test="value"', $html);

$this->assertSame(<<<'HTML'
<h2 class="custom-class" id="custom-id">Heading<a id="heading" href="#heading" class="heading-permalink" title="Permalink"></a></h2>
<h2 class="custom-class">Heading<a id="heading" href="#heading" class="heading-permalink" title="Permalink"></a></h2>
<h3 data-test="value">Another Heading<a id="another-heading" href="#another-heading" class="heading-permalink" title="Permalink"></a></h3>

HTML, $html);
Expand Down

0 comments on commit df2d475

Please sign in to comment.