Contempt law is against any public comment on an issue that is before the courts and is to be decided by the courts. Notice though that the issue to be decided is often a narrow one (did a person commit a particular offence), and this does not prevent public discussion of the background or wider context of the events concerned.
So, for instance, the charging of a demonstrator at an environmental action does not prevent others from criticising police operations at that demonstration, nor from talking about what the action was all about. Many lawyers advise against public comment that in any way relates to a court case.
It is not based on a fair interpretation of contempt law, nor on a proper consideration of the right to freedom of expression. Police, courts and conservative lawyers often attempt to block political expression by the threat of contempt action. This is mostly bluff.
Magistrates have no real power of contempt outside their own courtrooms, and contempt actions have generally only been laid after public comments very close to a jury trial. People are not prosecuted for proclaiming their innocence of a charge, which is their right.
As always, seek specific legal advice if you are considering making public comment that may be a contempt, as it can carry the penalty of imprisonment.