mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 18:54:27 +08:00
Support jsx's className. Close #255
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" emmet.vim
|
" emmet.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 17-Dec-2014.
|
" Last Change: 21-Feb-2015.
|
||||||
|
|
||||||
let s:save_cpo = &cpoptions
|
let s:save_cpo = &cpoptions
|
||||||
set cpoptions&vim
|
set cpoptions&vim
|
||||||
@@ -1815,6 +1815,10 @@ let s:emmet_settings = {
|
|||||||
\ 'choose': 'xsl:choose>xsl:when+xsl:otherwise',
|
\ 'choose': 'xsl:choose>xsl:when+xsl:otherwise',
|
||||||
\ }
|
\ }
|
||||||
\ },
|
\ },
|
||||||
|
\ 'jsx': {
|
||||||
|
\ 'extends': 'html',
|
||||||
|
\ 'attribute_name': {'class': 'className'},
|
||||||
|
\ },
|
||||||
\ 'xslt': {
|
\ 'xslt': {
|
||||||
\ 'extends': 'xsl',
|
\ 'extends': 'xsl',
|
||||||
\ },
|
\ },
|
||||||
|
|||||||
@@ -371,6 +371,7 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
|
|||||||
let dollar_expr = emmet#getResource(type, 'dollar_expr', 1)
|
let dollar_expr = emmet#getResource(type, 'dollar_expr', 1)
|
||||||
let q = emmet#getResource(type, 'quote_char', '"')
|
let q = emmet#getResource(type, 'quote_char', '"')
|
||||||
let ct = emmet#getResource(type, 'comment_type', 'both')
|
let ct = emmet#getResource(type, 'comment_type', 'both')
|
||||||
|
let an = emmet#getResource(type, 'attribute_name', {})
|
||||||
|
|
||||||
if emmet#useFilter(filters, 'haml')
|
if emmet#useFilter(filters, 'haml')
|
||||||
return emmet#lang#haml#toString(settings, current, type, inline, filters, itemno, indent)
|
return emmet#lang#haml#toString(settings, current, type, inline, filters, itemno, indent)
|
||||||
@@ -457,6 +458,9 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
|
if has_key(an, attr)
|
||||||
|
let attr = an[attr]
|
||||||
|
endif
|
||||||
let str .= ' ' . attr . '=' . q . Val . q
|
let str .= ' ' . attr . '=' . q . Val . q
|
||||||
if emmet#useFilter(filters, 'c')
|
if emmet#useFilter(filters, 'c')
|
||||||
if attr ==# 'id' | let comment .= '#' . Val | endif
|
if attr ==# 'id' | let comment .= '#' . Val | endif
|
||||||
|
|||||||
Reference in New Issue
Block a user