main.js text formatting functions