escape any carets in the page text

(cherry picked from commit 24f928f82d29f2c0edef49376f8d03aa6618005d)