Content string.
Reference string into which to save the emote list.
bool[dstring] associative array of channel-specific custom emotes.
bool[dstring] associative array of global custom emotes.
bool[dstring] customEmotes = [ ":tf:"d : true, "FrankerZ"d : true, "NOTED"d : true, ]; bool[dstring] customGlobalEmotes = [ "KEKW"d : true, "NotLikeThis"d : true, "gg"d : true, ]; { enum content = "come on its easy, now rest then talk talk more left, left, " ~ "right re st, up, down talk some rest a bit talk poop :tf:"; string emotes; embedCustomEmotes(content, emotes, customEmotes, customGlobalEmotes); enum expectedEmotes = ";tf;:113-116"; assert((emotes == expectedEmotes), emotes); } { enum content = "NOTED FrankerZ NOTED NOTED gg"; string emotes; embedCustomEmotes(content, emotes, customEmotes, customGlobalEmotes); enum expectedEmotes = "NOTED:0-4/FrankerZ:7-14/NOTED:17-21,23-27/gg:32-33"; assert((emotes == expectedEmotes), emotes); } { enum content = "No emotes here KAPPA"; string emotes; embedCustomEmotes(content, emotes, customEmotes, customGlobalEmotes); enum expectedEmotes = string.init; assert((emotes == expectedEmotes), emotes); }
Embeds custom emotes into the emotes string passed by reference, so that the PrinterPlugin can highlight content with colours.
This is called in postprocess.