Skip to content

Commit

Permalink
Merge pull request #5905 from haiwen/repair-md-init-value-bug
Browse files Browse the repository at this point in the history
repair code bug
  • Loading branch information
shuntian authored Jan 19, 2024
2 parents dd5354a + 5bcdf83 commit 95b32dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/pages/markdown-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ class MarkdownEditor extends React.Component {
});
};

getFileName = (fileName) => {
return fileName.substring(0, fileName.lastIndexOf('.'));
};

render() {
const { loading, editorMode, markdownContent, fileInfo, fileTagList } = this.state;

Expand Down Expand Up @@ -504,7 +508,7 @@ class MarkdownEditor extends React.Component {
ref={this.editorRef}
mode={editorMode}
isFetching={loading}
initValue={fileName}
initValue={this.getFileName(fileName)}
value={markdownContent}
editorApi={editorApi}
onSave={this.onSaveEditorContent}
Expand Down

0 comments on commit 95b32dc

Please sign in to comment.