Support markdown in nested blocks by tracking tag depth