Add double quotes validation (#1002)

pull/1007/head
Uriel Aispuro 2 years ago committed by GitHub
parent 60d51e28c6
commit ff5e78c026
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      lib/src/widgets/raw_editor.dart

@ -293,8 +293,9 @@ class RawEditorState extends EditorState
var _doc = controller.document;
if (_doc.isEmpty() && widget.placeholder != null) {
final raw = widget.placeholder?.replaceAll(r'"', '\\"');
_doc = Document.fromJson(jsonDecode(
'[{"attributes":{"placeholder":true},"insert":"${widget.placeholder}\\n"}]'));
'[{"attributes":{"placeholder":true},"insert":"$raw\\n"}]'));
}
Widget child = CompositedTransformTarget(

Loading…
Cancel
Save