The spurious characters are not there in the pico engine developer UI Logging tab for the same events.
The newline characters always seem to be within the html attribute, specifically at the start and end of its string value. JSON does not allow a newline character inside a string value, and this causes some other failures.