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.
import std.typecons : Flag, No, Yes; // See unittests of other overloads for more No.strip tests { immutable line = "hello<b>hello<b>hello"; immutable expanded = line.expandIRCTags(Yes.extendedOutgoingColours, Yes.strip); immutable expected = "hellohellohello"; assert((expanded == expected), expanded); } { immutable line = "hello<99,99<b>hiho</>"; immutable expanded = line.expandIRCTags(Yes.extendedOutgoingColours, Yes.strip); immutable expected = "hello<99,99hiho"; assert((expanded == expected), expanded); } { immutable line = "hello<1>hellohello"; immutable expanded = line.expandIRCTags(Yes.extendedOutgoingColours, Yes.strip); immutable expected = "hellohellohello"; assert((expanded == expected), expanded); } { immutable line = `hello\<h>hello<h>hello<h>hello`; immutable expanded = line.expandIRCTags(Yes.extendedOutgoingColours, Yes.strip); 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.