Handle HTML entities in the example replace function