I want to insert a non-paragraph text right where the cursor is.
The easiest example is explains how to insert a new paragraph.
var oDocument = Api.GetDocument();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("Hello world!");
oDocument.InsertContent([oParagraph]);
The issue with inserting a new paragraph is that it pushes the next text to a new line, and does not follow the same style.
I saw the Api.CreateInlineLvlSdt().AddText() function but that needs to be inserted to a paragraph and I haven’t found how to detect current paragraph.
Unfortunately, there’s no way to achieve it, this is a known bug and we are working on it already. I will update this thread when we have something to share.
As for scenario of avoiding pushing text to next line, we are checking the situation.
@Alexandre in an ideal world, it would be awesome to have an API like this:
var oDocument = Api.GetDocument();
var span = Api.CreateInlineText();
span.AddText("Hello");
var who = Api.CreateInlineText();
who.AddText(" world!");
oDocument.InsertContent([span, who]);