Ask for Help
“Facebook(or other third party service) is down, and my build is broken. What should we do about this?”
Without extensively mocking Facebook, some of our projects have separated tests that require any third parties. Then, you can accept builds even if tests from that collection fail.
“How to remove errors from validations?”
The best way to handle this is to disable the validations in question by overriding them, though in some cases it may require you to dive deeper into ActiveRecord. Most likely you want to refactor to not have to do this, and if its a plugin you’re using, modify that. Our own Socialitis project is rumored to include code to accomplish this as well.
Adam has been doing work with execCommand, which may be useful to you if you’re trying to add text editor-like features to your webpage.
If the end of your range has an empty element, surroundContents can choke. The best thing to do is programmatically alter your range when it is in this situation, or you may get an exception about a “partial selection”. Also, you’ll need to be careful to insert the right sort of node depending on the contents of your range as to not introduce invalid markup into your page.