using System; using System.Text.RegularExpressions; using MLEM.Font; namespace MLEM.Formatting.Codes { /// public class FontCode : Code { private readonly Func font; /// public FontCode(Match match, Regex regex, Func font) : base(match, regex) { this.font = font; } /// public override GenericFont GetFont(GenericFont defaultPick) { return this.font?.Invoke(defaultPick); } /// public override bool EndsHere(Code other) { // turning a string bold/italic should only end when that specific code is ended using SimpleEndCode return false; } } }