How can I modify the html outputted from the html filter?

Creating a slider using the following code:

{% for slide in page.header.slides %}
<li>{{[slide.image].html('', slide.description) }}</li>
{% endfor %}

I’d like to add a style to the img tags. Is there documentation on how to do this?

Just target it with CSS: ul li img, optionally adding a class to the unordered list like <ul class="mylist"> and target it with .mylist li img.

I’m actually already doing that. I considered it a workaround, though, and wondered if I was missing something obvious.

So this really is the best way?

You can’t modify the .html output, but you can create your own HTML tag and simply use the .url method for the URL part.

If your goal is to style the images with CSS, then targeting them with CSS-specificity is the way to go. It is not a workaround, but could be semantically “clearer” if you were to assign a class to the image itself and target that. The end result is the same, though.