Fixing reference to passed in attribute

$replace_with was referencing `string` instead of the passed in attribute of `newhtml`.