提交 f4ae99fc 编写于 作者: N Naoyuki Kanezawa 提交者: GitHub

Revert "Add syntax highlighting to debug error page" (#197)

上级 060480f2
......@@ -39,7 +39,6 @@
"parser": "babel-eslint"
},
"dependencies": {
"ansi-html": "0.0.6",
"babel-core": "6.17.0",
"babel-generator": "6.17.0",
"babel-loader": "6.2.5",
......
import React from 'react'
import ansiHTML from 'ansi-html'
import stripAnsi from 'strip-ansi'
import Head from 'next/head'
import style from 'next/css'
......@@ -16,24 +16,20 @@ export default class ErrorDebug extends React.Component {
<Head>
<style dangerouslySetInnerHTML={{ __html: `
body {
background: #a6004c;
background: #dc0067;
margin: 0;
}
`}} />
</Head>
<div className={styles.heading}>Error in {path}</div>
<pre className={styles.message} dangerouslySetInnerHTML={{ __html: ansiHTML(encodeHtml(message)) }} />
<pre className={styles.message}>{stripAnsi(message)}</pre>
</div>
}
}
const encodeHtml = str => {
return str.replace(/</g, '&lt;').replace(/>/g, '&gt;')
}
const styles = {
body: style({
background: '#a6004c',
background: '#dc0067',
margin: 0
}),
......@@ -54,18 +50,7 @@ const styles = {
fontFamily: '-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif',
fontSize: '13px',
fontWeight: 'bold',
color: '#ff84bf',
color: '#ff90c6',
marginBottom: '20px'
})
}
ansiHTML.setColors({
reset: ['fff', 'a6004c'],
darkgrey: '5a012b',
yellow: 'ffab07',
green: 'aeefba',
magenta: 'ff84bf',
blue: '3505a0',
cyan: '56eaec',
red: '4e053a'
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册