fix(aio): trim code blocks before rendering

This commit is contained in:
Peter Bacon Darwin
2017-04-01 21:16:22 +01:00
committed by Pete Bacon Darwin
parent e4c3882a81
commit 34a1990c57
2 changed files with 19 additions and 1 deletions
+3 -1
View File
@@ -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