nit: use 'html/raw' instead of html() where possible

This commit is contained in:
Danny Coates 2018-02-11 14:02:40 -08:00
parent 950c9cdaeb
commit dcfda9521b
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
3 changed files with 14 additions and 11 deletions

View file

@ -1,4 +1,5 @@
const html = require('choo/html');
const raw = require('choo/html/raw');
module.exports = function(state, emit) {
const file = state.storage.getFileById(state.params.id);
@ -30,12 +31,12 @@ module.exports = function(state, emit) {
function passwordSpan(password) {
password = password || '●●●●●';
const span = html([
`<span>${state.translate('passwordResult', {
const span = html`<span>${raw(
state.translate('passwordResult', {
password:
'<pre class="passwordOriginal"></pre><pre class="passwordMask"></pre>'
})}</span>`
]);
})
)}</span>`;
const og = span.querySelector('.passwordOriginal');
const masked = span.querySelector('.passwordMask');
og.textContent = password;