From f4c999bdf2a21b9d96132f6cd04a9e19eb7e87ff Mon Sep 17 00:00:00 2001 From: eight04 Date: Sat, 4 Dec 2021 22:28:25 +0800 Subject: [PATCH] Fix: updateTag doesn't support hyphen --- autoload/emmet/lang/html.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/emmet/lang/html.vim b/autoload/emmet/lang/html.vim index fad887a..20bbf1c 100644 --- a/autoload/emmet/lang/html.vim +++ b/autoload/emmet/lang/html.vim @@ -736,11 +736,11 @@ endfunction function! emmet#lang#html#parseTag(tag) abort let current = emmet#newNode() - let mx = '<\([a-zA-Z][a-zA-Z0-9]*\)\(\%(\s[a-zA-Z][a-zA-Z0-9]\+=\?\%([^"'' \t]\+\|"[^"]\{-}"\|''[^'']\{-}''\)\s*\)*\)\(/\{0,1}\)>' + let mx = '<\([a-zA-Z][a-zA-Z0-9-]*\)\(\%(\s[a-zA-Z][a-zA-Z0-9-]\+=\?\%([^"'' \t]\+\|"[^"]\{-}"\|''[^'']\{-}''\)\s*\)*\)\(/\{0,1}\)>' let match = matchstr(a:tag, mx) let current.name = substitute(match, mx, '\1', 'i') let attrs = substitute(match, mx, '\2', 'i') - let mx = '\([a-zA-Z0-9]\+\)\(\(=[^"'' \t]\+\)\|="\([^"]\{-}\)"\|=''\([^'']\{-}\)''\)\?' + let mx = '\([a-zA-Z0-9-]\+\)\(\(=[^"'' \t]\+\)\|="\([^"]\{-}\)"\|=''\([^'']\{-}\)''\)\?' while len(attrs) > 0 let match = matchstr(attrs, mx) if len(match) == 0