diff --git a/packages/labextension/src/widget.ts b/packages/labextension/src/widget.ts index c1055d5b..7be02006 100644 --- a/packages/labextension/src/widget.ts +++ b/packages/labextension/src/widget.ts @@ -239,9 +239,11 @@ namespace Private {
`; + (node.getElementsByClassName("nbdime-header-base")[0] as HTMLSpanElement).innerText = baseLabel; + (node.getElementsByClassName("nbdime-header-remote")[0] as HTMLSpanElement).innerText = remoteLabel; return new Widget({node}); } diff --git a/packages/nbdime/src/common/util.ts b/packages/nbdime/src/common/util.ts index 9d118c7e..7704246a 100644 --- a/packages/nbdime/src/common/util.ts +++ b/packages/nbdime/src/common/util.ts @@ -298,7 +298,7 @@ function buildSelect(options: string[], select?: HTMLSelectElement): HTMLSelectE } for (let option of options) { let opt = document.createElement('option'); - opt.value = opt.innerHTML = option; + opt.value = opt.innerText = option; select.appendChild(opt); } return select; diff --git a/packages/webapp/src/app/diff.ts b/packages/webapp/src/app/diff.ts index edc6a2dc..b32c672d 100644 --- a/packages/webapp/src/app/diff.ts +++ b/packages/webapp/src/app/diff.ts @@ -180,11 +180,14 @@ function onDiffRequestCompleted(data: any) { */ function onDiffRequestFailed(response: string) { console.log('Diff request failed.'); - let root = document.getElementById('nbdime-root'); + const root = document.getElementById('nbdime-root'); if (!root) { throw new Error('Missing root element "nbidme-root"'); } - root.innerHTML = '' + response + ''; + const pre = document.createElement('pre'); + pre.innerText = response; + root.innerHTML = ''; + root.appendChild(pre); diffWidget = null; toggleSpinner(false); } diff --git a/packages/webapp/src/app/merge.ts b/packages/webapp/src/app/merge.ts index 22941ab9..00856c19 100644 --- a/packages/webapp/src/app/merge.ts +++ b/packages/webapp/src/app/merge.ts @@ -179,7 +179,10 @@ function onMergeRequestFailed(response: string) { if (!root) { throw new Error('Missing root element "nbidme-root"'); } - root.innerHTML = '
' + response + ''; + const pre = document.createElement('pre'); + pre.innerText = response; + root.innerHTML = ''; + root.appendChild(pre); mergeWidget = null; toggleSpinner(false); }