This patch adds hexadecimal entity support to ent2ncr() for the existing named entities. It adds an optional second argument, and defaults to returning the decimal entities so is fully backwards compatible.

The second patch approaches it a slightly different way. The issue with the first, is that for a block of text that is being running through ent2ncr(), all of the string replacements would still be done, even if they weren't then used in the plugin filter function. By letting the plugin short circuit the function (if something truthy is being returned from the plugin filter function, return that from ent2ncr() immediately), it improves performance.