0

When trying to show code in <code>, the new lines showed as spaces/tabs.

Here's what I input:

[code]k
i
l
m
[/code]

(Except <> instead of [])

And here's what I get as output:

k i l m

I've tried inserting it with JS using \n, \r, and \r\n.

Siguza
  • 21,155
  • 6
  • 52
  • 89
jado
  • 922
  • 9
  • 21

1 Answers1

1

Use <pre> tag instead of <code> tag. Check also this question/answer

Community
  • 1
  • 1
webzy
  • 249
  • 2
  • 7
  • 1
    I’d say, not necessarily “instead”, but perhaps rather “around”. `
    ` would make sense, if the content was actual “code” in some way.
    – CBroe Jul 26 '15 at 10:55
  • Yeah, especially if he has some kind of styling applied to code. – webzy Jul 26 '15 at 11:18