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: ignore karma tokens inside code blocks #547

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: remove matchAll string method for not being supported in no…
…de yet
raerpo committed May 4, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 5517a0cd18e471395962882988a0e0f79f4ad9fb
7 changes: 6 additions & 1 deletion scripts/karma.js
Original file line number Diff line number Diff line change
@@ -161,7 +161,12 @@ module.exports = robot => {
// in karma assignation.
const findTextInsideCodeBlocks = message => {
const regex = /`(.*?)`/g
return [...message.matchAll(regex)].map(el => el[0])
let matches = []
let match
Copy link
Contributor

Choose a reason for hiding this comment

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

cual es el beneficio de este let?

while ((match = regex.exec(message)) !== null) {
matches.push(match[0])
}
Comment on lines +166 to +168
Copy link
Contributor

Choose a reason for hiding this comment

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

no sería mejor usar un mecanismo tipo optional para esto?

Encuentro que darle con el while es como darse muchas vueltas

return matches
}

robot.hear(/([a-zA-Z0-9-_\.]|[^\,\-\s\+$!(){}"'`~%=^:;#°|¡¿?]+?)(\b\+{2}|-{2})([^,]?|\s|$)/g, response => {