diff --git a/export_wiznotes/collaboration_parser.py b/export_wiznotes/collaboration_parser.py index 5ea1cd4..f9b2946 100644 --- a/export_wiznotes/collaboration_parser.py +++ b/export_wiznotes/collaboration_parser.py @@ -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" diff --git a/export_wiznotes/get_folders_and_notes_list.py b/export_wiznotes/get_folders_and_notes_list.py index 1f7460a..5268f9e 100644 --- a/export_wiznotes/get_folders_and_notes_list.py +++ b/export_wiznotes/get_folders_and_notes_list.py @@ -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)