Replace \n in stateDiagram transition labels, sequenceDiagram notes, and graph edge labels — these are not valid in those contexts and cause diagrams to fail to render. Also replace Unicode × and → with plain ASCII equivalents to avoid parser issues.