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.
It is not required for this algorithm, it says so in the footnote
"Note: This kata uses the non-padding version ("=" is not added to the end)."
Well, probably not judging by the satisfaction rating ;-)
null == undefined
, so it works. :/The whole
ignoreTags
thing has so many problems I'm going to leave it atWon't happen in a four year old kata of course. :P ( Preventing accidental approvals again? )
ignoreTags
is never tested, nor nested tags.Also, needs random tests.
The initial code is wrong:
ignoreTags
are passed in asundefined
if it's absent, notnull
.This solution is really tiny but is wrong. There is no padding management
You return
egAA
but the correct value is:eg==
you are not managing the pad element `='ignoredTags is always undefined.
No test cases for inserted BBCodes
Error with provided test cases:
The error messages could use some work. I'm getting something like:
<s>Hello, World!</s>
but got
Hello,World!
...but it's really unclear what the problem is. As far as I can see, I'm giving the correct code, but the tests says not. If you could
JSON.stringify
the "expected" and "got" code, it would be much easier to see what the difference is.As long as you define the function within the test code, you'll be OK. This ensures that it is set last.
I used your compare function, although I wonder if user will be able to redefine it to always pass and break the test cases.
No need to feel stupid! This is a good Kata, it just needs refinement.
Thanks for great feedback. I feel so stupid right now.
One more thing: you need to specify that
[img]
tags that don't start withhttp
shouldn't be parsed.However, I think this is actually an incorrect limitation, since you can have a valid URL that starts with the "relative protocol" (
//
) or relative links with no protocol at all.A couple of issues that would make this a much nicer kata:
</s>
, which fails when it shouldn't[link]
bbcode, it's always been[url]
, and is[url]
on the wiki article. This is confusing, and effectively wrong.You use something like the following to handle the last case:
The reason this is important is, right now, I'm getting this error:
As you can see, that's not very helpful — I can't even tell if the issue is on my end or yours.