|
|
|
@@ -40,7 +40,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
|
|
|
|
|
describe('createRow', () => {
|
|
|
|
|
it('should not create anything for an empty row', () => {
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
''
|
|
|
|
|
);
|
|
|
|
@@ -51,7 +51,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR, '語', 2, '語'.charCodeAt(0)]));
|
|
|
|
|
// There should be no element for the following "empty" cell
|
|
|
|
|
lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, '', 0, 0]));
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span>語</span>'
|
|
|
|
|
);
|
|
|
|
@@ -59,7 +59,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
|
|
|
|
|
it('should add class for cursor and cursor style', () => {
|
|
|
|
|
for (const style of ['block', 'bar', 'underline']) {
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, style, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, style, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
`<span class="xterm-cursor xterm-cursor-${style}"> </span>`
|
|
|
|
|
);
|
|
|
|
@@ -67,7 +67,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should add class for cursor blink', () => {
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, 'block', undefined, 0, true, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, 'block', undefined, 0, true, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
`<span class="xterm-cursor xterm-cursor-blink xterm-cursor-block"> </span>`
|
|
|
|
|
);
|
|
|
|
@@ -86,7 +86,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
new MockThemeService()
|
|
|
|
|
);
|
|
|
|
|
for (const inactiveStyle of ['outline', 'block', 'bar', 'underline', 'none']){
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, 'block', inactiveStyle, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, 'block', inactiveStyle, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
if (inactiveStyle === 'none') {
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
`<span class="xterm-cursor"> </span>`);
|
|
|
|
@@ -109,7 +109,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
new MockDecorationService(),
|
|
|
|
|
new MockThemeService()
|
|
|
|
|
);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, 'block', undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, 'block', undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
`<span> </span>`
|
|
|
|
|
);
|
|
|
|
@@ -120,7 +120,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
const cell = CellData.fromCharData([0, 'a', 1, 'a'.charCodeAt(0)]);
|
|
|
|
|
cell.fg = DEFAULT_ATTR_DATA.fg | FgFlags.BOLD;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-bold">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -130,7 +130,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
const cell = CellData.fromCharData([0, 'a', 1, 'a'.charCodeAt(0)]);
|
|
|
|
|
cell.bg = DEFAULT_ATTR_DATA.bg | BgFlags.ITALIC;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-italic">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -140,7 +140,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
const cell = CellData.fromCharData([0, 'a', 1, 'a'.charCodeAt(0)]);
|
|
|
|
|
cell.bg = DEFAULT_ATTR_DATA.bg | BgFlags.DIM;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-dim">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -153,7 +153,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.bg = DEFAULT_ATTR_DATA.bg | BgFlags.HAS_EXTENDED;
|
|
|
|
|
cell.extended.underlineStyle = UnderlineStyle.SINGLE;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-underline-1">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -164,7 +164,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.bg = DEFAULT_ATTR_DATA.bg | BgFlags.HAS_EXTENDED;
|
|
|
|
|
cell.extended.underlineStyle = UnderlineStyle.DOUBLE;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-underline-2">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -175,7 +175,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.bg = DEFAULT_ATTR_DATA.bg | BgFlags.HAS_EXTENDED;
|
|
|
|
|
cell.extended.underlineStyle = UnderlineStyle.CURLY;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-underline-3">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -186,7 +186,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.bg = DEFAULT_ATTR_DATA.bg | BgFlags.HAS_EXTENDED;
|
|
|
|
|
cell.extended.underlineStyle = UnderlineStyle.DOTTED;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-underline-4">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -197,7 +197,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.bg = DEFAULT_ATTR_DATA.bg | BgFlags.HAS_EXTENDED;
|
|
|
|
|
cell.extended.underlineStyle = UnderlineStyle.DASHED;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-underline-5">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -208,7 +208,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
const cell = CellData.fromCharData([0, 'a', 1, 'a'.charCodeAt(0)]);
|
|
|
|
|
cell.bg = DEFAULT_ATTR_DATA.bg | BgFlags.OVERLINE;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-overline">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -218,12 +218,28 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
const cell = CellData.fromCharData([0, 'a', 1, 'a'.charCodeAt(0)]);
|
|
|
|
|
cell.fg = DEFAULT_ATTR_DATA.fg | FgFlags.STRIKETHROUGH;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-strikethrough">a</span>'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should hide blinking text when blink is off', () => {
|
|
|
|
|
const cell = CellData.fromCharData([0, 'a', 1, 'a'.charCodeAt(0)]);
|
|
|
|
|
cell.fg = DEFAULT_ATTR_DATA.fg | FgFlags.BLINK | FgFlags.UNDERLINE;
|
|
|
|
|
cell.bg = DEFAULT_ATTR_DATA.bg | BgFlags.HAS_EXTENDED;
|
|
|
|
|
cell.extended.underlineStyle = UnderlineStyle.SINGLE;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const onSpans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(onSpans),
|
|
|
|
|
'<span class="xterm-underline-1">a</span>'
|
|
|
|
|
);
|
|
|
|
|
const offSpans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, false, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(offSpans),
|
|
|
|
|
'<span class="xterm-blink-hidden xterm-underline-1">a</span>'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should add classes for 256 foreground colors', () => {
|
|
|
|
|
const cell = CellData.fromCharData([0, 'a', 1, 'a'.charCodeAt(0)]);
|
|
|
|
|
cell.fg |= Attributes.CM_P256;
|
|
|
|
@@ -231,7 +247,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.fg &= ~Attributes.PCOLOR_MASK;
|
|
|
|
|
cell.fg |= i;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
`<span class="xterm-fg-${i}">a</span>`
|
|
|
|
|
);
|
|
|
|
@@ -245,7 +261,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.bg &= ~Attributes.PCOLOR_MASK;
|
|
|
|
|
cell.bg |= i;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
`<span class="xterm-bg-${i}">a</span>`
|
|
|
|
|
);
|
|
|
|
@@ -257,7 +273,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.fg |= Attributes.CM_P16 | 2 | FgFlags.INVERSE;
|
|
|
|
|
cell.bg |= Attributes.CM_P16 | 1;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-bg-2 xterm-fg-1">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -268,7 +284,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.fg |= FgFlags.INVERSE;
|
|
|
|
|
cell.bg |= Attributes.CM_P16 | 1;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-bg-257 xterm-fg-1">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -278,7 +294,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
const cell = CellData.fromCharData([0, 'a', 1, 'a'.charCodeAt(0)]);
|
|
|
|
|
cell.fg |= Attributes.CM_P16 | 1 | FgFlags.INVERSE;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-bg-1 xterm-fg-257">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -291,7 +307,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.fg &= ~Attributes.PCOLOR_MASK;
|
|
|
|
|
cell.fg |= i;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
`<span class="xterm-bold xterm-fg-${i + 8}">a</span>`
|
|
|
|
|
);
|
|
|
|
@@ -303,7 +319,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.fg |= Attributes.CM_RGB | 1 << 16 | 2 << 8 | 3;
|
|
|
|
|
cell.bg |= Attributes.CM_RGB | 4 << 16 | 5 << 8 | 6;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span style="background-color:#040506;color:#010203;">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -314,7 +330,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
cell.fg |= Attributes.CM_RGB | 1 << 16 | 2 << 8 | 3 | FgFlags.INVERSE;
|
|
|
|
|
cell.bg |= Attributes.CM_RGB | 4 << 16 | 5 << 8 | 6;
|
|
|
|
|
lineData.setCell(0, cell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span style="background-color:#010203;color:#040506;">a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -326,7 +342,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)]));
|
|
|
|
|
rowFactory.handleSelectionChanged([1, 0], [2, 0], false);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span>a</span><span style="background-color:#ff0000;" class="xterm-decoration-top">b</span>'
|
|
|
|
|
);
|
|
|
|
@@ -334,7 +350,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
it('should force whitespace cells to be rendered above the background', () => {
|
|
|
|
|
lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]));
|
|
|
|
|
rowFactory.handleSelectionChanged([0, 0], [2, 0], false);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span style="background-color:#ff0000;" class="xterm-decoration-top"> a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -351,7 +367,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should not create anything for an empty row', () => {
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
''
|
|
|
|
|
);
|
|
|
|
@@ -361,7 +377,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(2, CellData.fromCharData([DEFAULT_ATTR, 'c', 1, 'c'.charCodeAt(0)]));
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span>abc</span>'
|
|
|
|
|
);
|
|
|
|
@@ -372,7 +388,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, '€', 1, '€'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(2, CellData.fromCharData([DEFAULT_ATTR, 'c', 1, 'c'.charCodeAt(0)]));
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span>a</span><span style="letter-spacing: 3px;">€</span><span>c</span>'
|
|
|
|
|
);
|
|
|
|
@@ -387,7 +403,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
lineData.setCell(1, aColor1);
|
|
|
|
|
lineData.setCell(2, bColor2);
|
|
|
|
|
lineData.setCell(3, bColor2);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-fg-1">aa</span><span class="xterm-fg-2">bb</span>'
|
|
|
|
|
);
|
|
|
|
@@ -399,7 +415,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
lineData.setCell(2, CellData.fromCharData([DEFAULT_ATTR, 'X', 1, 'X'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(3, CellData.fromCharData([DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(4, CellData.fromCharData([DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)]));
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, undefined, undefined, 2, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, true, undefined, undefined, 2, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span>aa</span><span class="xterm-cursor xterm-cursor-block">X</span><span>bb</span>'
|
|
|
|
|
);
|
|
|
|
@@ -412,7 +428,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
nullCell.bg = Attributes.CM_P16 | 2;
|
|
|
|
|
lineData.setCell(3, nullCell);
|
|
|
|
|
lineData.setCell(4, nullCell);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span> </span><span class="xterm-bg-1"> </span><span class="xterm-bg-2"> </span>'
|
|
|
|
|
);
|
|
|
|
@@ -422,23 +438,23 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
const nullCell = lineData.loadCell(0, new CellData());
|
|
|
|
|
nullCell.bg = Attributes.CM_P16 | 1;
|
|
|
|
|
lineData.setCell(0, nullCell);
|
|
|
|
|
let spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
let spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-bg-1"> </span>'
|
|
|
|
|
);
|
|
|
|
|
lineData.setCell(1, nullCell);
|
|
|
|
|
spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-bg-1"> </span>'
|
|
|
|
|
);
|
|
|
|
|
lineData.setCell(2, nullCell);
|
|
|
|
|
lineData.setCell(3, nullCell);
|
|
|
|
|
spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-bg-1"> </span>'
|
|
|
|
|
);
|
|
|
|
|
lineData.setCell(4, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]));
|
|
|
|
|
spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span class="xterm-bg-1"> </span><span>a</span>'
|
|
|
|
|
);
|
|
|
|
@@ -451,7 +467,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
lineData.setCell(2, CellData.fromCharData([DEFAULT_ATTR, 'c', 1, 'c'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(3, CellData.fromCharData([DEFAULT_ATTR, '語', 2, 'c'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(4, CellData.fromCharData([DEFAULT_ATTR, '𝄞', 1, 'c'.charCodeAt(0)]));
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -1, -1);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -1, -1);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span>a</span><span style="letter-spacing: 3px;">€</span><span>c語</span><span style="letter-spacing: -2px;">𝄞</span>'
|
|
|
|
|
);
|
|
|
|
@@ -465,7 +481,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
lineData.setCell(4, CellData.fromCharData([DEFAULT_ATTR, 'x', 1, 'x'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(5, CellData.fromCharData([DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(6, CellData.fromCharData([DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)]));
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, 2, 4);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, 2, 4);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span>aa</span><span style="text-decoration: underline;">xxx</span><span>bb</span>'
|
|
|
|
|
);
|
|
|
|
@@ -476,7 +492,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(2, CellData.fromCharData([DEFAULT_ATTR, 'x', 1, 'x'.charCodeAt(0)]));
|
|
|
|
|
lineData.setCell(4, CellData.fromCharData([DEFAULT_ATTR, 'x', 1, 'x'.charCodeAt(0)]));
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, 2, 4);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, 2, 4);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span>aa</span><span style="text-decoration: underline;">x x</span>'
|
|
|
|
|
);
|
|
|
|
@@ -486,7 +502,7 @@ describe('DomRendererRowFactory', () => {
|
|
|
|
|
for (let i = 0; i < 10; ++i) {
|
|
|
|
|
lineData.setCell(i, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]));
|
|
|
|
|
}
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, 5, widthCache, -100, 100);
|
|
|
|
|
const spans = rowFactory.createRow(lineData, 0, false, undefined, undefined, 0, false, true, 5, widthCache, -100, 100);
|
|
|
|
|
assert.equal(extractHtml(spans),
|
|
|
|
|
'<span style="text-decoration: underline;">aaaaaaaaaa</span>'
|
|
|
|
|
);
|
|
|
|
|