Sorry, there's nothing at this address.
10 |16 | @(JsonSerializer.Serialize(Content, new JsonSerializerOptions() { WriteIndented = true })) 17 |18 |
29 | @Content.ToHtml() 30 |31 |
16 | @ChildContent 17 |
18 | break; 19 | } 20 | 21 | 22 | @code { 23 | [Parameter] 24 | public RenderFragment ChildContent { get; set; } 25 | [Parameter] 26 | public string CssClasses { get; set; } = ""; 27 | [Parameter] 28 | public BlockTypeEnum HtmlTag { get; set; } = BlockTypeEnum.P; 29 | } -------------------------------------------------------------------------------- /SimpleTextEditor/Enums/BlockTypeEnum.cs: -------------------------------------------------------------------------------- 1 | namespace SimpleTextEditor.Enums 2 | { 3 | public enum BlockTypeEnum 4 | { 5 | H1 = 0, 6 | H2 = 1, 7 | H3 = 2, 8 | H4 = 3, 9 | H5 = 4, 10 | H6 = 5, 11 | P = 6, 12 | Ul = 7, 13 | Li = 8, 14 | Ol = 9, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SimpleTextEditor/Enums/CharacterFormatEnum.cs: -------------------------------------------------------------------------------- 1 | namespace SimpleTextEditor.Enums 2 | { 3 | [Flags] 4 | public enum CharacterFormatEnum : short 5 | { 6 | None = 0, 7 | B = 1, 8 | I = 2, 9 | U = 4 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SimpleTextEditor/Helpers/Extensions.cs: -------------------------------------------------------------------------------- 1 | using SimpleTextEditor.Enums; 2 | using SimpleTextEditor.Models; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Net.Http; 7 | using System.Text; 8 | using System.Text.Json; 9 | using System.Threading.Tasks; 10 | using static System.Reflection.Metadata.BlobBuilder; 11 | 12 | namespace SimpleTextEditor.Helpers 13 | { 14 | public static class Extensions 15 | { 16 | public static string ToHtml(this List