It appears that when using the set attribute value functionality within an HTML element, the content to be written to the attribute is not appropriately encoded as an attribute.
Write a test for this suspected bug and if it is real, it must be fixed.