Answer the question
In order to leave comments, you need to log in
How to convert text in google docs to your custom editor?
Good afternoon. The task is to write an editor that will understand links, bold, italics, etc., which are added via Google docs.
That is, it turns out that we added, for example, a test text - which will be a bold link and, in addition, in italics in Google Dock, then copy the entire line and paste it into our editor, this word should be the same link, bold with italics as in Google Docks.
As a text input field, I use div with the contenteditable attribute
. The difficulty arises in the fact that there are a lot of different cases, they are just dark, like Google, depending on the indentation or highlighting of the word, wraps the email.
For example, a link, it can be in the following form
<a><span style="font-weight:bold">Text</span></a>
<a style="font-weight:bold">Text</a>
<span style="font-weight:bold"><a>Text</a></span>
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