Hiya @RuslanDauhiala,
You can do this in a LTI 1.1 tool by returning a special type for your content item. If you send this back from your tool:
{
"@context": "http://purl.imsglobal.org/ctx/lti/v1/ContentItem",
"@graph": [
{
"@type": "lti_replace",
"mediaType": "text/html",
"text": "<h1>All your editor content</h1>....",
"placementAdvice": { "presentationDocumentTarget": "embed" }
}
]
}
Then it will replace all the existing content in the editor. By passing in the variable $com.instructure.Editor.contents in the custom launch parameters the tool can take the current contents, modify them and pass them back to the editor.
You can see this all in action in a simple app we built that allows table of contents to be automatically generated for long documents based off the headings in them.
https://www.eduappcenter.com/apps/6373