# Add a New Line instead of a New Paragraph in the Editor when Pressing Enter Key

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Telerik UI for ASP.NET MVC Editor</td>
 </tr>
 <tr>
  <td>Progress Telerik UI for ASP.NET MVC version</td>
  <td>2024.4.1112</td>
 </tr>
</table>

## Description

How can I configure the Editor to add a new line instead of a paragraph when pressing the Enter key?

## Solution

By default, the Editor adds a paragraph (`p` element) when the focus is in the Editor's content area and you press the `Enter` key. Pressing `Shift + Enter` adds a new line (`br` element). You can reverse the default behavior by customizing the Editor's tools.

1. Add a script that customizes the `insertLineBreak` and `insertParagraph` tools. As a result, a new line is added when pressing the `Enter` key, and a paragraph is inserted by pressing `Shift + Enter`.
2. Declare the Editor after the script tag with the custom logic.

```JS script
    <script>
        var editorNS = kendo.ui.editor,
            registerTool = editorNS.EditorUtils.registerTool,
            Tool = editorNS.Tool;
        registerTool("insertLineBreak", new Tool({ key: 13, command: editorNS.NewLineCommand }));
        registerTool("insertParagraph", new Tool({ key: 13, shift: true, command: editorNS.ParagraphCommand }));
    </script>
```

```Razor HtmlHelper
    @(Html.Kendo().Editor()
      .Name("Editor")
      .HtmlAttributes(new { style = "height:300px" })
      .Value(@<text>
            <p>
               Some content
            </p>
      </text>)
    )
```

## More ASP.NET MVC Editor Resources

* [ASP.NET MVC Editor Documentation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/editor/overview)

* [ASP.NET MVC Editor Demos](https://demos.telerik.com/aspnet-mvc/editor/index)

* [ASP.NET MVC Editor Product Page](https://www.telerik.com/aspnet-mvc/editor)

* [Telerik UI for ASP.NET MVC Video Onboarding Course (Free for trial users and license holders)](https://www.telerik.com/aspnet-mvc/documentation/getting-started/video-onboarding)

* [Telerik UI for ASP.NET MVC Forums](https://www.telerik.com/forums/aspnet-mvc)

## See Also

* [Client-Side API Reference of the Editor for ASP.NET MVC](https://docs.telerik.com/kendo-ui/api/ui/editor)

* [Server-Side API Reference of the Editor for ASP.NET MVC](https://docs.telerik.com/aspnet-mvc/api/editor)

* [Telerik UI for ASP.NET MVC Breaking Changes](https://www.telerik.com/aspnet-mvc/documentation/backwards-compatibility/2024-backwards-compatibility)

* [Telerik UI for ASP.NET MVC Knowledge Base](https://docs.telerik.com/aspnet-mvc/knowledge-base)
