Heat the oil in a large nonstick frying pan over moderate heat. Add the onions and garlic and sprinkle with the sugar and a pinch of salt. Cover and cook, stirring frequently, for 20 minutes or until the onion is very soft.
Meanwhile, cook the pasta in a large saucepan of boiling water according to the packet directions, until firm-tender. Drain the pasta, reserving 160ml of the cooking liquid, and transfer to a large serving bowl.
Stir the Marsala into the onions and cook for 1 minute or until evaporated. Add the stock and the reserved cooking liquid, and cook, stirring frequently, for 5 minutes or until the liquid is reduced by half.
Add the onions, butter and parsley to the hot pasta, tossing well to combine.