mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Merge branch 'add-markdownlint-rules-form' of github.com:roottool/Boostnote into enable-markdownlint-option
This commit is contained in:
@@ -86,7 +86,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
this.searchHandler = (e, msg) => this.handleSearch(msg)
|
this.searchHandler = (e, msg) => this.handleSearch(msg)
|
||||||
this.searchState = null
|
this.searchState = null
|
||||||
this.scrollToLineHandeler = this.scrollToLine.bind(this)
|
this.scrollToLineHandeler = this.scrollToLine.bind(this)
|
||||||
this.setCodeEditorLintConfig = this.setCodeEditorLintConfig.bind(this)
|
this.getCodeEditorLintConfig = this.getCodeEditorLintConfig.bind(this)
|
||||||
this.validatorOfMarkdown = this.validatorOfMarkdown.bind(this)
|
this.validatorOfMarkdown = this.validatorOfMarkdown.bind(this)
|
||||||
|
|
||||||
this.formatTable = () => this.handleFormatTable()
|
this.formatTable = () => this.handleFormatTable()
|
||||||
@@ -277,7 +277,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
inputStyle: 'textarea',
|
inputStyle: 'textarea',
|
||||||
dragDrop: false,
|
dragDrop: false,
|
||||||
foldGutter: true,
|
foldGutter: true,
|
||||||
lint: enableMarkdownLint ? this.setCodeEditorLintConfig() : false,
|
lint: enableMarkdownLint ? this.getCodeEditorLintConfig() : false,
|
||||||
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'CodeMirror-lint-markers'],
|
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'CodeMirror-lint-markers'],
|
||||||
autoCloseBrackets: {
|
autoCloseBrackets: {
|
||||||
pairs: this.props.matchingPairs,
|
pairs: this.props.matchingPairs,
|
||||||
@@ -541,7 +541,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
this.editor.setOption('lint', {default: false})
|
this.editor.setOption('lint', {default: false})
|
||||||
document.querySelector('.CodeMirror-lint-markers').style.display = 'none'
|
document.querySelector('.CodeMirror-lint-markers').style.display = 'none'
|
||||||
} else {
|
} else {
|
||||||
this.editor.setOption('lint', this.setCodeEditorLintConfig())
|
this.editor.setOption('lint', this.getCodeEditorLintConfig())
|
||||||
document.querySelector('.CodeMirror-lint-markers').style.display = 'inline-block'
|
document.querySelector('.CodeMirror-lint-markers').style.display = 'inline-block'
|
||||||
}
|
}
|
||||||
needRefresh = true
|
needRefresh = true
|
||||||
@@ -626,7 +626,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setCodeEditorLintConfig () {
|
getCodeEditorLintConfig () {
|
||||||
const { mode } = this.props
|
const { mode } = this.props
|
||||||
const checkMarkdownNoteIsOpen = mode === 'Boost Flavored Markdown'
|
const checkMarkdownNoteIsOpen = mode === 'Boost Flavored Markdown'
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class UiTab extends React.Component {
|
|||||||
CodeMirror.autoLoadMode(this.customCSSCM.getCodeMirror(), 'css')
|
CodeMirror.autoLoadMode(this.customCSSCM.getCodeMirror(), 'css')
|
||||||
CodeMirror.autoLoadMode(this.customMarkdownLintConfigCM.getCodeMirror(), 'javascript')
|
CodeMirror.autoLoadMode(this.customMarkdownLintConfigCM.getCodeMirror(), 'javascript')
|
||||||
this.customCSSCM.getCodeMirror().setSize('400px', '400px')
|
this.customCSSCM.getCodeMirror().setSize('400px', '400px')
|
||||||
this.customMarkdownLintConfigCM.getCodeMirror().setSize('400px', '400px')
|
this.customMarkdownLintConfigCM.getCodeMirror().setSize('400px', '200px')
|
||||||
this.handleSettingDone = () => {
|
this.handleSettingDone = () => {
|
||||||
this.setState({UiAlert: {
|
this.setState({UiAlert: {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@@ -660,7 +660,7 @@ class UiTab extends React.Component {
|
|||||||
<div style={{fontFamily}}>
|
<div style={{fontFamily}}>
|
||||||
<ReactCodeMirror
|
<ReactCodeMirror
|
||||||
width='400px'
|
width='400px'
|
||||||
height='400px'
|
height='200px'
|
||||||
onChange={e => this.handleUIChange(e)}
|
onChange={e => this.handleUIChange(e)}
|
||||||
ref={e => (this.customMarkdownLintConfigCM = e)}
|
ref={e => (this.customMarkdownLintConfigCM = e)}
|
||||||
value={config.editor.customMarkdownLintConfig}
|
value={config.editor.customMarkdownLintConfig}
|
||||||
|
|||||||
Reference in New Issue
Block a user