mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Merge pull request #2487 from daiyam/fix-task-config
fix error generated by toggling split editor
This commit is contained in:
@@ -304,6 +304,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
noteKey={noteKey}
|
noteKey={noteKey}
|
||||||
customCSS={config.preview.customCSS}
|
customCSS={config.preview.customCSS}
|
||||||
allowCustomCSS={config.preview.allowCustomCSS}
|
allowCustomCSS={config.preview.allowCustomCSS}
|
||||||
|
lineThroughCheckbox={config.preview.lineThroughCheckbox}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -490,10 +490,6 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
eventEmitter.on('export:save-md', this.saveAsMdHandler)
|
eventEmitter.on('export:save-md', this.saveAsMdHandler)
|
||||||
eventEmitter.on('export:save-html', this.saveAsHtmlHandler)
|
eventEmitter.on('export:save-html', this.saveAsHtmlHandler)
|
||||||
eventEmitter.on('print', this.printHandler)
|
eventEmitter.on('print', this.printHandler)
|
||||||
eventEmitter.on('config-renew', () => {
|
|
||||||
this.markdown.updateConfig()
|
|
||||||
this.rewriteIframe()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
@@ -537,7 +533,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
prevProps.smartQuotes !== this.props.smartQuotes ||
|
prevProps.smartQuotes !== this.props.smartQuotes ||
|
||||||
prevProps.sanitize !== this.props.sanitize ||
|
prevProps.sanitize !== this.props.sanitize ||
|
||||||
prevProps.smartArrows !== this.props.smartArrows ||
|
prevProps.smartArrows !== this.props.smartArrows ||
|
||||||
prevProps.breaks !== this.props.breaks
|
prevProps.breaks !== this.props.breaks ||
|
||||||
|
prevProps.lineThroughCheckbox !== this.props.lineThroughCheckbox
|
||||||
) {
|
) {
|
||||||
this.initMarkdown()
|
this.initMarkdown()
|
||||||
this.rewriteIframe()
|
this.rewriteIframe()
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ class MarkdownSplitEditor extends React.Component {
|
|||||||
noteKey={noteKey}
|
noteKey={noteKey}
|
||||||
customCSS={config.preview.customCSS}
|
customCSS={config.preview.customCSS}
|
||||||
allowCustomCSS={config.preview.allowCustomCSS}
|
allowCustomCSS={config.preview.allowCustomCSS}
|
||||||
|
lineThroughCheckbox={config.preview.lineThroughCheckbox}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function createGutter (str, firstLineNumber) {
|
|||||||
|
|
||||||
class Markdown {
|
class Markdown {
|
||||||
constructor (options = {}) {
|
constructor (options = {}) {
|
||||||
let config = ConfigManager.get()
|
const config = ConfigManager.get()
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
typographer: config.preview.smartQuotes,
|
typographer: config.preview.smartQuotes,
|
||||||
linkify: true,
|
linkify: true,
|
||||||
@@ -265,9 +265,6 @@ class Markdown {
|
|||||||
}
|
}
|
||||||
// FIXME We should not depend on global variable.
|
// FIXME We should not depend on global variable.
|
||||||
window.md = this.md
|
window.md = this.md
|
||||||
this.updateConfig = () => {
|
|
||||||
config = ConfigManager.get()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render (content) {
|
render (content) {
|
||||||
|
|||||||
Reference in New Issue
Block a user