diff -ru nano-2.0.7/src/color.c nano-2.0.7~syntax-1/src/color.c
--- nano-2.0.7/src/color.c	2007-10-11 07:01:30.000000000 +0200
+++ nano-2.0.7~syntax-1/src/color.c	2008-06-14 20:41:22.000000000 +0200
@@ -156,6 +156,11 @@
 		    regcomp(e->ext, e->ext_regex, REG_EXTENDED);
 		}
 
+		/* Hack: try to match the first line as well
+		 * Note that extension will still override this */
+		if (regexec(e->ext, openfile->fileage->data, 0, NULL, 0) == 0)
+		    openfile->colorstrings = tmpsyntax->color;
+
 		/* Set colorstrings if we matched the extension
 		 * regex. */
 		if (regexec(e->ext, openfile->filename, 0, NULL,
