Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions export_wiznotes/collaboration_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,14 @@ def _parse_code_block(self, full_data, block):
if child_id in full_data:
child_data = full_data[child_id]
if isinstance(child_data, list) and child_data:
text_obj = child_data[0]
if 'text' in text_obj and text_obj['text']:
code_lines.append(text_obj['text'][0].get('insert', ''))
else:
code_lines.append('') # 空行
for child in child_data:
text_obj = child
if 'text' in text_obj and text_obj['text']:
code_lines.append(text_obj['text'][0].get('insert', ''))
else:
code_lines.append('') # 空行
else:
code_lines.append('')

code_content = '\n'.join(code_lines)
return f"\n```{language}\n{code_content}\n```\n\n"
Expand Down
2 changes: 1 addition & 1 deletion export_wiznotes/get_folders_and_notes_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def export_wiznotes_structure(config_path=None, export_notes=True):

if __name__ == "__main__":
# 仅导出目录
# export_wiznotes_structure(export_notes=False)
export_wiznotes_structure(export_notes=False)

# 导出目录及笔记清单
export_wiznotes_structure(export_notes=True)