How to make syntax highlighting of html markup language in samopisnom editor?

I'm not interested in already made text editor(have tried to understand how they were doing but got lost)
I would like to know the solution algorithm for this problem and subproblems.
I have a textarea on the page.itEditor. All these elements, I assign a new property initEditor which initialisere editor. In my panel there is a button that inserts a Code block
<code lang="html">//add code here
</code>

Much further to walk?
September 19th 19 at 12:10
1 answer
September 19th 19 at 12:12
well, in the textarea in General lighting will not do.
all the modern WYSIWYG editors are made on the principle of substitution of normal textarea block in which to insert the markup (i.e. normal div) and the focus in this unit, the script focuses in the textarea. Thus, typing characters, we take them in fact in a hidden textarea and they are duplicated in the div that is visible. Well, in div'is, you can highlight the text to wrap any span, including those which specify the color.
I enter in the textarea markup(code) I have a preview button which displayed the block with markup and everything in sight, cleared to break and to style code so it was lit, I don't need yet WYSIWYG)) - juwan.Kovacek commented on September 19th 19 at 12:15

Find more questions by tags JavaScriptHTML