Skip to content

Commit 6b9846a

Browse files
committed
refactor: ignore confluence userlink
1 parent 4cc6092 commit 6b9846a

File tree

5 files changed

+61
-8
lines changed

5 files changed

+61
-8
lines changed

.git-pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh
2+
set -e
23

34
FILES=$(git diff --diff-filter=d --name-only HEAD | grep '.php$')
45
for file in $FILES; do

tests/Unit/ConfluenceIgnoreHtmlTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,12 @@ public function testIgnoreSpaceContributors()
2222
$newMarkdown = $confluence->htmlFile2Markdown($this->dataDir . 'confluence/space-contributors-demo.html');
2323
$this->assertEquals(trim($markdown), $newMarkdown);
2424
}
25+
26+
public function testIgnoreUserLink()
27+
{
28+
$confluence = new Confluence();
29+
$markdown = file_get_contents($this->dataDir . 'confluence/userlink-demo.md');
30+
$newMarkdown = $confluence->htmlFile2Markdown($this->dataDir . 'confluence/userlink-demo.html');
31+
$this->assertEquals(trim($markdown), $newMarkdown);
32+
}
2533
}

tests/Unit/ConfluenceTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ 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-
3729
public function testParsePagesTree()
3830
{
3931
$document = new DOMDocument();
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>空间 1 : Image Demo</title>
5+
<link rel="stylesheet" href="styles/site.css" type="text/css"/>
6+
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
7+
</head>
8+
9+
<body class="theme-default aui-theme-default">
10+
<div id="page">
11+
<div id="main" class="aui-page-panel">
12+
<div id="main-header">
13+
<div id="breadcrumb-section">
14+
<ol id="breadcrumbs">
15+
<li class="first">
16+
<span><a href="index.html">Demo</a></span>
17+
</li>
18+
<li>
19+
<span><a href="65591.html">Demo</a></span>
20+
</li>
21+
</ol>
22+
</div>
23+
<h1 id="title-heading" class="pagetitle">
24+
<span id="title-text">
25+
空间 1 : Image Demo
26+
</span>
27+
</h1>
28+
</div>
29+
30+
<div id="content" class="view">
31+
<div class="page-metadata">
32+
33+
34+
Created by <span class='author'> admin</span>, last modified on 七月 05, 2021
35+
</div>
36+
<div id="main-content" class="wiki-content group">
37+
<a class="confluence-userlink url fn" data-username="admin" href=""><img class="userLogo logo" src="images/icons/profilepics/default.svg" alt="" title="admin"></a>
38+
<p>world</p>
39+
</div>
40+
41+
</div>
42+
</div>
43+
<div id="footer" role="contentinfo">
44+
<section class="footer-body">
45+
<p>Document generated by Confluence on 七月 05, 2021 18:26</p>
46+
<div id="footer-logo"><a href="http://www.atlassian.com/">Atlassian</a></div>
47+
</section>
48+
</div>
49+
</div>
50+
</body>
51+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
world

0 commit comments

Comments
 (0)