I’d like to create a widget that (among other things) applies such formatting to its contents, but I can’t find any documentation on any non-wikitext way to do this. I can’t even use $wikify or a filter, since one cannot (as far as I know) pass the contents of a slot into a widget attribute or filter.
Is there any way to achieve this, aside from writing a JavaScript widget?