How to indent lines in Discourse

I don’t think there’s a standard way of indenting text that’s not in a list. When you have a list, prefixing a line with two or more spaces indents it without a bullet or number.

  1. Thing 1
  2. Thing 2
    An indented line under Thing 2.
  3. One more thing

Prefixing a line outside of a list with four spaces turns it into code text, and prefixing it with an angle bracket makes it a quote. One or the other of those might be useful in other situations.

Code text

Quoted text

As I wrote in the original thread,

It appears that if you wrap text in HTML unordered list tags (<UL></UL>), that will indent a paragraph. There won’t be any bullets if you don’t also have a list-item (<LI>) tag in it.

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

It’s a hack - creating a list without any list items, but it seems to get the job done without creating a fixed-width-font code block or a quote block.

Of course, it really depends on your context. If your indented paragraph is meant to be a quote of something, then prefixing it with > or wrapping it in [QUOTE][/QUOTE] tags, would be better.

2 Likes

Yes, it’s also invalid HTML and might be confusing or annoying to someone using a screen reader.

Using quoted text when that’s the intended meaning of indentation is best.

Otherwise, to retain leading whitespace characters, treat the text as a block of code. If you type the text as you like, select multiple lines of text, then click the Preformatted text button in the toolbar, the editor will add “code fences” (3 back ticks) above and below the text. When rendered, leading spaces are preserved and a monospace font is used.

You can’t type a tab character in the editor but I think if you paste text in, tab characters are retained.