Why does changing HTML destroy anchor href attribute?

I’m trying to build a custom menu where hovering over an item changes its colour. My issue is that changing $w.Text.html after setting it once seems to incur different sanitisation rules and the href attribute of the anchor is removed, obviously meaning the link points nowhere when clicked.

$w.onReady(function ()
{
$w(‘#test’).html = ‘

Hover over me

’; //link works as expected

$w('#test').onMouseIn((e, $w) => { 
	$w('#test').html = $w('#test').html.replace('green', 'red'); 
	console.log($w('#test').html); 
}); //when called link is broken 

});

This prints what I’d expect (below), however browser inspection tools reveal the href attribute is no longer present.

Hover over me

Currently I’m using two links of different colours and showing/hiding appropriately, but this has its own issues because the cursor can easily leave the area before the element is swapped and so mouseOut is never called to swap them back.

Many thanks.

At some point over the last year or so, this bug got fixed. Hooray.