title: How to build a lightweight online text editor?
body: <p>I want to build a lightweight online text editor like google doc, but quite quite lighter than that.</p>
  
  <p>What I mean is, I only want to realize the following three functions:</p>
  
  <ol>
  <li>input/delete characters</li>
  <li>create/delete a new line</li>
  <li>indent</li>
  </ol>
  
  <p>But I'm not quite sure how to build it.</p>
  
  <p>Here is my idea:</p>
  
  <p>Treat every line as a single div.
  Monitor the keyboard event, when user hit enter, create a new div</p>
  
  <p>According to my method, I need to set the div's contentEditable=true
  However, after that, whenever I hit enter, a newline is created inside the div.</p>
  
  <p>So, how to stop that? (can it only be solved by using javascript?)
  Or, is there any other way to achieve my goal?</p>