Added support for media entities and encoded ampersands