def pages_endash(record):
    """ Convert pages to use an html en dash
    """
    try:
        # Convert to list of page numbers
        pages = [p.strip() for p in record['pages'].split('-')
                if p.strip()]
        record['pages'] = '&ndash;'.join(pages)
    except KeyError:
        pass
    return record