HTML validity check before saving code injections

Today one of my Ghost customers reported that new web analytics always shows 0 visitors, which doesn’t look realistic. When I checked that, I noticed ghost-stats.min.js file doesn’t load at all. After some debugging, it became clear that the root case is a non-closed style tag in head code injection. When you open a <style> tag and don’t close it, all of the continiues tags until closing </head> don’t work.

Since this code injection sections are open to every Ghost panel users without requiring any technical knowledge, it would be great to make basic HTML validity check before saving it to catch that kind of simple cases. Even people with HTML knowledge can miss this and it’s not easy to catch after, since it doesn’t throw any error.