Skip to content

Commit

Permalink
Convert the subheader for the summary to a link to the YT experiment …
Browse files Browse the repository at this point in the history
…description on Google's support site
  • Loading branch information
FlaminSarge committed Nov 2, 2024
1 parent 724fb29 commit f1c56c1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ts/chat-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,18 @@ const parseChatSummary = (renderer: Ytc.AddChatItem, isEphemeral: boolean | unde
const baseRenderer = renderer.liveChatBannerChatSummaryRenderer!;
const runs = parseMessageRuns(renderer.liveChatBannerChatSummaryRenderer?.chatSummary.runs);
const splitRuns = splitRunsByNewline(runs, 2);
const subheader = splitRuns[1].map(run => {
if (run.type === 'text') {
return { type: 'link', text: run.text, url: 'https://support.google.com/youtube/thread/18138167?hl=en&msgid=284199217' } as Ytc.ParsedLinkRun;
} else {
return run;
}
});
const item: Ytc.ParsedSummary = {
type: 'summary',
item: {
header: splitRuns[0],
subheader: splitRuns[1],
subheader: subheader,
message: splitRuns[2],
},
icon: baseRenderer.icon && {
Expand Down

0 comments on commit f1c56c1

Please sign in to comment.