namespace Robust.Shared.RichText;
///
/// Extension methods for .
///
public static class FormattedStringBuilderExtensions
{
extension(FormattedStringBuilder builder)
{
///
/// Write a cmdlink tag.
///
/// The user-visible tag for the link.
/// The command executed when the user clicks.
/// The tooltip (title) when the user hovers over the link.
/// The current instance, to enable easy method call chaining.
public FormattedStringBuilder MakeCommandLinkTag(string text, string command, string? title = null)
{
builder.BeginTag("cmdlink", text);
builder.TagAttribute("command", command);
if (title != null)
builder.TagAttribute("title", title);
builder.FinishTagSelfClosed();
return builder;
}
}
}