Insert tag_name vars in insert_tag instead of in extract_tag.

This fixes the issue where the variable being inserted in the rare case where
the delimiter is found but the value is empty.