#1754 - implement strikethrough formatting, client keybinding, tests, and help section
This commit is contained in:
parent
2f47307437
commit
0643d3b4a3
@ -1947,6 +1947,10 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.irc-strikethrough {
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
.irc-italic {
|
.irc-italic {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,7 @@ const colorsHotkeys = {
|
|||||||
u: "\x1F",
|
u: "\x1F",
|
||||||
i: "\x1D",
|
i: "\x1D",
|
||||||
o: "\x0F",
|
o: "\x0F",
|
||||||
|
s: "\x1e",
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const hotkey in colorsHotkeys) {
|
for (const hotkey in colorsHotkeys) {
|
||||||
|
@ -8,6 +8,7 @@ const RESET = "\x0f";
|
|||||||
const REVERSE = "\x16";
|
const REVERSE = "\x16";
|
||||||
const ITALIC = "\x1d";
|
const ITALIC = "\x1d";
|
||||||
const UNDERLINE = "\x1f";
|
const UNDERLINE = "\x1f";
|
||||||
|
const STRIKETHROUGH = "\x1e";
|
||||||
|
|
||||||
// Color code matcher, with format `XX,YY` where both `XX` and `YY` are
|
// Color code matcher, with format `XX,YY` where both `XX` and `YY` are
|
||||||
// integers, `XX` is the text color and `YY` is an optional background color.
|
// integers, `XX` is the text color and `YY` is an optional background color.
|
||||||
@ -22,7 +23,7 @@ const controlCodesRx = /[\u0000-\u001F]/g;
|
|||||||
// Converts a given text into an array of objects, each of them representing a
|
// Converts a given text into an array of objects, each of them representing a
|
||||||
// similarly styled section of the text. Each object carries the `text`, style
|
// similarly styled section of the text. Each object carries the `text`, style
|
||||||
// information (`bold`, `textColor`, `bgcolor`, `reverse`, `italic`,
|
// information (`bold`, `textColor`, `bgcolor`, `reverse`, `italic`,
|
||||||
// `underline`), and `start`/`end` cursors.
|
// `underline`, `strikethrough`), and `start`/`end` cursors.
|
||||||
function parseStyle(text) {
|
function parseStyle(text) {
|
||||||
const result = [];
|
const result = [];
|
||||||
let start = 0;
|
let start = 0;
|
||||||
@ -30,7 +31,7 @@ function parseStyle(text) {
|
|||||||
|
|
||||||
// At any given time, these carry style information since last time a styling
|
// At any given time, these carry style information since last time a styling
|
||||||
// control code was met.
|
// control code was met.
|
||||||
let colorCodes, bold, textColor, bgColor, hexColor, hexBgColor, reverse, italic, underline;
|
let colorCodes, bold, textColor, bgColor, hexColor, hexBgColor, reverse, italic, underline, strikethrough;
|
||||||
|
|
||||||
const resetStyle = () => {
|
const resetStyle = () => {
|
||||||
bold = false;
|
bold = false;
|
||||||
@ -41,6 +42,7 @@ function parseStyle(text) {
|
|||||||
reverse = false;
|
reverse = false;
|
||||||
italic = false;
|
italic = false;
|
||||||
underline = false;
|
underline = false;
|
||||||
|
strikethrough = false;
|
||||||
};
|
};
|
||||||
resetStyle();
|
resetStyle();
|
||||||
|
|
||||||
@ -68,6 +70,7 @@ function parseStyle(text) {
|
|||||||
reverse,
|
reverse,
|
||||||
italic,
|
italic,
|
||||||
underline,
|
underline,
|
||||||
|
strikethrough,
|
||||||
text: processedText,
|
text: processedText,
|
||||||
start: fragmentStart,
|
start: fragmentStart,
|
||||||
end: fragmentStart + processedText.length,
|
end: fragmentStart + processedText.length,
|
||||||
@ -156,6 +159,11 @@ function parseStyle(text) {
|
|||||||
emitFragment();
|
emitFragment();
|
||||||
underline = !underline;
|
underline = !underline;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case STRIKETHROUGH:
|
||||||
|
emitFragment();
|
||||||
|
strikethrough = !strikethrough;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Evaluate the next character at the next iteration
|
// Evaluate the next character at the next iteration
|
||||||
@ -168,7 +176,7 @@ function parseStyle(text) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const properties = ["bold", "textColor", "bgColor", "hexColor", "hexBgColor", "italic", "underline", "reverse"];
|
const properties = ["bold", "textColor", "bgColor", "hexColor", "hexBgColor", "italic", "underline", "reverse", "strikethrough"];
|
||||||
|
|
||||||
function prepare(text) {
|
function prepare(text) {
|
||||||
return parseStyle(text)
|
return parseStyle(text)
|
||||||
|
@ -28,6 +28,9 @@ function createFragment(fragment) {
|
|||||||
if (fragment.underline) {
|
if (fragment.underline) {
|
||||||
classes.push("irc-underline");
|
classes.push("irc-underline");
|
||||||
}
|
}
|
||||||
|
if (fragment.strikethrough) {
|
||||||
|
classes.push("irc-strikethrough");
|
||||||
|
}
|
||||||
|
|
||||||
let attributes = classes.length ? ` class="${classes.join(" ")}"` : "";
|
let attributes = classes.length ? ` class="${classes.join(" ")}"` : "";
|
||||||
const escapedText = Handlebars.Utils.escapeExpression(fragment.text);
|
const escapedText = Handlebars.Utils.escapeExpression(fragment.text);
|
||||||
|
@ -65,6 +65,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="help-item">
|
||||||
|
<div class="subject">
|
||||||
|
<kbd class="key-all">Ctrl</kbd><kbd class="key-apple">⌘</kbd> + <kbd>S</kbd>
|
||||||
|
</div>
|
||||||
|
<div class="description">
|
||||||
|
<p>Mark all text typed after this shortcut as struck through.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="help-item">
|
<div class="help-item">
|
||||||
<div class="subject">
|
<div class="subject">
|
||||||
<kbd class="key-all">Ctrl</kbd><kbd class="key-apple">⌘</kbd> + <kbd>O</kbd>
|
<kbd class="key-all">Ctrl</kbd><kbd class="key-apple">⌘</kbd> + <kbd>O</kbd>
|
||||||
|
@ -15,6 +15,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "textwithcontrolcodes",
|
text: "textwithcontrolcodes",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -37,6 +38,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "bold",
|
text: "bold",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -48,6 +50,219 @@ describe("parseStyle", () => {
|
|||||||
expect(actual).to.deep.equal(expected);
|
expect(actual).to.deep.equal(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should parse strikethrough", () => {
|
||||||
|
const input = "\x1estrikethrough text\x1e";
|
||||||
|
const expected = [{
|
||||||
|
bold: false,
|
||||||
|
textColor: undefined,
|
||||||
|
bgColor: undefined,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: false,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: true,
|
||||||
|
text: "strikethrough text",
|
||||||
|
|
||||||
|
start: 0,
|
||||||
|
end: 18,
|
||||||
|
}];
|
||||||
|
|
||||||
|
const actual = parseStyle(input);
|
||||||
|
|
||||||
|
expect(actual).to.deep.equal(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should parse strikethrough and italics", () => {
|
||||||
|
const input = "\x1ditalic formatting \x1ewith strikethrough\x1d no italic \x1e and vanilla";
|
||||||
|
const expected = [{
|
||||||
|
bold: false,
|
||||||
|
textColor: undefined,
|
||||||
|
bgColor: undefined,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: true,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
|
text: "italic formatting ",
|
||||||
|
|
||||||
|
start: 0,
|
||||||
|
end: 18,
|
||||||
|
}, {
|
||||||
|
bold: false,
|
||||||
|
textColor: undefined,
|
||||||
|
bgColor: undefined,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: true,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: true,
|
||||||
|
text: "with strikethrough",
|
||||||
|
|
||||||
|
start: 18,
|
||||||
|
end: 36,
|
||||||
|
}, {
|
||||||
|
bold: false,
|
||||||
|
textColor: undefined,
|
||||||
|
bgColor: undefined,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: false,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: true,
|
||||||
|
text: " no italic ",
|
||||||
|
|
||||||
|
start: 36,
|
||||||
|
end: 47,
|
||||||
|
}, {
|
||||||
|
bold: false,
|
||||||
|
textColor: undefined,
|
||||||
|
bgColor: undefined,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: false,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
|
text: " and vanilla",
|
||||||
|
|
||||||
|
start: 47,
|
||||||
|
end: 59,
|
||||||
|
}];
|
||||||
|
|
||||||
|
const actual = parseStyle(input);
|
||||||
|
|
||||||
|
expect(actual).to.deep.equal(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should parse strikethrough and text colors", () => {
|
||||||
|
const input = "\x031,2text with color \x1eand strikethrough\x1e\x03";
|
||||||
|
const expected = [{
|
||||||
|
bold: false,
|
||||||
|
textColor: 1,
|
||||||
|
bgColor: 2,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: false,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
|
text: "text with color ",
|
||||||
|
|
||||||
|
start: 0,
|
||||||
|
end: 16,
|
||||||
|
}, {
|
||||||
|
bold: false,
|
||||||
|
textColor: 1,
|
||||||
|
bgColor: 2,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: false,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: true,
|
||||||
|
text: "and strikethrough",
|
||||||
|
|
||||||
|
start: 16,
|
||||||
|
end: 33,
|
||||||
|
}];
|
||||||
|
|
||||||
|
const actual = parseStyle(input);
|
||||||
|
|
||||||
|
expect(actual).to.deep.equal(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should correctly parse multiple unclosed format tokens", () => {
|
||||||
|
const input = "\x1e\x02\x1d\x033,4string with multiple unclosed formats";
|
||||||
|
const expected = [{
|
||||||
|
bold: true,
|
||||||
|
textColor: 3,
|
||||||
|
bgColor: 4,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: true,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: true,
|
||||||
|
text: "string with multiple unclosed formats",
|
||||||
|
|
||||||
|
start: 0,
|
||||||
|
end: 37,
|
||||||
|
}];
|
||||||
|
|
||||||
|
const actual = parseStyle(input);
|
||||||
|
|
||||||
|
expect(actual).to.deep.equal(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should toggle strikethrough correctly", () => {
|
||||||
|
const input = "toggling \x1eon and \x1eoff and \x1eon again\x1e";
|
||||||
|
const expected = [{
|
||||||
|
bold: false,
|
||||||
|
textColor: undefined,
|
||||||
|
bgColor: undefined,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: false,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
|
text: "toggling ",
|
||||||
|
|
||||||
|
start: 0,
|
||||||
|
end: 9,
|
||||||
|
}, {
|
||||||
|
bold: false,
|
||||||
|
textColor: undefined,
|
||||||
|
bgColor: undefined,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: false,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: true,
|
||||||
|
text: "on and ",
|
||||||
|
|
||||||
|
start: 9,
|
||||||
|
end: 16,
|
||||||
|
}, {
|
||||||
|
bold: false,
|
||||||
|
textColor: undefined,
|
||||||
|
bgColor: undefined,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: false,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
|
text: "off and ",
|
||||||
|
|
||||||
|
start: 16,
|
||||||
|
end: 24,
|
||||||
|
}, {
|
||||||
|
bold: false,
|
||||||
|
textColor: undefined,
|
||||||
|
bgColor: undefined,
|
||||||
|
hexColor: undefined,
|
||||||
|
hexBgColor: undefined,
|
||||||
|
reverse: false,
|
||||||
|
italic: false,
|
||||||
|
underline: false,
|
||||||
|
strikethrough: true,
|
||||||
|
text: "on again",
|
||||||
|
|
||||||
|
start: 24,
|
||||||
|
end: 32,
|
||||||
|
}];
|
||||||
|
|
||||||
|
const actual = parseStyle(input);
|
||||||
|
|
||||||
|
expect(actual).to.deep.equal(expected);
|
||||||
|
});
|
||||||
|
|
||||||
it("should parse textColor", () => {
|
it("should parse textColor", () => {
|
||||||
const input = "\x038yellowText";
|
const input = "\x038yellowText";
|
||||||
const expected = [{
|
const expected = [{
|
||||||
@ -59,6 +274,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "yellowText",
|
text: "yellowText",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -81,6 +297,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "yellowBG redText",
|
text: "yellowBG redText",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -103,6 +320,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: true,
|
italic: true,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "italic",
|
text: "italic",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -125,6 +343,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "test ",
|
text: "test ",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -138,6 +357,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "nice ",
|
text: "nice ",
|
||||||
|
|
||||||
start: 5,
|
start: 5,
|
||||||
@ -151,6 +371,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "RES006 ",
|
text: "RES006 ",
|
||||||
|
|
||||||
start: 10,
|
start: 10,
|
||||||
@ -164,6 +385,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "colored",
|
text: "colored",
|
||||||
|
|
||||||
start: 17,
|
start: 17,
|
||||||
@ -177,6 +399,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: " background",
|
text: " background",
|
||||||
|
|
||||||
start: 24,
|
start: 24,
|
||||||
@ -190,6 +413,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "?",
|
text: "?",
|
||||||
|
|
||||||
start: 35,
|
start: 35,
|
||||||
@ -212,6 +436,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "bold",
|
text: "bold",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -225,6 +450,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "yellow",
|
text: "yellow",
|
||||||
|
|
||||||
start: 4,
|
start: 4,
|
||||||
@ -238,6 +464,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "nonBold",
|
text: "nonBold",
|
||||||
|
|
||||||
start: 10,
|
start: 10,
|
||||||
@ -251,6 +478,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "default",
|
text: "default",
|
||||||
|
|
||||||
start: 17,
|
start: 17,
|
||||||
@ -273,6 +501,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "bold",
|
text: "bold",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -286,6 +515,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: " ",
|
text: " ",
|
||||||
|
|
||||||
start: 4,
|
start: 4,
|
||||||
@ -299,6 +529,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "bold",
|
text: "bold",
|
||||||
|
|
||||||
start: 5,
|
start: 5,
|
||||||
@ -311,7 +542,7 @@ describe("parseStyle", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should reset all styles", () => {
|
it("should reset all styles", () => {
|
||||||
const input = "\x02\x034\x16\x1d\x1ffull\x0fnone";
|
const input = "\x1e\x02\x034\x16\x1d\x1ffull\x0fnone";
|
||||||
const expected = [{
|
const expected = [{
|
||||||
bold: true,
|
bold: true,
|
||||||
textColor: 4,
|
textColor: 4,
|
||||||
@ -321,6 +552,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: true,
|
reverse: true,
|
||||||
italic: true,
|
italic: true,
|
||||||
underline: true,
|
underline: true,
|
||||||
|
strikethrough: true,
|
||||||
text: "full",
|
text: "full",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -334,6 +566,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "none",
|
text: "none",
|
||||||
|
|
||||||
start: 4,
|
start: 4,
|
||||||
@ -356,6 +589,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: "a",
|
text: "a",
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
@ -380,6 +614,7 @@ describe("parseStyle", () => {
|
|||||||
reverse: false,
|
reverse: false,
|
||||||
italic: false,
|
italic: false,
|
||||||
underline: false,
|
underline: false,
|
||||||
|
strikethrough: false,
|
||||||
text: rawString,
|
text: rawString,
|
||||||
|
|
||||||
start: 0,
|
start: 0,
|
||||||
|
@ -235,6 +235,10 @@ describe("parse Handlebars helper", () => {
|
|||||||
name: "underline",
|
name: "underline",
|
||||||
input: "\x1funderline",
|
input: "\x1funderline",
|
||||||
expected: '<span class="irc-underline">underline</span>',
|
expected: '<span class="irc-underline">underline</span>',
|
||||||
|
}, {
|
||||||
|
name: "strikethrough",
|
||||||
|
input: "\x1estrikethrough",
|
||||||
|
expected: '<span class="irc-strikethrough">strikethrough</span>',
|
||||||
}, {
|
}, {
|
||||||
name: "resets",
|
name: "resets",
|
||||||
input: "\x02bold\x038yellow\x02nonBold\x03default",
|
input: "\x02bold\x038yellow\x02nonBold\x03default",
|
||||||
|
Loading…
Reference in New Issue
Block a user