AppFlowy Editor is a highly customizable rich-text editor
Here is an example your you can give a try
Span element
Span element two
Span element three
This is a quote!
Code block
Italic one
Italic two
Bold tag
You can also use AppFlowy Editor as a component to build your own app.
If you have questions or feedback, please submit an issue on Github or join the community along with 1000+ builders!
'''; +const htmlTable = + ''''a | c |
b | d |
In case you were wondering what the black box at the bottom is – it's the debug view, showing the current state of the editor. You can disable it by pressing on the settings control in the bottom-left of your screen and toggling the debug view setting. The playground is a demo environment built with @lexical/react
. Try typing in some text with different formats.
Make sure to check out the various plugins in the toolbar. You can also use #hashtags or @-mentions too!
If you'd like to find out more about Lexical, you can:
Lastly, we're constantly adding cool new features to this playground. So make sure you check back here when you next get a chance 🙂.
'''; @@ -303,9 +428,9 @@ const nestedDelta = { 'data': { 'level': 1, 'delta': [ - {'insert': 'Welcome to the playground'} - ] - } + {'insert': 'Welcome to the playground'}, + ], + }, }, { 'type': 'quote', @@ -313,11 +438,11 @@ const nestedDelta = { 'delta': [ { 'insert': - 'In case you were wondering what the black box at the bottom is – it\'s the debug view, showing the current state of the editor. You can disable it by pressing on the settings control in the bottom-left of your screen and toggling the debug view setting. The playground is a demo environment built with ' + 'In case you were wondering what the black box at the bottom is – it\'s the debug view, showing the current state of the editor. You can disable it by pressing on the settings control in the bottom-left of your screen and toggling the debug view setting. The playground is a demo environment built with ', }, { 'insert': '@lexical/react', - 'attributes': {'code': true} + 'attributes': {'code': true}, }, {'insert': '. Try typing in '}, { @@ -325,24 +450,24 @@ const nestedDelta = { 'attributes': { 'bold': true, "italic": true, - 'href': 'https://appflowy.io' - } + 'href': 'https://appflowy.io', + }, }, {'insert': ' with '}, { 'insert': 'different', - 'attributes': {'italic': true} + 'attributes': {'italic': true}, }, - {'insert': ' formats.'} - ] - } + {'insert': ' formats.'}, + ], + }, }, { 'type': 'image', 'data': { 'url': 'https://richtexteditor.com/images/editor-image.png', 'align': 'center', - } + }, }, { 'type': 'paragraph', @@ -350,14 +475,14 @@ const nestedDelta = { 'delta': [ { 'insert': - 'Make sure to check out the various plugins in the toolbar. You can also use #hashtags or @-mentions too!' + 'Make sure to check out the various plugins in the toolbar. You can also use #hashtags or @-mentions too!', } - ] - } + ], + }, }, { 'type': 'paragraph', - 'data': {'delta': []} + 'data': {'delta': []}, }, { 'type': 'paragraph', @@ -365,10 +490,10 @@ const nestedDelta = { 'delta': [ { 'insert': - 'If you\'d like to find out more about Lexical, you can:' + 'If you\'d like to find out more about Lexical, you can:', } - ] - } + ], + }, }, { 'type': 'bulleted_list', @@ -377,11 +502,11 @@ const nestedDelta = { {'insert': 'Visit the '}, { 'insert': 'Lexical website', - 'attributes': {'href': 'https://lexical.dev/'} + 'attributes': {'href': 'https://lexical.dev/'}, }, - {'insert': ' for documentation and more information.'} - ] - } + {'insert': ' for documentation and more information.'}, + ], + }, }, { 'type': 'bulleted_list', @@ -391,10 +516,10 @@ const nestedDelta = { 'data': { 'url': 'https://richtexteditor.com/images/editor-image.png', 'align': 'center', - } + }, } ], - 'data': {'delta': []} + 'data': {'delta': []}, }, { 'type': 'bulleted_list', @@ -403,11 +528,11 @@ const nestedDelta = { {'insert': 'Check out the code on our '}, { 'insert': 'GitHub repository', - 'attributes': {'href': 'https://github.com/facebook/lexical'} + 'attributes': {'href': 'https://github.com/facebook/lexical'}, }, - {'insert': '.'} - ] - } + {'insert': '.'}, + ], + }, }, { 'type': 'bulleted_list', @@ -418,12 +543,12 @@ const nestedDelta = { 'insert': 'here', 'attributes': { 'href': - 'https://github.com/facebook/lexical/tree/main/packages/lexical-playground' - } + 'https://github.com/facebook/lexical/tree/main/packages/lexical-playground', + }, }, - {'insert': '.'} - ] - } + {'insert': '.'}, + ], + }, }, { 'type': 'bulleted_list', @@ -432,11 +557,11 @@ const nestedDelta = { {'insert': 'Join our '}, { 'insert': 'Discord Server', - 'attributes': {'href': 'https://discord.com/invite/KmG4wQnnD9'} + 'attributes': {'href': 'https://discord.com/invite/KmG4wQnnD9'}, }, - {'insert': ' and chat with the team.'} - ] - } + {'insert': ' and chat with the team.'}, + ], + }, }, { 'type': 'bulleted_list', @@ -447,12 +572,12 @@ const nestedDelta = { 'insert': 'here', 'attributes': { 'href': - 'https://github.com/facebook/lexical/tree/main/packages/lexical-playground' - } + 'https://github.com/facebook/lexical/tree/main/packages/lexical-playground', + }, }, - {'insert': '.'} - ] - } + {'insert': '.'}, + ], + }, }, { 'type': 'paragraph', @@ -460,15 +585,15 @@ const nestedDelta = { 'delta': [ { 'insert': - 'Lastly, we\'re constantly adding cool new features to this playground. So make sure you check back here when you next get a chance 🙂.' + 'Lastly, we\'re constantly adding cool new features to this playground. So make sure you check back here when you next get a chance 🙂.', } - ] - } + ], + }, }, { 'type': 'paragraph', - 'data': {'delta': []} + 'data': {'delta': []}, } - ] - } + ], + }, }; diff --git a/test/plugins/html/encoder/document_html_encoder_test.dart b/test/plugins/html/encoder/document_html_encoder_test.dart index 2a6402b2c..92f5be689 100644 --- a/test/plugins/html/encoder/document_html_encoder_test.dart +++ b/test/plugins/html/encoder/document_html_encoder_test.dart @@ -10,6 +10,7 @@ void main() async { const HTMLQuoteNodeParser(), const HTMLHeadingNodeParser(), const HTMLImageNodeParser(), + const HtmlTableNodeParser() ]; group('document_html_encoder_test.dart', () { setUpAll(() { diff --git a/test/plugins/html/encoder/parser/image_node_parser_test.dart b/test/plugins/html/encoder/parser/image_node_parser_test.dart index 6f2d9e447..5ff0e036e 100644 --- a/test/plugins/html/encoder/parser/image_node_parser_test.dart +++ b/test/plugins/html/encoder/parser/image_node_parser_test.dart @@ -10,6 +10,7 @@ void main() async { const HTMLQuoteNodeParser(), const HTMLHeadingNodeParser(), const HTMLImageNodeParser(), + const HtmlTableNodeParser() ]; group('html_image_node_parser.dart', () { test('parser image node', () { diff --git a/test/plugins/html/encoder/parser/table_node_parser_test.dart b/test/plugins/html/encoder/parser/table_node_parser_test.dart new file mode 100644 index 000000000..ba7550693 --- /dev/null +++ b/test/plugins/html/encoder/parser/table_node_parser_test.dart @@ -0,0 +1,116 @@ +import 'package:appflowy_editor/appflowy_editor.dart'; +import 'package:appflowy_editor/src/editor/block_component/table_block_component/table_node.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() async { + Lista | c |
b | d |