Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I've properly checked your code now that I'm on a pc, check my updated answer.
This is the input that makes your code fail:
strip_comments('apples, pears # and bananas\ngrapes\nbananas !#apples', ['#', '!'])
Use this to see what your code is doing.
I ran your code against the codewars test and observed the input and it wasn't what you showed, and your code did absolutely fail that test, which I confirmed by hand and not only through the cw test message.
You're also not running the same test case as the one that codewars is running when it gives you a fail. (And if you had to guess the input instead of finding out what it was, then you're already aware of this to some degree)
Your code fails when there is more than one marker in the same line. Not a kata issue.
Please read the description again, carefully.