diff --git a/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageOptions.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageOptions.cs index a13029a5804..93faa51b4eb 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageOptions.cs @@ -49,4 +49,9 @@ public class UiMessageOptions /// Custom icon for the Cancel button. /// public object? CancelButtonIcon { get; set; } + + /// + /// Whether the message is html (true) or plain text (false) + /// + public bool IsMessageHtmlMarkup { get; set; } } diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor index 629317aea6d..9e0d86c112d 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor @@ -16,7 +16,14 @@ } - @Message + @if (!IsMessageHtmlMarkup) + { + @Message + } + else + { + @((MarkupString)Message) + } diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor.cs index 60ba8e8dd7c..1bedfea916f 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiMessageAlert.razor.cs @@ -21,6 +21,9 @@ protected virtual bool CenterMessage protected virtual bool ShowMessageIcon => Options?.ShowMessageIcon ?? true; + protected virtual bool IsMessageHtmlMarkup + => Options?.IsMessageHtmlMarkup ?? false; + protected virtual object? MessageIcon => Options?.MessageIcon ?? MessageType switch { UiMessageType.Info => IconName.Info,