fix #1351 -- make posts with code directive only work

This is #1351.

cc @Determinant