1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-21 19:37:28 +00:00

repair code bug

This commit is contained in:
shanshuirenjia
2022-05-23 18:24:19 +08:00
parent 51fc99d370
commit 6c89f2c11d

View File

@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Text } from 'slate';
import { deserialize, serialize, PlainMarkdownEditor } from '@seafile/seafile-editor';
import toaster from '../../../components/toast';
import { gettext } from '../../../utils/constants';
@@ -39,6 +40,7 @@ class SeafileEditor extends React.Component {
const { mode, markdownContent, isDraft } = this.props;
const isEditMode = mode === 'editor' || isDraft;
const richValue = isEditMode ? deserialize(markdownContent) : deserialize('');
console.log(richValue);
this.state = {
initialPlainValue: '',
currentContent: markdownContent,
@@ -54,6 +56,7 @@ class SeafileEditor extends React.Component {
componentWillMount() {
if (this.props.editorMode === 'rich') {
const document = this.state.richValue;
console.log(document, 'dadad');
const firstNode = document[0];
/**
* if the markdown content is empty, the rich value contains