Skip to content

Commit 46c20e7

Browse files
committed
fix: #54 confluence user link
1 parent 9432498 commit 46c20e7

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

app/Confluence.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function htmlFile2Markdown(string $filename): string
4040
'|<span class="confluence-embedded-file-wrapper">.*</span>|',
4141
'|<div class="drop-zone-empty-text">.*</div>|s',
4242
'|<li class="drop-zone-text hidden">.*</li>|s',
43+
'|<a class="confluence-userlink url fn".*</a>|',
4344
'|<img .* src="data:.*/>|',
4445
],
4546
'',

tests/Unit/ConfluenceTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ public function testHtmlFile2Markdown()
2626
$this->assertEquals("你好\n==", $markdown);
2727
}
2828

29+
public function testHtmlFile2MarkdownUserLink()
30+
{
31+
$confluence = new Confluence();
32+
$markdown = file_get_contents($this->dataDir . 'confluence/space1/image-demo_65619.md');
33+
$newMarkdown = $confluence->htmlFile2Markdown($this->dataDir . 'confluence/space1/image-demo_65619.html');
34+
$this->assertEquals(trim($markdown), $newMarkdown);
35+
}
36+
2937
public function testParsePagesTree()
3038
{
3139
$document = new DOMDocument();

0 commit comments

Comments
 (0)