html: Be careful not to strip too much

If there is content between to `<style>` elements, the content was previously stripped by Format::safe_html function. This patch adjusts the regex to strip tags such as `<head>`, `<script>` and `<style>` so that if content is found between two of them, it will be preserved.

Fixes #674