String line to expand IRC tags of.
Whether or not to use extended colours (16-99).
Whether to expand tags or strip them from the input line.
The passed line but with tags expanded to formatting and colouring.
// See unit tests of other overloads for more `strip: false` tests { immutable line = "hello<b>hello<b>hello"; immutable expanded = line.expandIRCTags(extendedOutgoingColours: true, strip: true); immutable expected = "hellohellohello"; assert((expanded == expected), expanded); } { immutable line = "hello<99,99<b>hiho</>"; immutable expanded = line.expandIRCTags(extendedOutgoingColours: true, strip: true); immutable expected = "hello<99,99hiho"; assert((expanded == expected), expanded); } { immutable line = "hello<1>hellohello"; immutable expanded = line.expandIRCTags(extendedOutgoingColours: true, strip: true); immutable expected = "hellohellohello"; assert((expanded == expected), expanded); } { immutable line = `hello\<h>hello<h>hello<h>hello`; immutable expanded = line.expandIRCTags(extendedOutgoingColours: true, strip: true); immutable expected = "hello<h>hellohellohello"; assert((expanded == expected), expanded); }
Slightly more complicated, but essentially string-replaces <tags> in an outgoing IRC string with correlating formatting using IRCControlCharacters in their syntax. Overload that takes an explicit strip Flag.