mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 10:46:32 +00:00
Markdown in snippet note will be rendered
This commit is contained in:
@@ -2,6 +2,7 @@ import React, { PropTypes } from 'react'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './SnippetNoteDetail.styl'
|
import styles from './SnippetNoteDetail.styl'
|
||||||
import CodeEditor from 'browser/components/CodeEditor'
|
import CodeEditor from 'browser/components/CodeEditor'
|
||||||
|
import MarkdownEditor from 'browser/components/MarkdownEditor'
|
||||||
import StarButton from './StarButton'
|
import StarButton from './StarButton'
|
||||||
import TagSelect from './TagSelect'
|
import TagSelect from './TagSelect'
|
||||||
import FolderSelect from './FolderSelect'
|
import FolderSelect from './FolderSelect'
|
||||||
@@ -370,17 +371,26 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
<i className='fa fa-caret-down'/>
|
<i className='fa fa-caret-down'/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<CodeEditor styleName='tabView-content'
|
{snippet.mode === 'markdown'
|
||||||
mode={snippet.mode}
|
? <MarkdownEditor styleName='tabView-content'
|
||||||
value={snippet.content}
|
value={snippet.content}
|
||||||
theme={config.editor.theme}
|
config={config}
|
||||||
fontFamily={config.editor.fontFamily}
|
onChange={(e) => this.handleCodeChange(index)(e)}
|
||||||
fontSize={editorFontSize}
|
ref={'code-' + index}
|
||||||
indentType={config.editor.indentType}
|
ignorePreviewPointerEvents={this.props.ignorePreviewPointerEvents}
|
||||||
indentSize={editorIndentSize}
|
/>
|
||||||
onChange={(e) => this.handleCodeChange(index)(e)}
|
: <CodeEditor styleName='tabView-content'
|
||||||
ref={'code-' + index}
|
mode={snippet.mode}
|
||||||
/>
|
value={snippet.content}
|
||||||
|
theme={config.editor.theme}
|
||||||
|
fontFamily={config.editor.fontFamily}
|
||||||
|
fontSize={editorFontSize}
|
||||||
|
indentType={config.editor.indentType}
|
||||||
|
indentSize={editorIndentSize}
|
||||||
|
onChange={(e) => this.handleCodeChange(index)(e)}
|
||||||
|
ref={'code-' + index}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user