Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ _Changes to the realtime compiler requires an update to v4.5 or later of the `hy
- for now removed features.

### Fixed
- Fixed Markdown syntax being displayed in the sidebar table of contents in https://github.com/hydephp/develop/pull/2607
- Fixed Markdown-to-plain-text conversion consuming unrelated content after ATX headings and stripping literal trailing hashes in https://github.com/hydephp/develop/pull/2590
- Improved documentation page detection in MarkdownService so it works for child classes in https://github.com/hydephp/develop/pull/2332
- Fixed bug causing build manifest to not generate when a site has dynamic pages in https://github.com/hydephp/develop/pull/2450
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected function isHeadingWithinBounds(array $heading): bool
protected function createTableItem(array $heading): array
{
return [
'title' => $heading['title'],
'title' => (new ConvertsMarkdownToPlainText($heading['title']))->execute(),
'identifier' => $heading['identifier'],
'children' => [],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ public function testNonHeadingMarkdownIsIgnored()
);
}

public function testMarkdownIsStrippedFromHeadingTitles()
{
$markdown = '## To learn more, head over to the [Quickstart page](quickstart).';

$this->assertSame([
[
'title' => 'To learn more, head over to the Quickstart page.',
'identifier' => 'to-learn-more-head-over-to-the-quickstart-pagequickstart',
'children' => [],
],
], (new GeneratesTableOfContents($markdown))->execute());
}

public function testWithNoLevelOneHeading()
{
$markdown = <<<'MARKDOWN'
Expand Down
Loading