add range to IHTMLSerializeOptions
This commit is contained in:
@@ -148,6 +148,21 @@ describe('SerializeAddon', () => {
|
||||
assert.equal((output.match(/<div><span><a>&pi;<\/span><\/div>/g) || []).length, 1, output);
|
||||
});
|
||||
|
||||
it('serializes rows within a provided range', async () => {
|
||||
await writeP(terminal, 'hello\r\nworld');
|
||||
|
||||
const output = serializeAddon.serializeAsHTML({
|
||||
range: {
|
||||
start: 0,
|
||||
end: 0
|
||||
}
|
||||
});
|
||||
const rowMatches = output.match(/<div><span>.*?<\/span><\/div>/g) || [];
|
||||
assert.equal(rowMatches.length, 1, output);
|
||||
assert.ok(rowMatches[0]?.includes('hello'));
|
||||
assert.ok(!output.includes('world'));
|
||||
});
|
||||
|
||||
it('cells with bold styling', async () => {
|
||||
await writeP(terminal, ' ' + sgr('1') + 'terminal' + sgr('22') + ' ');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user