?
Topic on Extension talk:SyntaxHighlight
Extension:PreToClip appears to do that. Adding a widget would be another possibility, if you're not happy with how the PreToClip extension does it. The latter option would require getting your hands dirty, though. --Ernstkm (talk) 11:51, 25 October 2023 (UTC)