From 3f2904196e856d31b9c95794d2682c4c7365db23 Mon Sep 17 00:00:00 2001 From: Diego Berrocal Date: Mon, 5 Oct 2015 17:32:29 -0400 Subject: Add jsx support for className --- src/html-abbrev.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/html-abbrev.el b/src/html-abbrev.el index b51e8d9..bb2b122 100644 --- a/src/html-abbrev.el +++ b/src/html-abbrev.el @@ -424,6 +424,9 @@ "Function to execute when expanding a leaf node in the Emmet AST.") +(defvar emmet-expand-jsx-className? nil + "Wether to use `className' when expanding `.classes'") + (emmet-defparameter emmet-tag-settings-table (gethash "tags" (gethash "html" emmet-preferences))) @@ -547,7 +550,10 @@ (puthash tag-name fn emmet-tag-snippets-table))) (let* ((id (emmet-concat-or-empty " id=\"" tag-id "\"")) - (classes (emmet-mapconcat-or-empty " class=\"" tag-classes " " "\"")) + (class-attr (if emmet-expand-jsx-className? + " className=\"" + " class=\"")) + (classes (emmet-mapconcat-or-empty class-attr tag-classes " " "\"")) (props (let* ((tag-props-default (and settings (gethash "defaultAttr" settings))) (merged-tag-props -- cgit v1.2.3