# Using external filter commands to reformat HTML

> Episode of [Vimcasts](https://podistic.com/podcast/vimcasts.md) · Published February 18, 2014 · Duration 4:31

- **Listen on Podistic:** https://podistic.com/episode/using-external-filter-commands-to-reformat-html
- **Video:** http://media.vimcasts.org/videos/64/pandoc-filter.m4v (video/x-m4v)

## About this episode

We can use pandoc as a [filter](http://vimdoc.sourceforge.net/htmldoc/change.html#filter) to clean up WYSIWYG-generated HTML. Pandoc is a commandline program, but we can call it from inside Vim either using the [bang Ex command](http://vimdoc.sourceforge.net/htmldoc/various.html#:!), or by configuring [the `formatprg` option](http://vimdoc.sourceforge.net/htmldoc/options.html#\&#x27;formatprg\&#x27;) to make the `gq` operator invoke pandoc.
