kylebakerio / mindseal

next-gen cross-platform open-source buzzword-happy SRS
http://mindseal.kylebaker.io
2 stars 1 forks source link

special characters in deck title breaks ability to add cards #126

Open kylebakerio opened 8 years ago

kylebakerio commented 8 years ago

"Uncaught Error: Syntax error, unrecognized expression: #!test-front"

the CSS classes for the front/back text fields use the deck name. Either we filter those out there, or we don't allow them in deck names. The only bug I see in filtering them out in the conversion to classname is if two very similar decks are used by a user at the same time. I think we could avoid this if we just make sure that you can only be adding cards to one deck at a time? (Is that ideal, though?)

kylebakerio commented 8 years ago

borrow from arc, using regex filtering of special characters. perhaps keep an array of original strings used to verify there isn't a duplicate, and if there is, add the index number to it at the end (then reverify dupilcate of that doesn't exist, and run up a loop of a second number until you find one that doesnt... ugh)?

kylebakerio commented 8 years ago

Should also validate deck names before allowing them to be created, alerting the user if forbidden characters are being used.