0

I'm building a tech blog that has code examples in the articles using Angular, Node.js and MongoDB, I'm storing the post bodies in an html format. When I store a post the code snippets indentations and line breaks are being replaced by whitespaces. I can't find a way to store them and display them the way I want.

Expectations

body {
  color: #ffffff;
}

What I get

body  {          color: #ffffff;      }

Btw I'm using Prism.js as a syntax highlighter.

sabrina
  • 41
  • 3
  • You have to find out where exactly this transformation happens. MongoDB certainly does not change any of the data you put into it. Review your code to see what might do this. If necessary sprinkle debug output around. – Thilo Feb 08 '20 at 13:41
  • Hello Sabrina. Welcome to the community! Can you provide the code you use to store and to return the code examples? – María Antignolo Feb 14 '20 at 16:28

0 Answers0