Skip to content

Commit f2a0ac1

Browse files
committed
修复部分内容页只有一个标题+一空行
1 parent 9de68a3 commit f2a0ac1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

php-the-right-way/make.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def parser_file_name(file_path):
7474
'a': spliters[0],
7575
'b': spliters[1],
7676
'c': spliters[2],
77-
'content': u''.join(content_lines)
77+
'content': u''.join(content_lines),
78+
'content_lines': content_lines
7879
}
7980

8081

@@ -135,11 +136,12 @@ def main():
135136
dir_index += 1
136137
file_index = 1
137138

138-
write_file(cur_dir, u'%04d-%s' % (file_index, title), file_info['content'])
139+
# 内容行数不只是有:一级标题 + 一空行 才当做是一页内容
140+
if len(file_info['content_lines']) > 2 :
141+
write_file(cur_dir, u'%04d-%s' % (file_index, title), file_info['content'])
139142

140143
print('Finish!')
141144

142145

143146
if __name__ == '__main__':
144147
main()
145-

0 commit comments

Comments
 (0)