Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import '../../utilities/vendor/prism/prism.scss'
import './jupyterNotebook.scss'
import './markdown.scss'
const logger = remote.getGlobal('logger')
const conf = remote.getGlobal('conf')
// resolve syntax highlight style based on app theme
if (conf.get('theme') === 'dark') {
require('../../utilities/vendor/highlightJS/styles/atom-one-dark.css')
} else {
require('../../utilities/vendor/highlightJS/styles/github-gist.css')
}
hljsDefineSolidity(HighlightJS) // register solidity to hightlight.js
export default class CodeArea extends Component {
createJupyterNotebookCodeBlock (content, language, kTabLength) {
try {
const notebook = nb.parse(JSON.parse(content))
const notebookHtml = notebook.render().outerHTML
return `<div class="jupyterNotebook-section">${notebookHtml}</div>`
} catch (err) {
logger.error(`Failed to render Jupyter Notebook content with err ${err}`)
return this.createHighlightedCodeBlock(content, language, kTabLength)
}
}
createMarkdownCodeBlock (content) {
return `<div class="markdown-section">${Markdown.render(content)}</div>`
}