File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -51,16 +51,21 @@ public function htmlFile2Markdown(string $filename): string
51
51
52
52
$ contentElement = $ this ->document ->getElementById ('main-content ' );
53
53
$ divElements = $ contentElement ->getElementsByTagName ('div ' );
54
+ $ needDeleteElements = [];
54
55
foreach ($ divElements as $ divElement ) {
55
56
if (
56
57
in_array ($ divElement ->getAttribute ('class ' ), [
57
58
'recently-updated recently-updated-social ' ,
58
59
'plugin-contributors ' ,
59
60
])
60
61
) {
61
- $ divElement -> parentNode -> parentNode -> removeChild ( $ divElement ->parentNode ) ;
62
+ $ needDeleteElements [] = $ divElement ->parentNode ;
62
63
}
63
64
}
65
+ for ($ i = count ($ needDeleteElements ); $ i > 0 ; $ i --) {
66
+ $ element = $ needDeleteElements [$ i - 1 ];
67
+ $ element ->parentNode ->removeChild ($ element );
68
+ }
64
69
$ html = $ this ->document ->saveHTML ($ contentElement );
65
70
return $ this ->htmlConverter ->convert ($ html );
66
71
}
Original file line number Diff line number Diff line change @@ -101,6 +101,24 @@ <h2 id="首页-Recentspaceactivity">Recent space activity</h2>
101
101
</ div >
102
102
< p > </ p > </ div >
103
103
</ div >
104
+
105
+ < div class ="cell normal " data-type ="normal ">
106
+ < div class ="innerCell ">
107
+ < h2 id ="PDA首页-Spacecontributors "> Space contributors</ h2 > < p >
108
+ </ p > < div class ="plugin-contributors ">
109
+ < ul class ="contributors-list ">
110
+ < li >
111
+ < a href ="http://wiki.pagoda.com.cn/display/~20200921007 "> 张三</ a > (59天以前) </ li >
112
+ < li >
113
+ < a href ="http://wiki.pagoda.com.cn/display/~zhouyi "> 周1</ a > (340天以前) </ li >
114
+ < li >
115
+ < a href ="http://wiki.pagoda.com.cn/display/~weiyi "> 魏1</ a > (428天以前) </ li >
116
+ < li >
117
+ < a href ="http://wiki.pagoda.com.cn/display/~lisi "> 李四</ a > (736天以前) </ li >
118
+ </ ul >
119
+ </ div >
120
+ < p > </ p > </ div >
121
+ </ div >
104
122
< p > Hello World!</ p >
105
123
</ div >
106
124
Original file line number Diff line number Diff line change 3
3
4
4
5
5
6
+
7
+
6
8
Hello World!
You can’t perform that action at this time.
0 commit comments