Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: range error raise if heading level >= 6 (#5373)
Lucas.Xuc67e26617486
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dartindex c8222c5e03..39cd608d0e 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart@@ -92,8 +92,9 @@ Map<String, BlockComponentBuilder> getEditorBuilderMap({final factor = pageStyle.fontLayout.factor;final headingPaddings = pageStyle.lineHeightLayout.headingPaddings.map((e) => e * factor);- final level = node.attributes[HeadingBlockKeys.level] ?? 6;- return EdgeInsets.only(top: headingPaddings.elementAt(level));+ int level = node.attributes[HeadingBlockKeys.level] ?? 6;+ level = level.clamp(1, 6);+ return EdgeInsets.only(top: headingPaddings.elementAt(level - 1));}return const EdgeInsets.only(top: 12.0, bottom: 4.0);