Factor gfm escape_once into a method

The pair appears 7 times. Let's DRY that up.