You asked:

does chocolate contain magnesium

Yes. Magnesium is a constituent substance of chocolate.
Magnesium
Magnesium
Magnesium

chocolate
chocolate
chocolate