[PR #1166] [MERGED] Implement code block feature for appflowy editor #4571

Closed
opened 2026-03-23 21:38:24 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/1166
Author: @LucasXu0
Created: 9/26/2022
Status: Merged
Merged: 9/27/2022
Merged by: @LucasXu0

Base: mainHead: code_block


📝 Commits (8)

  • 49fb047 fix: should not notify the parent node when the subtype is not changed
  • ec97735 fix: prevent to copy the style in some cases when pressing the enter key in the front of the text
  • 2d32e02 feat: tab for 4 spaces
  • ff9cf90 feat: implement simple code block
  • 5421c15 fix: tab & enter test
  • 31ba12d fix: disable built-in toolbar items for non-built-in widget
  • 86a6f58 chore: revert the example.json
  • af87791 feat: add auto detect language and remove the unused package

📊 Changes

13 files changed (+370 additions, -38 deletions)

View changed files

📝 frontend/app_flowy/packages/appflowy_editor/example/lib/main.dart (+9 -0)
frontend/app_flowy/packages/appflowy_editor/example/lib/plugin/code_block_node_widget.dart (+277 -0)
📝 frontend/app_flowy/packages/appflowy_editor/example/pubspec.yaml (+1 -0)
📝 frontend/app_flowy/packages/appflowy_editor/lib/appflowy_editor.dart (+4 -0)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/document/node.dart (+4 -2)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/render/toolbar/toolbar_item.dart (+17 -9)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/service/editor_service.dart (+1 -1)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/enter_without_shift_in_text_node_handler.dart (+8 -1)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/tab_handler.dart (+10 -3)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/service/keyboard_service.dart (+2 -0)
📝 frontend/app_flowy/packages/appflowy_editor/lib/src/service/toolbar_service.dart (+5 -7)
📝 frontend/app_flowy/packages/appflowy_editor/test/service/internal_key_event_handlers/enter_without_shift_in_text_node_handler_test.dart (+20 -7)
📝 frontend/app_flowy/packages/appflowy_editor/test/service/internal_key_event_handlers/tab_handler_test.dart (+12 -8)

📄 Description

No description provided


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/1166 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 9/26/2022 **Status:** ✅ Merged **Merged:** 9/27/2022 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `code_block` --- ### 📝 Commits (8) - [`49fb047`](https://github.com/AppFlowy-IO/AppFlowy/commit/49fb0470ab70a89c8a1104278be96c3322cd250d) fix: should not notify the parent node when the subtype is not changed - [`ec97735`](https://github.com/AppFlowy-IO/AppFlowy/commit/ec97735e947217e9d1fda9abb134fbe825cf492d) fix: prevent to copy the style in some cases when pressing the enter key in the front of the text - [`2d32e02`](https://github.com/AppFlowy-IO/AppFlowy/commit/2d32e02dba110e6a207b7fd13465a13f0cc582d8) feat: tab for 4 spaces - [`ff9cf90`](https://github.com/AppFlowy-IO/AppFlowy/commit/ff9cf905fae7c89832fc79eda85c1b7a1d2da087) feat: implement simple code block - [`5421c15`](https://github.com/AppFlowy-IO/AppFlowy/commit/5421c156c3a7c6712aef50bcc2656ab46b4b1ca6) fix: tab & enter test - [`31ba12d`](https://github.com/AppFlowy-IO/AppFlowy/commit/31ba12d289e8c737b8a340a11168b7af528ddeb3) fix: disable built-in toolbar items for non-built-in widget - [`86a6f58`](https://github.com/AppFlowy-IO/AppFlowy/commit/86a6f5827d045bfde2b50f8cabf67892316a0ca4) chore: revert the example.json - [`af87791`](https://github.com/AppFlowy-IO/AppFlowy/commit/af877913d7e892ab741d35f98d1130cc78c8aed9) feat: add auto detect language and remove the unused package ### 📊 Changes **13 files changed** (+370 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `frontend/app_flowy/packages/appflowy_editor/example/lib/main.dart` (+9 -0) ➕ `frontend/app_flowy/packages/appflowy_editor/example/lib/plugin/code_block_node_widget.dart` (+277 -0) 📝 `frontend/app_flowy/packages/appflowy_editor/example/pubspec.yaml` (+1 -0) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/appflowy_editor.dart` (+4 -0) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/document/node.dart` (+4 -2) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/render/toolbar/toolbar_item.dart` (+17 -9) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/service/editor_service.dart` (+1 -1) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/enter_without_shift_in_text_node_handler.dart` (+8 -1) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/service/internal_key_event_handlers/tab_handler.dart` (+10 -3) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/service/keyboard_service.dart` (+2 -0) 📝 `frontend/app_flowy/packages/appflowy_editor/lib/src/service/toolbar_service.dart` (+5 -7) 📝 `frontend/app_flowy/packages/appflowy_editor/test/service/internal_key_event_handlers/enter_without_shift_in_text_node_handler_test.dart` (+20 -7) 📝 `frontend/app_flowy/packages/appflowy_editor/test/service/internal_key_event_handlers/tab_handler_test.dart` (+12 -8) </details> ### 📄 Description _No description provided_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 21:38:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#4571
No description provided.