Skip to content

Commit 3a7cae6

Browse files
committed
fix: handling of array index
1 parent a0fa351 commit 3a7cae6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,9 @@ async function renderValue(node, data, placeholder, renderAs, renderedNode, inde
615615
let value;
616616
try {
617617

618-
if (match[1] === 'index' && index >= 0) { // {[]} - Dot-notation
618+
if (match[1] === 'index' && index >= 0) { // {{index}} - index
619619
value = index
620+
match[0] = '{{' + match[1] + '}}'
620621
} else if (match[1].startsWith('[') && match[1].endsWith(']')) { // {[]} - Dot-notation
621622
match[1] = match[1].slice(1, -1);
622623
value = getRenderValue(node, data, match[1], renderAs);

0 commit comments

Comments
 (0)