add code directive to code block

(cherry picked from commit b10d82e9f56f65d155ff6cd437c020ffa2dfb74f)