mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 03:04:27 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fe726da47 |
@@ -290,6 +290,7 @@ function! emmet#toString(...) abort
|
|||||||
else
|
else
|
||||||
let inner = current.value[1:-2]
|
let inner = current.value[1:-2]
|
||||||
endif
|
endif
|
||||||
|
let inner = substitute(inner, '\${child}', '', '')
|
||||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
||||||
let str = substitute(str, '\${child}', inner, '')
|
let str = substitute(str, '\${child}', inner, '')
|
||||||
endif
|
endif
|
||||||
@@ -1626,8 +1627,7 @@ let s:emmet_settings = {
|
|||||||
\ 'extends': 'css',
|
\ 'extends': 'css',
|
||||||
\ },
|
\ },
|
||||||
\ 'html': {
|
\ 'html': {
|
||||||
\ 'snippets': {
|
\ 'abbreviations': {
|
||||||
\ '!': "html:5",
|
|
||||||
\ '!!!': "<!DOCTYPE html>\n",
|
\ '!!!': "<!DOCTYPE html>\n",
|
||||||
\ '!!!4t': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n",
|
\ '!!!4t': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n",
|
||||||
\ '!!!4s': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n",
|
\ '!!!4s': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n",
|
||||||
@@ -1638,54 +1638,17 @@ let s:emmet_settings = {
|
|||||||
\ 'cc:ie6': "<!--[if lte IE 6]>\n\t${child}|\n<![endif]-->",
|
\ 'cc:ie6': "<!--[if lte IE 6]>\n\t${child}|\n<![endif]-->",
|
||||||
\ 'cc:ie': "<!--[if IE]>\n\t${child}|\n<![endif]-->",
|
\ 'cc:ie': "<!--[if IE]>\n\t${child}|\n<![endif]-->",
|
||||||
\ 'cc:noie': "<!--[if !IE]><!-->\n\t${child}|\n<!--<![endif]-->",
|
\ 'cc:noie': "<!--[if !IE]><!-->\n\t${child}|\n<!--<![endif]-->",
|
||||||
\ 'html:4t': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
|
\ },
|
||||||
\ ."<html lang=\"${lang}\">\n"
|
\ 'snippets': {
|
||||||
\ ."<head>\n"
|
\ '!': "html:5",
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
|
\ 'doc': "html>(head>meta[charset=${charset}]+title{${1:Document}})+body>${child}",
|
||||||
\ ."\t<title></title>\n"
|
\ 'doc4': "html>(head>meta[http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\"]+title{${1:Document}})+body>${child}",
|
||||||
\ ."</head>\n"
|
\ 'html:4t': "!!!4t+doc4[lang=${lang}]",
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
\ 'html:4s': "!!!4s+doc4[lang=${lang}]",
|
||||||
\ ."</html>",
|
\ 'html:xt': "!!!xt+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]",
|
||||||
\ 'html:4s': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
|
\ 'html:xs': "!!!xs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]",
|
||||||
\ ."<html lang=\"${lang}\">\n"
|
\ 'html:xxs': "!!!xxs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]",
|
||||||
\ ."<head>\n"
|
\ 'html:5': "!!!+doc[lang=${lang}]",
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ 'html:xt': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
|
|
||||||
\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
|
|
||||||
\ ."<head>\n"
|
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ 'html:xs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
|
|
||||||
\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
|
|
||||||
\ ."<head>\n"
|
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ 'html:xxs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
|
|
||||||
\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
|
|
||||||
\ ."<head>\n"
|
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ 'html:5': "<!DOCTYPE html>\n"
|
|
||||||
\ ."<html lang=\"${lang}\">\n"
|
|
||||||
\ ."<head>\n"
|
|
||||||
\ ."\t<meta charset=\"${charset}\">\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ },
|
\ },
|
||||||
\ 'default_attributes': {
|
\ 'default_attributes': {
|
||||||
\ 'a': [{'href': ''}],
|
\ 'a': [{'href': ''}],
|
||||||
@@ -1845,51 +1808,6 @@ let s:emmet_settings = {
|
|||||||
\ 'jade': {
|
\ 'jade': {
|
||||||
\ 'indentation': ' ',
|
\ 'indentation': ' ',
|
||||||
\ 'extends': 'html',
|
\ 'extends': 'html',
|
||||||
\ 'snippets': {
|
|
||||||
\ '!!!': "doctype html\n",
|
|
||||||
\ '!!!4t': "doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"\n",
|
|
||||||
\ '!!!4s': "doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"\n",
|
|
||||||
\ '!!!xt': "doctype transitional\n",
|
|
||||||
\ '!!!xs': "doctype strict\n",
|
|
||||||
\ '!!!xxs': "doctype 1.1\n",
|
|
||||||
\ 'c': "\/\/ |${child}",
|
|
||||||
\ 'html:4t': "doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"\n"
|
|
||||||
\ ."html(lang=\"${lang}\")\n"
|
|
||||||
\ ."\thead\n"
|
|
||||||
\ ."\t\tmeta(http-equiv=\"Content-Type\", content=\"text/html;charset=${charset}\")\n"
|
|
||||||
\ ."\t\ttitle\n"
|
|
||||||
\ ."\tbody\n\t\t${child}|",
|
|
||||||
\ 'html:4s': "doctype HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"\n"
|
|
||||||
\ ."html(lang=\"${lang}\")\n"
|
|
||||||
\ ."\thead\n"
|
|
||||||
\ ."\t\tmeta(http-equiv=\"Content-Type\", content=\"text/html;charset=${charset}\")\n"
|
|
||||||
\ ."\t\ttitle\n"
|
|
||||||
\ ."\tbody\n\t\t${child}|",
|
|
||||||
\ 'html:xt': "doctype transitional\n"
|
|
||||||
\ ."html(xmlns=\"http://www.w3.org/1999/xhtml\", xml:lang=\"${lang}\")\n"
|
|
||||||
\ ."\thead\n"
|
|
||||||
\ ."\t\tmeta(http-equiv=\"Content-Type\", content=\"text/html;charset=${charset}\")\n"
|
|
||||||
\ ."\t\ttitle\n"
|
|
||||||
\ ."\tbody\n\t\t${child}|",
|
|
||||||
\ 'html:xs': "doctype strict\n"
|
|
||||||
\ ."html(xmlns=\"http://www.w3.org/1999/xhtml\", xml:lang=\"${lang}\")\n"
|
|
||||||
\ ."\thead\n"
|
|
||||||
\ ."\t\tmeta(http-equiv=\"Content-Type\", content=\"text/html;charset=${charset}\")\n"
|
|
||||||
\ ."\t\ttitle\n"
|
|
||||||
\ ."\tbody\n\t\t${child}|",
|
|
||||||
\ 'html:xxs': "doctype 1.1\n"
|
|
||||||
\ ."html(xmlns=\"http://www.w3.org/1999/xhtml\", xml:lang=\"${lang}\")\n"
|
|
||||||
\ ."\thead\n"
|
|
||||||
\ ."\t\tmeta(http-equiv=\"Content-Type\", content=\"text/html;charset=${charset}\")\n"
|
|
||||||
\ ."\t\ttitle\n"
|
|
||||||
\ ."\tbody\n\t\t${child}|",
|
|
||||||
\ 'html:5': "doctype html\n"
|
|
||||||
\ ."html(lang=\"${lang}\")\n"
|
|
||||||
\ ."\thead\n"
|
|
||||||
\ ."\t\tmeta(charset=\"${charset}\")\n"
|
|
||||||
\ ."\t\ttitle\n"
|
|
||||||
\ ."\tbody\n\t\t${child}|",
|
|
||||||
\ },
|
|
||||||
\ },
|
\ },
|
||||||
\ 'xsl': {
|
\ 'xsl': {
|
||||||
\ 'extends': 'html',
|
\ 'extends': 'html',
|
||||||
@@ -1909,6 +1827,47 @@ let s:emmet_settings = {
|
|||||||
\ 'each': {'select': ''},
|
\ 'each': {'select': ''},
|
||||||
\ 'ap': [{'select': ''}, {'mode': ''}]
|
\ 'ap': [{'select': ''}, {'mode': ''}]
|
||||||
\ },
|
\ },
|
||||||
|
\ "abbreviations": {
|
||||||
|
\ 'tm|tmatch': "<xsl:template match=\"\" mode=\"\">",
|
||||||
|
\ 'tn|tname': "<xsl:template name=\"\">",
|
||||||
|
\ 'call': "<xsl:call-template name=\"\"/>",
|
||||||
|
\ 'ap': "<xsl:apply-templates select=\"\" mode=\"\"/>",
|
||||||
|
\ 'api': "<xsl:apply-imports/>",
|
||||||
|
\ 'imp': "<xsl:import href=\"\"/>",
|
||||||
|
\ 'inc': "<xsl:include href=\"\"/>",
|
||||||
|
\ 'ch': "<xsl:choose>",
|
||||||
|
\ 'wh|xsl:when': "<xsl:when test=\"\">",
|
||||||
|
\ 'ot': "<xsl:otherwise>",
|
||||||
|
\ 'if': "<xsl:if test=\"\">",
|
||||||
|
\ 'par': "<xsl:param name=\"\">",
|
||||||
|
\ 'pare': "<xsl:param name=\"\" select=\"\"/>",
|
||||||
|
\ 'var': "<xsl:variable name=\"\">",
|
||||||
|
\ 'vare': "<xsl:variable name=\"\" select=\"\"/>",
|
||||||
|
\ 'wp': "<xsl:with-param name=\"\" select=\"\"/>",
|
||||||
|
\ 'key': "<xsl:key name=\"\" match=\"\" use=\"\"/>",
|
||||||
|
\ 'elem': "<xsl:element name=\"\">",
|
||||||
|
\ 'attr': "<xsl:attribute name=\"\">",
|
||||||
|
\ 'attrs': "<xsl:attribute-set name=\"\">",
|
||||||
|
\ 'cp': "<xsl:copy select=\"\"/>",
|
||||||
|
\ 'co': "<xsl:copy-of select=\"\"/>",
|
||||||
|
\ 'val': "<xsl:value-of select=\"\"/>",
|
||||||
|
\ 'for|each': "<xsl:for-each select=\"\">",
|
||||||
|
\ 'tex': "<xsl:text></xsl:text>",
|
||||||
|
\ 'com': "<xsl:comment>",
|
||||||
|
\ 'msg': "<xsl:message terminate=\"no\">",
|
||||||
|
\ 'fall': "<xsl:fallback>",
|
||||||
|
\ 'num': "<xsl:number value=\"\"/>",
|
||||||
|
\ 'nam': "<namespace-alias stylesheet-prefix=\"\" result-prefix=\"\"/>",
|
||||||
|
\ 'pres': "<xsl:preserve-space elements=\"\"/>",
|
||||||
|
\ 'strip': "<xsl:strip-space elements=\"\"/>",
|
||||||
|
\ 'proc': "<xsl:processing-instruction name=\"\">",
|
||||||
|
\ 'sort': "<xsl:sort select=\"\" order=\"\"/>",
|
||||||
|
\ 'choose+': "xsl:choose>xsl:when+xsl:otherwise",
|
||||||
|
\ 'xsl': "!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\n|}"
|
||||||
|
\ },
|
||||||
|
\ "snippets": {
|
||||||
|
\ "!!!": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||||
|
\ },
|
||||||
\ 'aliases': {
|
\ 'aliases': {
|
||||||
\ 'tmatch': 'xsl:template',
|
\ 'tmatch': 'xsl:template',
|
||||||
\ 'tname': 'xsl:template',
|
\ 'tname': 'xsl:template',
|
||||||
@@ -1939,28 +1898,15 @@ let s:emmet_settings = {
|
|||||||
\ 'haml': {
|
\ 'haml': {
|
||||||
\ 'indentation': ' ',
|
\ 'indentation': ' ',
|
||||||
\ 'extends': 'html',
|
\ 'extends': 'html',
|
||||||
\ 'snippets': {
|
\ 'abbreviations': {
|
||||||
\ 'html:5': "!!! 5\n"
|
\ '!!!': "!!! 5",
|
||||||
\ ."%html{:lang => \"${lang}\"}\n"
|
|
||||||
\ ."\t%head\n"
|
|
||||||
\ ."\t\t%meta{:charset => \"${charset}\"}\n"
|
|
||||||
\ ."\t\t%title\n"
|
|
||||||
\ ."\t%body\n"
|
|
||||||
\ ."\t\t${child}|\n",
|
|
||||||
\ },
|
\ },
|
||||||
\ 'attribute_style': 'hash',
|
\ 'attribute_style': 'hash',
|
||||||
\ },
|
\ },
|
||||||
\ 'slim': {
|
\ 'slim': {
|
||||||
\ 'indentation': ' ',
|
\ 'indentation': ' ',
|
||||||
\ 'extends': 'html',
|
\ 'extends': 'html',
|
||||||
\ 'snippets': {
|
\ 'abbreviations': {
|
||||||
\ 'html:5': "doctype 5\n"
|
|
||||||
\ ."html lang=\"${lang}\"\n"
|
|
||||||
\ ."\thead\n"
|
|
||||||
\ ."\t\tmeta charset=\"${charset}\"\n"
|
|
||||||
\ ."\t\ttitle\n"
|
|
||||||
\ ."\tbody\n"
|
|
||||||
\ ."\t\t${child}|\n",
|
|
||||||
\ },
|
\ },
|
||||||
\ },
|
\ },
|
||||||
\ 'xhtml': {
|
\ 'xhtml': {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
let s:mx = '\([+>]\|[<^]\+\)\{-}\s*'
|
let s:mx = '\([+>]\|[<^]\+\)\{-}\s*'
|
||||||
\ .'\((*\)\{-}\s*'
|
\ .'\((*\)\{-}\s*'
|
||||||
\ .'\([@#.]\{-}[a-zA-Z_\!][a-zA-Z0-9:_\!\-$]*\|{\%([^%$}]\+\|\$#\|\${\w\+}\|\$\+\)*}*[ \t\r\n}]*\|\[[^\]]\+\]\)'
|
\ .'\([@#.]\{-}[a-zA-Z_\!][a-zA-Z0-9:_\!\-$]*\|\${[^}]\+}\|{\%([^%$}]\+\|\$#\|\${\w\+}\|\$\+\)*}*[ \t\r\n}]*\|\[[^\]]\+\]\)'
|
||||||
\ .'\('
|
\ .'\('
|
||||||
\ .'\%('
|
\ .'\%('
|
||||||
\ .'\%(#{[{}a-zA-Z0-9_\-\$]\+\|#[a-zA-Z0-9_\-\$]\+\)'
|
\ .'\%(#{[{}a-zA-Z0-9_\-\$]\+\|#[a-zA-Z0-9_\-\$]\+\)'
|
||||||
@@ -123,29 +123,54 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
|
|||||||
|
|
||||||
let use_pipe_for_cursor = emmet#getResource(type, 'use_pipe_for_cursor', 1)
|
let use_pipe_for_cursor = emmet#getResource(type, 'use_pipe_for_cursor', 1)
|
||||||
|
|
||||||
" snippets
|
let abbreviations = emmet#getResource(type, 'abbreviations', {})
|
||||||
let snippets = emmet#getResource(type, 'snippets', {})
|
if !empty(abbreviations)
|
||||||
if !empty(snippets)
|
let abbreviation_name = tag_name
|
||||||
let snippet_name = tag_name
|
if has_key(abbreviations, abbreviation_name)
|
||||||
if has_key(snippets, snippet_name)
|
let abbreviation = abbreviation_name
|
||||||
let snippet = snippet_name
|
while has_key(abbreviations, abbreviation)
|
||||||
while has_key(snippets, snippet)
|
let abbreviation = abbreviations[abbreviation]
|
||||||
let snippet = snippets[snippet]
|
|
||||||
endwhile
|
endwhile
|
||||||
if use_pipe_for_cursor
|
if use_pipe_for_cursor
|
||||||
let snippet = substitute(snippet, '|', '${cursor}', 'g')
|
let abbreviation = substitute(abbreviation, '|', '${cursor}', 'g')
|
||||||
endif
|
endif
|
||||||
" just redirect to expanding
|
let lines = split(abbreviation, "\n", 1)
|
||||||
if type == 'html' && snippet !~ '^\s*[{\[<]'
|
|
||||||
return emmet#lang#html#parseIntoTree(snippet, a:type)
|
|
||||||
endif
|
|
||||||
let lines = split(snippet, "\n", 1)
|
|
||||||
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")')
|
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")')
|
||||||
let current.snippet = join(lines, "\n")
|
let current.snippet = join(lines, "\n")
|
||||||
let current.name = ''
|
let current.name = ''
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" snippets
|
||||||
|
let snippets = emmet#getResource(type, 'snippets', {})
|
||||||
|
if empty(current.snippet)
|
||||||
|
let snippets = emmet#getResource(type, 'snippets', {})
|
||||||
|
if !empty(snippets)
|
||||||
|
let snippet_name = tag_name
|
||||||
|
if has_key(snippets, snippet_name)
|
||||||
|
let snippet = snippet_name
|
||||||
|
while has_key(snippets, snippet)
|
||||||
|
let snippet = snippets[snippet]
|
||||||
|
endwhile
|
||||||
|
if use_pipe_for_cursor
|
||||||
|
let snippet = substitute(snippet, '|', '${cursor}', 'g')
|
||||||
|
endif
|
||||||
|
if emmet#isExtends(type, 'html') && snippet !~ '^\s*[{\[<]'
|
||||||
|
let current = emmet#lang#html#parseIntoTree(snippet, a:type)
|
||||||
|
if current.name == '' && current.value == '' && current.snippet == '' && len(current.child) > 0
|
||||||
|
let parent.child += current.child[:-2]
|
||||||
|
let current = current.child[-1]
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let lines = split(snippet, "\n", 1)
|
||||||
|
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")')
|
||||||
|
let current.snippet = join(lines, "\n")
|
||||||
|
let current.name = ''
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
let custom_expands = emmet#getResource(type, 'custom_expands', {})
|
let custom_expands = emmet#getResource(type, 'custom_expands', {})
|
||||||
if empty(custom_expands) && has_key(settings, 'custom_expands')
|
if empty(custom_expands) && has_key(settings, 'custom_expands')
|
||||||
let custom_expands = settings['custom_expands']
|
let custom_expands = settings['custom_expands']
|
||||||
@@ -218,7 +243,7 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
|
|||||||
let atts = item[1:-2]
|
let atts = item[1:-2]
|
||||||
if matchstr(atts, '^\s*\zs[0-9a-zA-Z-:]\+\(="[^"]*"\|=''[^'']*''\|=[^ ''"]\+\)') ==# ''
|
if matchstr(atts, '^\s*\zs[0-9a-zA-Z-:]\+\(="[^"]*"\|=''[^'']*''\|=[^ ''"]\+\)') ==# ''
|
||||||
let ks = []
|
let ks = []
|
||||||
if has_key(default_attributes, current.name)
|
if has_key(default_attributes, current.name)
|
||||||
let dfa = default_attributes[current.name]
|
let dfa = default_attributes[current.name]
|
||||||
let ks = type(dfa) == 3 ? keys(dfa[0]) : keys(dfa)
|
let ks = type(dfa) == 3 ? keys(dfa[0]) : keys(dfa)
|
||||||
endif
|
endif
|
||||||
@@ -262,6 +287,9 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
|
|||||||
if tag_name =~# '^{.*}$'
|
if tag_name =~# '^{.*}$'
|
||||||
let current.name = ''
|
let current.name = ''
|
||||||
let current.value = tag_name
|
let current.value = tag_name
|
||||||
|
elseif tag_name =~# '^\$\?{.*}$'
|
||||||
|
let current.name = ''
|
||||||
|
let current.value = '{' . tag_name . '}'
|
||||||
else
|
else
|
||||||
let current.value = value
|
let current.value = value
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ finish
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'query': "html:xt>div#header>div#logo+ul#nav>li.item-$*5>a",
|
'query': "html:xt>div#header>div#logo+ul#nav>li.item-$*5>a",
|
||||||
'result': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />\n\t<title></title>\n</head>\n<body>\n\t<div id=\"header\">\n\t\t<div id=\"logo\"></div>\n\t\t<ul id=\"nav\">\n\t\t\t<li class=\"item-1\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-2\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-3\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-4\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-5\"><a href=\"\"></a></li>\n\t\t</ul>\n\t</div>\n\t\n</body>\n</html>",
|
'result': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n\t<head>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n\t\t<title>${1:Document}</title>\n\t</head>\n\t<body>\n\t<div id=\"header\">\n\t\t<div id=\"logo\"></div>\n\t\t<ul id=\"nav\">\n\t\t\t<li class=\"item-1\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-2\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-3\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-4\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-5\"><a href=\"\"></a></li>\n\t\t</ul>\n\t</div>\n\t\n</body>\n</html>",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'query': "ol>li*2",
|
'query': "ol>li*2",
|
||||||
|
|||||||
Reference in New Issue
Block a user