mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-11 04:53:51 -05:00
Remove {{ }} from detecting htmldjango, #560
This commit is contained in:
@@ -378,7 +378,7 @@ func! polyglot#DetectHtmlFiletype()
|
|||||||
endif
|
endif
|
||||||
for lnum in range(1, min([line("$"), 50]))
|
for lnum in range(1, min([line("$"), 50]))
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
if line =~# '{{.*}}\|{%-\=\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\(\<\|\>\)\|{#\s\+'
|
if line =~# '{%-\=\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\(\<\|\>\)\|{#\s\+'
|
||||||
set ft=htmldjango | return
|
set ft=htmldjango | return
|
||||||
endif
|
endif
|
||||||
if line =~# '\(\<\|\>\)DTD\s\+XHTML\s'
|
if line =~# '\(\<\|\>\)DTD\s\+XHTML\s'
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ rules:
|
|||||||
filetype: mason
|
filetype: mason
|
||||||
- lines: 50
|
- lines: 50
|
||||||
rules:
|
rules:
|
||||||
- pattern: '{{.*}}|{%-?\s*(end.*|extends|block|macro|set|if|for|include|trans)\b|{#\s+'
|
- pattern: '{%-?\s*(end.*|extends|block|macro|set|if|for|include|trans)\b|{#\s+'
|
||||||
filetype: htmldjango
|
filetype: htmldjango
|
||||||
- pattern: '\bDTD\s+XHTML\s'
|
- pattern: '\bDTD\s+XHTML\s'
|
||||||
filetype: xhtml
|
filetype: xhtml
|
||||||
|
|||||||
@@ -364,12 +364,14 @@ call TestExtension("tt2html", "html.tt2", "<html>")
|
|||||||
call TestExtension("html", "empty.html", "")
|
call TestExtension("html", "empty.html", "")
|
||||||
call TestExtension("mason", "mason1.html", "% my $planet = 42;")
|
call TestExtension("mason", "mason1.html", "% my $planet = 42;")
|
||||||
call TestExtension("mason", "mason2.html", "<%filter></%filter>")
|
call TestExtension("mason", "mason2.html", "<%filter></%filter>")
|
||||||
call TestExtension("htmldjango", "jinja1.html", "{{ item.href }}")
|
|
||||||
call TestExtension("htmldjango", "jinja2.html", "{% for item in navigation %}{% endfor %}")
|
call TestExtension("htmldjango", "jinja2.html", "{% for item in navigation %}{% endfor %}")
|
||||||
call TestExtension("htmldjango", "jinja3.html", "{% block head %}")
|
call TestExtension("htmldjango", "jinja3.html", "{% block head %}")
|
||||||
call TestExtension("htmldjango", "jinja4.html", "{# some comment #}")
|
call TestExtension("htmldjango", "jinja4.html", "{# some comment #}")
|
||||||
call TestExtension("xhtml", "xhtml.html", "<DTD XHTML ")
|
call TestExtension("xhtml", "xhtml.html", "<DTD XHTML ")
|
||||||
|
|
||||||
|
" many html templates use {{ }}, e.g. Angular, we should not assume django
|
||||||
|
call TestExtension("html", "template.html", "{{ item.href }}")
|
||||||
|
|
||||||
" .gitignore
|
" .gitignore
|
||||||
call TestExtension("gitignore", ".gitignore", "")
|
call TestExtension("gitignore", ".gitignore", "")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user