Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return all matching elements not just the first #922

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

dominique-pfister
Copy link
Contributor

@dominique-pfister dominique-pfister commented Apr 6, 2024

fix #921

elements.forEach((el) => {
let m;
let previousIndex = -1;
Copy link
Contributor Author

@dominique-pfister dominique-pfister Apr 6, 2024

Choose a reason for hiding this comment

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

previousIndex must be initialized inside an element's loop, not outside, or the next "empty match detection" starts at the wrong place.

@dominique-pfister dominique-pfister merged commit cd5221a into main Apr 6, 2024
8 checks passed
@dominique-pfister dominique-pfister deleted the issue-921 branch April 6, 2024 13:04
adobe-bot pushed a commit that referenced this pull request Apr 6, 2024
# [@adobe/helix-shared-indexer-v2.0.20](https://github.com/adobe/helix-shared/compare/@adobe/helix-shared-indexer-v2.0.19...@adobe/helix-shared-indexer-v2.0.20) (2024-04-06)

### Bug Fixes

* return all matches not just the first ([#922](#922)) ([cd5221a](cd5221a))
@adobe-bot
Copy link

🎉 This PR is included in version @adobe/helix-shared-indexer-v2.0.20 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[indexer] match will only return the first matching item
3 participants