Copy math from Wikipedia

What is the best way to copy and paste text containing formulas from Wikipedia, e.g. Henstock–Kurzweil integral - Wikipedia ?

The naïve approach gives raw mediawiki text.

{\displaystyle f(x)={\frac {1}{x}}\sin \left({\frac {1}{x^{3}}}\right).}f(x)={\frac  {1}{x}}\sin \left({\frac  {1}{x^{3}}}\right).
This function has a singularity at 0, and is not Lebesgue integrable. However, it seems natural to calculate its integral except over the interval [−ε, δ] and then let ε, δ → 0.