mirror of
https://github.com/liriliri/eruda.git
synced 2026-04-01 10:18:35 +08:00
Dev: Source panel
This commit is contained in:
@@ -182,6 +182,8 @@ export default class Log extends util.Emitter
|
||||
times: 1
|
||||
});
|
||||
|
||||
if (!log.isCode) log.val = txtToHtml(log.val);
|
||||
|
||||
var lastLog = this._lastLog;
|
||||
|
||||
if (lastLog.type === log.type && lastLog.val === log.val)
|
||||
@@ -322,3 +324,10 @@ function transCode(code)
|
||||
{
|
||||
return code.replace(/\n/g, '<br/>').replace(/ /g, ' ');
|
||||
}
|
||||
|
||||
function txtToHtml(str)
|
||||
{
|
||||
return str.replace(/\n/g, '<br/>')
|
||||
.replace(/\t/g, ' ')
|
||||
.replace(/ /g, ' ');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user