Replacing snippet code with preview item