I'm creating a webapp where I can present a documentation. In my documentations I often have some code snippets so I used prism (https://prismjs.com/) to format the text I enter in a textfield on the admin page.
The Problem is that whenever I enter code in the textfield it makes spaces on the first line like that:
import { Pipe, PipeTransform } from '@angular/core';
import { UserService } from '../user.service';
My code looks likt this:
Template:
<pre><code class="language-{{ subdoc.language }}">
{{ subdoc.code }}
</code></pre>
Remove the spaces/tab characters before {{ subdoc.code }}
You must be exhausted in coding. Most of the time we think the complicated coding is where something's wrong but in your case it's the HTML.
you sure know how <pre>
tag works. Now understand the difference between this
<pre><code class="language-{{ subdoc.language }}">
{{ subdoc.code }}
</code></pre>
and this
<pre><code class="language-{{ subdoc.language }}">
{{ subdoc.code }}
</code></pre>
Happy coding ;)