Skip to content

Commit 401031a

Browse files
authored
Remove shift to prevent mutating content when running _convertGlossaryStructuredContentRecursive (#2287)
1 parent 65dae60 commit 401031a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/js/templates/anki-template-renderer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,8 @@ export class AnkiTemplateRenderer {
814814
_convertGlossaryStructuredContentRecursive(content, structuredContentGenerator) {
815815
/** @type {string[]} */
816816
const rawGlossaryContent = [];
817-
while (content.length > 0) {
818-
const structuredGloss = content.shift();
817+
for (let i = 0; i < content.length; i++) {
818+
const structuredGloss = content[i];
819819
if (typeof structuredGloss === 'string') {
820820
rawGlossaryContent.push(structuredGloss);
821821
} else if (Array.isArray(structuredGloss)) {

0 commit comments

Comments
 (0)