fix(aio): trim code blocks before rendering
This commit is contained in:
committed by
Pete Bacon Darwin
parent
e4c3882a81
commit
34a1990c57
@@ -23,7 +23,7 @@ const copiedLabel = 'Copied!';
|
||||
@Component({
|
||||
selector: 'aio-code',
|
||||
template: `
|
||||
|
||||
|
||||
<pre class="prettyprint lang-{{language}}">
|
||||
<button class="material-icons copy-button" (click)="doCopy()">content_copy</button>
|
||||
<code class="animated fadeIn" #codeContainer></code>
|
||||
@@ -72,6 +72,8 @@ export class CodeComponent implements OnChanges {
|
||||
ngOnChanges() {
|
||||
if (!this.code) { return; }
|
||||
|
||||
this.code = this.code.trim();
|
||||
|
||||
const linenums = this.getLinenums();
|
||||
|
||||
this.setCodeHtml(this.code); // start with unformatted code
|
||||
|
||||
Reference in New Issue
Block a user