Interested in the following questions:
How are visual editors (or how to call them correctly?) In the likeness of this (WordPress)?
How is the markup stored? Many times I heard that storing HTML markup in the database is bad. Is it so? And what if this is so? How to store?
The most interesting for me is that everything can be seen exactly as it will be on the page in the end. There is no such as, for example, on the same SO. Here we can surround the word with asterisks and it will be bold after the message has been posted. But right now, typing this text, I do not see the word bold. I see him surrounded by stars.
Answers to your possible questions:
Yes, I looked at the page code. There is an
iframe
that referencesjavascript
. How it works is the question.I tried to search for the Google-like ones, but the issue is not at all what I expect. It is likely due to the fact that I incorrectly formulate the question.
Yes, I have my own thoughts on this. And the most basic one is
<div contenteditable>
. But how not to try, the maximum that it can give is the same shape as on SO. Plus, I don’t know how to send it by form. Do you really have to copy the contents of the<div>
'with JS and into<input type="hidden">
, replacing**
with<strong>
, and__
with<em>
?
In short, I apologize if this question is a duplicate, because I cannot find the answer I need.
Thank.