The UK government plans to legislate to reverse the impact of a Supreme Court judgment on the litigation funding industry.