Skip to content

Commit 8f7ef0f

Browse files
committed
Passing the file on to the header for the permalinks.
1 parent 2c7239f commit 8f7ef0f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/DocParser.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ class DocParser
1919

2020
private string $html;
2121

22+
private DocFile $file;
23+
2224
public function __construct(DocFile $file)
2325
{
2426
$parse = new ParsedownExtra();
2527

2628
$text = FileHelper::readContents($file->getPath());
2729
$text = $this->parseListStyles($text);
2830

31+
$this->file = $file;
2932
$this->html = strval($parse->text($text));
3033

3134
$this->parseHeaders();
@@ -94,7 +97,7 @@ private function parseHeaders() : void
9497

9598
$active[$level] = $header;
9699

97-
$this->html = $header->replace($this->html);
100+
$this->html = $header->replace($this->html, $this->file);
98101

99102
if($level === 1) {
100103
$this->headers[] = $header;

0 commit comments

Comments
 (0)