title: White space <code> and back to line
body: <p>My javascript enable to "write" in <code>&lt;code&gt;</code> (without content editable property, behind there is a hidden <code>&lt;textarea&gt;</code> and javascript catch keyboard events...) and while i'm writing in this hidden <code>&lt;textarea&gt;</code>, text goes in line and a horizontal scroll bar appear :
  <a href="https://i.stack.imgur.com/5CUUi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5CUUi.png" alt="enter image description here"></a>
  I want to prevent this and make text back to line (like default <code>&lt;textarea&gt;</code> behaviour).</p>
  
  <p>I've tried to add in my css the property <code>white-space : pre-wrap;</code> but I got this :
  <a href="https://i.stack.imgur.com/YYuhH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YYuhH.png" alt="enter image description here"></a>
  (textarea visible with red text color, to compare <code>&lt;textarea&gt;</code> behaviour and my <code>&lt;code&gt;</code>'s)</p>
  
  <p>How to fix this and make my <code>&lt;code&gt;</code> behave like a <code>&lt;textarea&gt;</code> ? Thanks for answers :)</p>