@@ -2,6 +2,7 @@ import React, { PropTypes } from 'react'
22import CSSModules from 'browser/lib/CSSModules'
33import styles from './SnippetNoteDetail.styl'
44import CodeEditor from 'browser/components/CodeEditor'
5+ import MarkdownEditor from 'browser/components/MarkdownEditor'
56import StarButton from './StarButton'
67import TagSelect from './TagSelect'
78import FolderSelect from './FolderSelect'
@@ -370,17 +371,26 @@ class SnippetNoteDetail extends React.Component {
370371 < i className = 'fa fa-caret-down' />
371372 </ button >
372373 </ div >
373- < CodeEditor styleName = 'tabView-content'
374- mode = { snippet . mode }
375- value = { snippet . content }
376- theme = { config . editor . theme }
377- fontFamily = { config . editor . fontFamily }
378- fontSize = { editorFontSize }
379- indentType = { config . editor . indentType }
380- indentSize = { editorIndentSize }
381- onChange = { ( e ) => this . handleCodeChange ( index ) ( e ) }
382- ref = { 'code-' + index }
383- />
374+ { snippet . mode === 'markdown'
375+ ? < MarkdownEditor styleName = 'tabView-content'
376+ value = { snippet . content }
377+ config = { config }
378+ onChange = { ( e ) => this . handleCodeChange ( index ) ( e ) }
379+ ref = { 'code-' + index }
380+ ignorePreviewPointerEvents = { this . props . ignorePreviewPointerEvents }
381+ />
382+ : < CodeEditor styleName = 'tabView-content'
383+ mode = { snippet . mode }
384+ value = { snippet . content }
385+ theme = { config . editor . theme }
386+ fontFamily = { config . editor . fontFamily }
387+ fontSize = { editorFontSize }
388+ indentType = { config . editor . indentType }
389+ indentSize = { editorIndentSize }
390+ onChange = { ( e ) => this . handleCodeChange ( index ) ( e ) }
391+ ref = { 'code-' + index }
392+ />
393+ }
384394 </ div >
385395 } )
386396
0 commit comments