tinymce / tinymce-blazor

Blazor integration
MIT License
45 stars 14 forks source link

Getting Raw Content #9

Closed net-brain closed 3 years ago

net-brain commented 3 years ago

Is there a way to get the raw content? Value seems to be the HTML content. In TinyMce there is a parameter for the GetContent() Method, but I cannot find one for blazor.

exalate-issue-sync[bot] commented 3 years ago

Ref: INT-2505

jscasca commented 3 years ago

Hi @net-brain , what do you mean by the raw content? Do you mean the Text content?

It certainly feels like the wrapper needs a way to specify the format. Maybe we need to put a GetText()? Or maybe a GetContent(string format)?

net-brain commented 3 years ago

Hi @jscasca , Yes, I mean the text. I would like to use it for a wiki and I need it to save and do some db oriented things with the text (e.g. full text index). I think GetText is better than parameter for the GetContent.

On the other side: I searched for components doing that in c#. I'm not sure where the functionality should be.

BTW: Great component! I really appreciate your work!

jscasca commented 3 years ago

So #12 adds the readonly Text parameter that allows users to either get the Text or bind the text output as follows:

<TinyMCE.Blazor.Editor @ref="Editor" @bind-Text="textVal" />
...
private string textVal = ""; // bind to var
string content = Editor.Text; // get property

Hope to have this merged soon

jscasca commented 3 years ago

@net-brain This has just been released in v0.0.4

Glad you like the component!