Seems like a bug in Nokogiri when creating new elements. Works by setting the inner_html instead