Answer the question
In order to leave comments, you need to log in
How to make contenteditable editor in ReactJS with text conversion back to json file?
Good afternoon!
A string comes to my input, which I parse and break into lexemes, as a result I get a two-dimensional array, where each element of the array is an object that should be in the string.
Example:
[
// первая строка
[
{type: 'text', value: 'Привет'},
{type: 'tag', value: 'get_users'},
],
// вторая строка
[
{type: 'text', value: 'мир'},
],
]
<div contenteditable="true" class="textarea">
<div>Привет <span class="tag tag-blue" contenteditable="false">get_users</span></div>
<div>мир</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question