mirror of
https://github.com/liriliri/eruda.git
synced 2026-04-01 10:18:35 +08:00
chore(sources): indent size 2
This commit is contained in:
@@ -410,7 +410,7 @@ function formatErr(err) {
|
||||
|
||||
function formatJs(code) {
|
||||
const curTheme = evalCss.getCurTheme()
|
||||
return highlight(beautify(code), 'js', {
|
||||
return highlight(beautify(code, { indent_size: 2 }), 'js', {
|
||||
keyword: `color:${curTheme.keywordColor}`,
|
||||
number: `color:${curTheme.numberColor}`,
|
||||
operator: `color:${curTheme.operatorColor}`,
|
||||
@@ -542,7 +542,7 @@ function formatFn(val) {
|
||||
|
||||
function formatEl(val) {
|
||||
return `<pre style="display:inline">${highlight(
|
||||
beautify.html(val.outerHTML, { unformatted: [] }),
|
||||
beautify.html(val.outerHTML, { unformatted: [], indent_size: 2 }),
|
||||
'html'
|
||||
)}</pre>`
|
||||
}
|
||||
|
||||
@@ -185,13 +185,13 @@ export default class Sources extends Tool {
|
||||
if (len < MAX_BEAUTIFY_LEN && this._formatCode) {
|
||||
switch (data.type) {
|
||||
case 'html':
|
||||
code = beautify.html(code, { unformatted: [] })
|
||||
code = beautify.html(code, { unformatted: [], indent_size: 2 })
|
||||
break
|
||||
case 'css':
|
||||
code = beautify.css(code)
|
||||
code = beautify.css(code, { indent_size: 2 })
|
||||
break
|
||||
case 'js':
|
||||
code = beautify(code)
|
||||
code = beautify(code, { indent_size: 2 })
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user