mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 20:12:12 +00:00
feat(parser): Add LiveChatBannerChatSummary node, update TextRun node (#809)
* feat(parser): add `LiveChatBannerChatSummary` node * feat(TextRun): add `deemphasize` property * chore: npm run build:parser-map
This commit is contained in:
@@ -8,6 +8,7 @@ export default class TextRun implements Run {
|
||||
bold: boolean;
|
||||
italics: boolean;
|
||||
strikethrough: boolean;
|
||||
deemphasize: boolean;
|
||||
attachment;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
@@ -15,6 +16,7 @@ export default class TextRun implements Run {
|
||||
this.bold = Boolean(data.bold);
|
||||
this.italics = Boolean(data.italics);
|
||||
this.strikethrough = Boolean(data.strikethrough);
|
||||
this.deemphasize = Boolean(data.deemphasize);
|
||||
|
||||
if (Reflect.has(data, 'navigationEndpoint')) {
|
||||
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
|
||||
@@ -33,6 +35,7 @@ export default class TextRun implements Run {
|
||||
if (this.bold) tags.push('b');
|
||||
if (this.italics) tags.push('i');
|
||||
if (this.strikethrough) tags.push('s');
|
||||
if (this.deemphasize) tags.push('small');
|
||||
|
||||
const escaped_text = escape(this.text);
|
||||
const styled_text = tags.map((tag) => `<${tag}>`).join('') + escaped_text + tags.map((tag) => `</${tag}>`).join('');
|
||||
|
||||
Reference in New Issue
Block a user