Simplify ankiGetFieldMarkersHtml

This commit is contained in:
toasted-nutbread 2019-12-02 22:19:55 -05:00
parent 5339381c30
commit 774db569eb

View File

@ -178,11 +178,9 @@ function ankiFieldsToDict(elements) {
} }
function ankiGetFieldMarkersHtml(markers, fragment) { function ankiGetFieldMarkersHtml(markers) {
const template = document.querySelector('#anki-field-marker-template').content; const template = document.querySelector('#anki-field-marker-template').content;
if (!fragment) { const fragment = document.createDocumentFragment();
fragment = new DocumentFragment();
}
for (const marker of markers) { for (const marker of markers) {
const markerNode = document.importNode(template, true).firstChild; const markerNode = document.importNode(template, true).firstChild;
markerNode.querySelector('.marker-link').textContent = marker; markerNode.querySelector('.marker-link').textContent = marker;