Updated the substring regex to be more flexible, and use node.content
instead of node.inner_html so that we don't have to worry about
inconsistent HTML tags from manual editing.