MDL-25754 improved tag sanitisation and fixed tag autocomplete