We should be able to do some basic identification by content as well.  libmagic, for example, has these rules for HTML:

```
# sgml:  file(1) magic for Standard Generalized Markup Language
# HyperText Markup Language (HTML) is an SGML document type,
# from Daniel Quinlan (quinlan@yggdrasil.com)
# adapted to string extenstions by Anthon van der Neut <anthon@mnt.org)
0	search/4096/cWt	\<!doctype\ html	HTML document text
!:mime	text/html
!:strength + 5
0	search/4096/cwt	\<head			HTML document text
!:mime	text/html
!:strength + 5
0	search/4096/cwt	\<title			HTML document text
!:mime	text/html
!:strength + 5
0	search/4096/cwt	\<html			HTML document text
!:mime	text/html
!:strength + 5
0	search/4096/cwt	\<script 		HTML document text
!:mime	text/html
!:strength + 5
0	search/4096/cwt	\<style 		HTML document text
!:mime	text/html
!:strength + 5
0	search/4096/cwt	\<table			HTML document text
!:mime	text/html
!:strength + 5
0	search/4096/cwt	\<a\ href=		HTML document text
!:mime	text/html
!:strength + 5
```