Apply suggestions from code review

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
This commit is contained in:
silamon
2022-02-03 18:55:07 +01:00
committed by GitHub
co-authored by Daniel Imms
parent 93ac9efe92
commit 16257386b1
2 changed files with 5 additions and 6 deletions
@@ -546,7 +546,7 @@ export class HTMLSerializeHandler extends BaseSerializeHandler {
private _padStart(target: string, targetLength: number, padString: string): string {
targetLength = targetLength >> 0;
padString = String(typeof padString !== 'undefined' ? padString : ' ');
padString = padString ?? ' ';
if (target.length > targetLength) {
return target;
}
@@ -587,9 +587,9 @@ export class HTMLSerializeHandler extends BaseSerializeHandler {
const color = isFg ? cell.getFgColor() : cell.getBgColor();
if (isFg ? cell.isFgRGB() : cell.isBgRGB()) {
const rgb = [
color >>> 0xFF0000 & 255,
color >>> 0xFF00 & 255,
color & 255
(color >> 16) & 255,
(color >> 8) & 255,
(color ) & 255
];
return rgb.map(x => this._padStart(x.toString(16), 2, '0')).join('');
}
+1 -2
View File
@@ -461,8 +461,7 @@ function htmlSerializeButtonHandler(): void {
document.addEventListener("copy", listener);
document.execCommand("copy");
document.removeEventListener("copy", listener);
document.getElementById("htmlserialize-output-result").innerText
= "Copied to clipboard";
document.getElementById("htmlserialize-output-result").innerText = "Copied to clipboard";
}