Skip to content

fix: use parsed integer num instead of rawNum in repeat helper loop#128

Open
sh1vam31 wants to merge 1 commit intojoplin:masterfrom
sh1vam31:fix/repeat-helper-use-parsed-num_#124
Open

fix: use parsed integer num instead of rawNum in repeat helper loop#128
sh1vam31 wants to merge 1 commit intojoplin:masterfrom
sh1vam31:fix/repeat-helper-use-parsed-num_#124

Conversation

@sh1vam31
Copy link
Copy Markdown
Contributor

@sh1vam31 sh1vam31 commented Feb 20, 2026

Fixes #124

In src/helpers/repeat.ts, the repeat helper was using rawNum (a raw string) instead of num (the parsed integer) in the for loop condition.

After fix :
image

Problem

// Bug: rawNum is a string
for (let i = 0; i < rawNum; i++) {

Copy link
Copy Markdown
Collaborator

@nishantwrp nishantwrp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a unit test that fails without this change as well

@alondmnt
Copy link
Copy Markdown
Collaborator

Hey @sh1vam31, just a friendly reminder on the requested test: a case where the input is a non-numeric string (e.g., "abc") should suffice, since that's where rawNum and num diverge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

repeat helper uses unparsed rawNum instead of parseInt-parsed num in loop condition

3 participants