Replace Inline Reference of Deleted Entities with Plain Text

Along the line of discussions regarding replacing all references to an entity , conversion & deletion of entities, and search & replace, I was also wondering if it would be possible to replace in-line references to a deleted entity in rich text areas with the actual entity name prior to removing it completely.

For example, if you have an inline reference to a particular project in notes:

image

If that entity is deleted, you are left with very little information about what it was:

image

It might be helpful if one of the last steps in the deletion process is to go through and replace all references to the entity with the plain text version of the name:

image

This is helpful in cases when something is deleted (often by accident) but you only discover it later through a reference. I think it requires the search and replace functionality to be implemented but it is yet another example of how it can be helpful.