Simplify ankiGetFieldMarkersHtml
This commit is contained in:
parent
5339381c30
commit
774db569eb
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user