use the altered boldtext variable instead of the innerText property

Fixes a bug which appends extra spaces on the end of bold text segments