|
|
@@ -206,7 +206,7 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
|
|
|
initTextlintSettings() {
|
|
|
this.textlintValidator = createValidator(this.textlintConfig);
|
|
|
- this.codemirrorLintConfig = this.isTextlintEnabled ? { getAnnotations: this.textlintValidator, async: true } : undefined;
|
|
|
+ this.codemirrorLintConfig = { getAnnotations: this.textlintValidator, async: true };
|
|
|
}
|
|
|
|
|
|
getCodeMirror() {
|
|
|
@@ -882,7 +882,7 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
|
|
|
render() {
|
|
|
const mode = this.state.isGfmMode ? 'gfm-growi' : undefined;
|
|
|
- const lint = this.codemirrorLintConfig;
|
|
|
+ const lint = this.props.isTextlintEnabled ? this.codemirrorLintConfig : false;
|
|
|
const additionalClasses = Array.from(this.state.additionalClassSet).join(' ');
|
|
|
const placeholder = this.state.isGfmMode ? 'Input with Markdown..' : 'Input with Plain Text..';
|
|
|
|
|
|
@@ -890,7 +890,7 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
if (this.props.lineNumbers != null) {
|
|
|
gutters.push('CodeMirror-linenumbers', 'CodeMirror-foldgutter');
|
|
|
}
|
|
|
- if (this.isTextlintEnabled === true) {
|
|
|
+ if (this.props.isTextlintEnabled === true) {
|
|
|
gutters.push('CodeMirror-lint-markers');
|
|
|
}
|
|
|
|
|
|
@@ -984,6 +984,7 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
|
|
|
CodeMirrorEditor.propTypes = Object.assign({
|
|
|
editorOptions: PropTypes.object.isRequired,
|
|
|
+ isTextlintEnabled: PropTypes.bool.isRequired,
|
|
|
emojiStrategy: PropTypes.object,
|
|
|
lineNumbers: PropTypes.bool,
|
|
|
onMarkdownHelpButtonClicked: PropTypes.func,
|