mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-08 12:14:03 +08:00
update files
This commit is contained in:
parent
6b58997ec1
commit
6db88b6d26
@ -1031,7 +1031,7 @@ AnsiTerminal.prototype.toString = function (type){
|
|||||||
|
|
||||||
if (type === 'html') {
|
if (type === 'html') {
|
||||||
var styleBuffer;
|
var styleBuffer;
|
||||||
var attrCache = null;
|
var attrCache;
|
||||||
var stylesBuffer = this.stylesBuffer || [];
|
var stylesBuffer = this.stylesBuffer || [];
|
||||||
|
|
||||||
stylesBuffer = stylesBuffer.slice(0, rows);
|
stylesBuffer = stylesBuffer.slice(0, rows);
|
||||||
@ -1045,7 +1045,6 @@ AnsiTerminal.prototype.toString = function (type){
|
|||||||
for (j = 0; j < cols; ++j) {
|
for (j = 0; j < cols; ++j) {
|
||||||
node = this.screen.buffer[i].cells[j];
|
node = this.screen.buffer[i].cells[j];
|
||||||
styleBuffer = stylesBuffer[i][j] || styles(node);
|
styleBuffer = stylesBuffer[i][j] || styles(node);
|
||||||
attrCache = j === 0 ? null : attrCache;
|
|
||||||
|
|
||||||
if (styleBuffer.value !== node.value || styleBuffer.attr !== node.attr) {
|
if (styleBuffer.value !== node.value || styleBuffer.attr !== node.attr) {
|
||||||
stylesBuffer[i][j] = styles(node);
|
stylesBuffer[i][j] = styles(node);
|
||||||
@ -1053,25 +1052,20 @@ AnsiTerminal.prototype.toString = function (type){
|
|||||||
stylesBuffer[i][j].value = node.value;
|
stylesBuffer[i][j].value = node.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.value) {
|
if (j === 0) {
|
||||||
if (attrCache !== null && node.attr === attrCache) {
|
|
||||||
s += node.value;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (attrCache === null) {
|
|
||||||
s += '<span>';
|
s += '<span>';
|
||||||
} else {
|
attrCache = node.attr;
|
||||||
s += node.value;
|
} else if (j === cols - 1) {
|
||||||
|
|
||||||
if (j === cols - 1) {
|
|
||||||
s += '</span>';
|
s += '</span>';
|
||||||
} else {
|
|
||||||
s += '</span><span>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.value) {
|
||||||
|
if (node.attr !== attrCache) {
|
||||||
|
s += '</span><span>';
|
||||||
attrCache = node.attr;
|
attrCache = node.attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s += node.value.replace(/\s/g, ' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user