Skip to content

Commit f651b9c

Browse files
dimodiDimo Dimov
andauthored
docs: Document Editor inline content insertion (#573)
* docs: Document Editor inline content insertion * docs: Document single node requirement Co-authored-by: Dimo Dimov <[email protected]>
1 parent b54ceb2 commit f651b9c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

components/editor/built-in-tools.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,9 @@ There are commands without built-in tools, but can be [executed programmatically
420420
<td>Insert HTML</td>
421421
<td>insertHTML</td>
422422
<td>N/A</td>
423-
<td>Insert HTML to the Editor component content area at the cursor position. <br />NOTE: this is a block command, so if you pass an inline element to it, it will be wrapped in a block element such as <code>p</code> or <code>div</code>, depending on the context. There are specific commands for creating links and images (two common inline elements).</td>
423+
<td>Inserts HTML at the cursor position. To insert multiple nodes, wrap them in a single element.<br />By default this is a block command that will wrap passed inline content in a <code>p</code> or <code>div</code>, depending on the context. To insert inline content, set the third argument to <code>true</code>. There are separate commands for inserting links and images.</td>
424424
<td>N/A</td>
425-
<td>new HtmlCommandArgs(string commandName, string value)</td>
425+
<td>new HtmlCommandArgs(string commandName, string value, bool inline)</td>
426426
</tr>
427427
</tbody>
428428
</table>
@@ -446,7 +446,7 @@ In order to do so you need to use the [Editor reference]({%slug editor-overview%
446446
<TelerikButton OnClick="@BoldText">Create bold text</TelerikButton>
447447
<TelerikButton OnClick="@InsertTable">Insert Table</TelerikButton>
448448
<TelerikButton OnClick="@InsertImage">Insert Image</TelerikButton>
449-
449+
<TelerikButton OnClick="@InsertInlineText">Insert Inline Text</TelerikButton>
450450
451451
<TelerikEditor @ref="@TheEditor" @bind-Value="@TheContent"></TelerikEditor>
452452
@@ -460,6 +460,11 @@ In order to do so you need to use the [Editor reference]({%slug editor-overview%
460460
await TheEditor.ExecuteAsync(new HtmlCommandArgs("insertHtml", "<hr />"));
461461
}
462462
463+
async Task InsertInlineText()
464+
{
465+
await TheEditor.ExecuteAsync(new HtmlCommandArgs("insertHtml", "John Doe", true));
466+
}
467+
463468
async Task InsertImage()
464469
{
465470
await TheEditor.ExecuteAsync(new ImageCommandArgs("https://demos.telerik.com/blazor-ui/images/articles/1-220x140.png", "the alt text", "220px", "140px"));

0 commit comments

Comments
 (0)