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;
if (!fragment) {
fragment = new DocumentFragment();
}
const fragment = document.createDocumentFragment();
for (const marker of markers) {
const markerNode = document.importNode(template, true).firstChild;
markerNode.querySelector('.marker-link').textContent = marker;