Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tara Pickles 2 posts 92 karma points
    Nov 08, 2018 @ 10:55
    Tara Pickles
    0

    Creating a new paragraph in text

    Hello. I am working on an existing website with an Umbraco CMS. I would like to start a new paragraph in a text block but although I am adding a carriage return it is not showing on the website. How do I do this?

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Nov 08, 2018 @ 16:11
    Dan Diplo
    0

    I'm afraid it depends on what field type you are using and also how the developers who built the site implemented this.

    If you are using the rich-text editor (ie. an editor with icons above it that you can use to format text, make bold etc like Word) then simply hitting Enter will create a new paragraph. The rich-text editor takes care of turning newlines into the correct HTML paragraph tags.

    However, if you are using a plain-text textbox that has no formatting options then hitting Enter will just create a newline character. Now, by default in HTML, newlines are ignored - they aren't part of how an HTML document is formatted.

    So adding a carriage return in a plain text editor won't result in a paragraph - it will be ignored - which is what you are experiencing. For this to work the people who built your site will need to do one of these things:

    • Give you a rich-text editor instead
    • Convert, in code, newlines to HTML <br> tags
    • Use some CSS - white-space: pre-line - that makes HTML treat newlines as breaks
  • Tara Pickles 2 posts 92 karma points
    Nov 08, 2018 @ 16:12
    Tara Pickles
    100

    That's great and very helpful. Many thanks Dan

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies