diff options
author | flyingleafe <flyingleafe@gmail.com> | 2014-08-05 14:03:16 +0600 |
---|---|---|
committer | flyingleafe <flyingleafe@gmail.com> | 2014-08-05 14:03:16 +0600 |
commit | 928648a15433c866931919670558d656b9f32563 (patch) | |
tree | fddb7e1d251166518ff176435457f3e1389471ab | |
parent | fdfa4d71fe42f6410e0617b46ec5de2935d14a5e (diff) | |
download | emmet-mode-928648a15433c866931919670558d656b9f32563.tar.lz emmet-mode-928648a15433c866931919670558d656b9f32563.tar.xz emmet-mode-928648a15433c866931919670558d656b9f32563.zip |
Fixing improper behavior of block tags
-rw-r--r-- | conf/preferences.json | 4 | ||||
-rw-r--r-- | emmet-mode.el | 11 | ||||
-rw-r--r-- | src/html-abbrev.el | 7 | ||||
-rw-r--r-- | src/preferences.el | 4 |
4 files changed, 14 insertions, 12 deletions
diff --git a/conf/preferences.json b/conf/preferences.json index 5cb84f7..5e76145 100644 --- a/conf/preferences.json +++ b/conf/preferences.json @@ -35,7 +35,7 @@ "dfn": {"block": false, "selfClosing": false}, "dialog": {"block": false, "selfClosing": false}, "dir": {"block": true, "selfClosing": false}, - "div": {"block": false, "selfClosing": false}, + "div": {"block": true, "selfClosing": false}, "dl": {"block": true, "selfClosing": false}, "dt": {"block": false, "selfClosing": false}, "em": {"block": false, "selfClosing": false}, @@ -83,7 +83,7 @@ "optgroup": {"block": true, "selfClosing": false}, "option": {"block": false, "selfClosing": false, "defaultAttr": {"value": ""}}, "output": {"block": false, "selfClosing": false}, - "p": {"block": false, "selfClosing": false}, + "p": {"block": true, "selfClosing": false}, "param": {"block": false, "selfClosing": true, "defaultAttr": {"name": "", "value": ""}}, "pre": {"block": true, "selfClosing": false}, "progress": {"block": false, "selfClosing": false}, diff --git a/emmet-mode.el b/emmet-mode.el index 1452731..1eb248b 100644 --- a/emmet-mode.el +++ b/emmet-mode.el @@ -1977,7 +1977,7 @@ tbl) tbl) (puthash "selfClosing" nil tbl) tbl) tbl) (puthash "div" (let ((tbl (make-hash-table :test 'equal))) -(puthash "block" nil tbl) +(puthash "block" t tbl) (puthash "selfClosing" nil tbl) tbl) tbl) (puthash "dl" (let ((tbl (make-hash-table :test 'equal))) @@ -2206,7 +2206,7 @@ tbl) tbl) (puthash "selfClosing" nil tbl) tbl) tbl) (puthash "p" (let ((tbl (make-hash-table :test 'equal))) -(puthash "block" nil tbl) +(puthash "block" t tbl) (puthash "selfClosing" nil tbl) tbl) tbl) (puthash "param" (let ((tbl (make-hash-table :test 'equal))) @@ -2936,16 +2936,17 @@ tbl)) (self-closing? (and (not (or tag-txt content)) (or (not tag-has-body?) (and settings (gethash "selfClosing" settings))))) - (lf (if (or content-multiline? block-tag?) "\n"))) + (block-indentation? (or content-multiline? (and block-tag? content))) + (lf (if block-indentation? "\n"))) (concat "<" tag-name id classes props (if self-closing? "/>" (concat ">" (if tag-txt - (if (or content-multiline? block-tag?) + (if block-indentation? (emmet-indent tag-txt) tag-txt)) (if content - (if (or content-multiline? block-tag?) + (if block-indentation? (emmet-indent content) content)) lf diff --git a/src/html-abbrev.el b/src/html-abbrev.el index ccc233e..f11327b 100644 --- a/src/html-abbrev.el +++ b/src/html-abbrev.el @@ -553,16 +553,17 @@ (self-closing? (and (not (or tag-txt content)) (or (not tag-has-body?) (and settings (gethash "selfClosing" settings))))) - (lf (if (or content-multiline? block-tag?) "\n"))) + (block-indentation? (or content-multiline? (and block-tag? content))) + (lf (if block-indentation? "\n"))) (concat "<" tag-name id classes props (if self-closing? "/>" (concat ">" (if tag-txt - (if (or content-multiline? block-tag?) + (if block-indentation? (emmet-indent tag-txt) tag-txt)) (if content - (if (or content-multiline? block-tag?) + (if block-indentation? (emmet-indent content) content)) lf diff --git a/src/preferences.el b/src/preferences.el index a5f1d6d..c035c0c 100644 --- a/src/preferences.el +++ b/src/preferences.el @@ -1142,7 +1142,7 @@ tbl) tbl) (puthash "selfClosing" nil tbl) tbl) tbl) (puthash "div" (let ((tbl (make-hash-table :test 'equal))) -(puthash "block" nil tbl) +(puthash "block" t tbl) (puthash "selfClosing" nil tbl) tbl) tbl) (puthash "dl" (let ((tbl (make-hash-table :test 'equal))) @@ -1371,7 +1371,7 @@ tbl) tbl) (puthash "selfClosing" nil tbl) tbl) tbl) (puthash "p" (let ((tbl (make-hash-table :test 'equal))) -(puthash "block" nil tbl) +(puthash "block" t tbl) (puthash "selfClosing" nil tbl) tbl) tbl) (puthash "param" (let ((tbl (make-hash-table :test 'equal))) |