Replace plain text with constant references