Skip to content

Commit

Permalink
Fixed loading of markdown as initial config
Browse files Browse the repository at this point in the history
  • Loading branch information
umerfaruk committed Mar 15, 2024
1 parent 4ece6e2 commit 415aa29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 415aa29

Please sign in to comment.