Revision: 3145 http://geany.svn.sourceforge.net/geany/?rev=3145&view=rev Author: eht16 Date: 2008-10-23 18:44:05 +0000 (Thu, 23 Oct 2008)
Log Message: ----------- Add simple auto-detection for HTML files without proper extension.
Modified Paths: -------------- trunk/ChangeLog trunk/src/filetypes.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-22 16:32:20 UTC (rev 3144) +++ trunk/ChangeLog 2008-10-23 18:44:05 UTC (rev 3145) @@ -1,3 +1,9 @@ +2008-10-23 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/filetypes.c: + Add simple auto-detection for HTML files without proper extension. + + 2008-10-22 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
* data/html_entities.tags:
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2008-10-22 16:32:20 UTC (rev 3144) +++ trunk/src/filetypes.c 2008-10-23 18:44:05 UTC (rev 3145) @@ -738,8 +738,13 @@
g_free(tmp); } + /* detect HTML files */ + if (strncmp(line, "<!DOCTYPE html", 14) == 0 || strncmp(line, "<html", 5) == 0) + { + ft = filetypes[GEANY_FILETYPES_HTML]; + } /* detect XML files */ - if (utf8_filename && strncmp(line, "<?xml", 5) == 0) + else if (utf8_filename && strncmp(line, "<?xml", 5) == 0) { /* HTML and DocBook files might also start with <?xml, so detect them based on filename * extension and use the detected filetype, else assume XML */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.