The current implementation is using the heading name as the # locator. Let this implementation be intact. But when the user is going to use any heading as a link, we need to start maintaining a mapping between that link and its # locator. From that point on, we need not change the # locator based on the heading name change(even if the heading is deleted). Please note that in the link pop up modal, we are only showing the heading name in the drop down, hence the UI will also stay unaffected. This solution will also not hinder our Block level styling customization. If we agree on this requirement, I will bring this to our requirement review where we can discuss the other impact areas for this change like migration and how we can accommodate this request with the "Link to paragraph of other articles" feature.