I am trying to write a very simple wysiwyg editor where users can simply add bold text, hyperlinks and markers, after selecting part of the text. In fact, like CKEditor.
But as far as I know, there is no way to add formatting to the text box. Therefore, I would like to know how other wysiwyg editors like CKEditor solve it.
Browser-based WYSIWYG editors work by generating HTML code for the document / text you are editing. In other words, you are essentially editing the HTML inside the browser, not the text in TEXTAREA. You might want to take a look at the source code for Rich Text Editor and check out the Mozilla Midas Specification before you start writing everything from scratch.
TEXTAREA
Well, that doesn't answer the question of how they do it, but you can apply style to the text area. Just try:
<textarea style="font-weight:bold;"> </textarea>
, , CKEditor, , javascript css, <div> <textarea>. MS AJAX. , CKEditor, , <div>.
<div>
<textarea>
contenteditable. Google
WYSIWYG, TinyMCE, JavaScript, , textarea html .
What the javascript editor really does is add the appropriate html tags, such as <b> or <i> to the content of the text.
Therefore, when you send the contents of the WYSIWYG editor to the server, you usually get html.
Source: https://habr.com/ru/post/1756286/More articles:Sending a message in a C # Windows application - c #Unable to set Response object in ASP Classic - asp-classicWhat is the internal structure of the XML Builder XML file? - iphoneReading Java without blocking - javaSVN check / commit error - svnTXT records in dnsPython - dnsWhat is the inverse display function when processing images? - image-processingCan anyone recommend a DataMatrix decoding library? - .netEmacs GUI for Mac, linux and windows - ruby-on-railsPut the div after another, but still showing higher? - javascriptAll Articles