Revert "Merge pull request #10165 from comoyo/replace_surrounding"

This reverts commit 181f88ac62bf16499653b4d1124b87adc9c85ca6, reversing
changes made to 123a145107584791355270a75317c0e1d1c700e7.
Merge pull request #10170 from davidflanagan/revertbug878843

Revert "Merge pull request #10165 from comoyo/replace_surrounding"