fix : Code block parser implementation (#2046)

* fix: Code block implementation

* fix: Added test to cover CodeBlock

* fix: typos

* fix: Code block implementation

* fix: typos
This commit is contained in:
Gunjan Lunkad
2023-03-23 14:00:52 +05:30
committed by GitHub
parent 98f1ac52b4
commit 3039f0427f
3 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,13 @@
import 'package:appflowy_editor/appflowy_editor.dart';
class CodeBlockNodeParser extends NodeParser {
const CodeBlockNodeParser();
@override
String get id => 'code_block';
@override
String transform(Node node) {
return '```\n${node.attributes['code_block']}\n```';
}
}