|
|
@@ -174,7 +174,7 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
this.setState({ isEnabledEmojiAutoComplete: true });
|
|
|
}
|
|
|
|
|
|
- this.initTextlintSettings();
|
|
|
+ this.initializeTextlint();
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
@@ -200,7 +200,8 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
this.setKeymapMode(keymapMode);
|
|
|
}
|
|
|
|
|
|
- async initTextlintSettings() {
|
|
|
+ async initializeTextlint() {
|
|
|
+ await this.props.onInitializeTextlint();
|
|
|
// If database has empty array, pass null instead to enable all default rules
|
|
|
const rulesForValidator = this.props.textlintRules?.length !== 0 ? this.props.textlintRules : null;
|
|
|
this.textlintValidator = createValidator(rulesForValidator);
|
|
|
@@ -988,6 +989,7 @@ CodeMirrorEditor.propTypes = Object.assign({
|
|
|
lineNumbers: PropTypes.bool,
|
|
|
onMarkdownHelpButtonClicked: PropTypes.func,
|
|
|
onAddAttachmentButtonClicked: PropTypes.func,
|
|
|
+ onInitializeTextlint: PropTypes.func,
|
|
|
}, AbstractEditor.propTypes);
|
|
|
|
|
|
CodeMirrorEditor.defaultProps = {
|