restore basic entities callback

Alternative to #6039 this PR add a `restoreBasicEntities` callback to `String::restoreBasicEntities`.
This make it possible to simply overwrite or extend the behavior of `String::restoreBasicEntities`.