Content block run scripting before saving block edits

Permalink
v8.3.2
It appears that the HTML Content block runs any embedded javascript before saving the content of the block.

For instance, I have some scripting that adds an href to an anchor depending on a setting. If I make that setting True, then on editing the block again I see that the source has been updated with an added href to the anchor tag. Same thing happens if scripting modifies the href, the source is modified also.

This makes the Content block mostly useless when used with scripting.

UPDATE:
I switched everything over to the Advanced HTML block, and everything works great. I would strongly suggest that if you use scripting at all, definitely do not use the Content block. In fact, as it misinterprets the HTML5 spec, and tries to incorrectly fix things, you really do not want to use it.