Femtosecond pulses of light propagating along photonic-crystal fibres can generate a broad optical supercontinuum1,2. This striking discovery has applications ranging from spectroscopy and metrology3 to telecommunication4 and medicine5,6. Among the physical principles underlying supercontinuum generation are soliton emission7, a variety of four-wave mixing processes8,9,10,11, Raman-induced soliton self-frequency shift12,13, and dispersive wave generation mediated by solitons7,13,14. Although all of the above effects contribute to supercontinuum generation, none of them can explain the generation of blue and violet light from infrared femtosecond pump pulses. In this work we argue that the most profound role in the shaping of the short-wavelength edge of the continuum is played by the effect of radiation trapping in a gravity-like potential created by accelerating solitons. The underlying physics of this effect has a straightforward analogy with the inertial forces acting on an observer moving with a constant acceleration.