No worries at all so happy you have it sorted.
The problems is that you are unconditionally doing the replace and that is fiddling with stuff downstream, a minimal fix would be only to perform the replace it fhe (c) is actually there, that said I would recommend against this hack anyway and do this in markdown prettify. ™
Back in the day we disabled this replacement here:
What you want is some sort of plugin that re-enables it.