diff --git a/README.md b/README.md index acb237f..c7d87f4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # urdu-web-editor -> Urdu Rich Text Editor for web based on lexical +Urdu Rich Text Editor for web based on [lexical](https://lexical.dev/) [![NPM](https://img.shields.io/npm/v/urdu-web-editor.svg)](https://www.npmjs.com/package/urdu-web-editor) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) @@ -193,7 +193,7 @@ Default value : { "value": "Times New Roman", "label": "Times New Roman" }, { "value": "Trebuchet MS", "label": "Trebuchet MS" }, { "value": "Verdana", "label": "Verdana" }, -]; +] ``` #### spellchecker diff --git a/src/index.js b/src/index.js index 3ccf7f7..cc07b59 100644 --- a/src/index.js +++ b/src/index.js @@ -85,7 +85,7 @@ export default ({ value = null, const editorState = value === EMPTY_CONTENT ? configuration.format == 'markdown'? ' ' : EMPTY_CONTENT : value; const initialConfig = { namespace: "MyEditor", - editorState: editorState, + editorState: () => configuration.format === 'markdown' ? $convertFromMarkdownString(editorState, TRANSFORMERS) : editorState, nodes: [...EditorNodes], theme: EditorTheme, onError,