Implement permissive version of AddMarkup and use it for tips (#28204)
* Implement permissive version of ddMarkup Use permissive ddMarkup for news article input Use permissive ddMarkup for tips * Fix doc comment format
This commit is contained in:
@@ -5,9 +5,27 @@ namespace Content.Client.Message;
|
||||
|
||||
public static class RichTextLabelExt
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets the labels markup.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Invalid markup will cause exceptions to be thrown. Don't use this for user input!
|
||||
/// </remarks>
|
||||
public static RichTextLabel SetMarkup(this RichTextLabel label, string markup)
|
||||
{
|
||||
label.SetMessage(FormattedMessage.FromMarkup(markup));
|
||||
return label;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the labels markup.<br/>
|
||||
/// Uses <c>FormatedMessage.FromMarkupPermissive</c> which treats invalid markup as text.
|
||||
/// </summary>
|
||||
public static RichTextLabel SetMarkupPermissive(this RichTextLabel label, string markup)
|
||||
{
|
||||
label.SetMessage(FormattedMessage.FromMarkupPermissive(markup));
|
||||
return label;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user