SimpleTextEditor 1.3.7
dotnet add package SimpleTextEditor --version 1.3.7
NuGet\Install-Package SimpleTextEditor -Version 1.3.7
<PackageReference Include="SimpleTextEditor" Version="1.3.7" />
paket add SimpleTextEditor --version 1.3.7
#r "nuget: SimpleTextEditor, 1.3.7"
// Install SimpleTextEditor as a Cake Addin
#addin nuget:?package=SimpleTextEditor&version=1.3.7
// Install SimpleTextEditor as a Cake Tool
#tool nuget:?package=SimpleTextEditor&version=1.3.7
Simple Text Editor
Simple Text Editor is a bare-bones text editor component for Blazor written completely in C#, with no javascript interop!
It allows for basic formatting and setting block paragraph types.
Simple Text Editor is still in early stages of development so may contain bugs.
Installation
Install via Nuget Package Manager.
Setup
Make sure that in your index.html or app.razor file (for Blazor Web Apps) has a reference to {Assembly name}.styles.css so it can use scoped styles in this package.
@using SimpleTextEditor;
<TextEditor @bind-Blocks="Content"></TextEditor>
@code{
public List<SimpleTextBlock> Content { get; set; }
}
Use
The text editor will populate List of objects of type SimpleTextBlock. Think of SimpleTextBlocks as paragraphs.
Each SimpleTextBlock contains a BlockType field of type List<SimpleTextCharacter>
, and a BlockType, which specifies the paragraph formatting (e.g. H1, H2, P).
Each SimpleTextCharacter has a Content field specifying the character, and a Format field (i.e. Underline, Bold, Italic).
This List<SimpleTextBlock>
object will be populated in realtime as the text is edited and formatted.
To extract your HTML or JSON, simply use the provided extension methods .ToHtml() or .ToJson() at the end of the list object variable.
Contributing
Please do contribute to this rich text editor and feel free to submit pull requests.
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.