Add simple auto-detection for HTML files without proper extension.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3145 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
96b28080a6
commit
57c764867c
@ -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:
|
||||
|
@ -738,8 +738,13 @@ static GeanyFiletype *find_shebang(const gchar *utf8_filename, const gchar *line
|
||||
|
||||
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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user