Our tests in test/models/post_test.exs
Writing a Blog Engine in Phoenix and Elixir: Part 6, Markdown Support
Brandon Richey

Not all the new tests fail when you remove the escaping mechanism.

It is down to the script and iframe one, where your regex matcher does not actually match the tags, the correct regexes should be ~r{<script[^>]+>} and ~r{<iframe[^>]+>} respectively, which allows for the attributes in the aforementioned tags.