- Refactoring: Avoid redundant creation of text node for strings when passing to append

This commit is contained in:
Brett Zamir
2020-01-04 16:43:03 +08:00
parent 332a562876
commit 92f8a5be57
3 changed files with 6 additions and 6 deletions

View File

@@ -232,7 +232,7 @@ export default {
$(this).html(
$('<span>').append(
$('<img>').attr('src', curMeta.preview_url),
document.createTextNode(title)
title
)
);
} else {
@@ -254,7 +254,7 @@ export default {
if (curMeta && curMeta.preview_url) {
entry = $('<span>').append(
$('<img>').attr('src', curMeta.preview_url),
document.createTextNode(title)
title
);
} else {
entry = $('<img>').attr('src', response);