You asked:

does chocolate contain magnesium

Yes. Magnesium is used to make chocolate.
chocolate
chocolate
chocolate

Magnesium
Magnesium
Magnesium