markdown/headers: check if we are really in a valid header

fixes issue #36.