erosson / ch2plan

Clicker Heroes 2 skill tree planner
https://ch2.erosson.org
GNU General Public License v3.0
4 stars 3 forks source link

search fails catastrophically for invalid regexes #44

Closed erosson closed 6 years ago

erosson commented 6 years ago

https://ch2.erosson.org/#?q=click works as expected. that search is a valid regex.

https://ch2.erosson.org/#?q=( fails. that search is an invalid regex. Elm cannot catch, or otherwise recover from, this error! Apparently this is a known bug, to be fixed in 0.19 (whenever that arrives), but until then any regex-from-user-input is kinda screwed.

This ruins my plan for #39, giving different regex submatches different colors. ex. (a)|(b) would color nodes matching "a" red, and nodes matching "b" but not "a" blue. it works great for valid regexes, but it's way too easy to trip over an unmatched paren while typing and have the site completely stop responding.

should do one of the following: