diff --git a/autoload/emmet/lang/html.vim b/autoload/emmet/lang/html.vim
index 88894db..07883ce 100644
--- a/autoload/emmet/lang/html.vim
+++ b/autoload/emmet/lang/html.vim
@@ -346,6 +346,7 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
let indent = a:indent
let dollar_expr = emmet#getResource(type, 'dollar_expr', 1)
let q = emmet#getResource(type, 'quote_char', '"')
+ let ct = emmet#getResource(type, 'comment_type', 'both')
if emmet#useFilter(filters, 'haml')
return emmet#lang#haml#toString(settings, current, type, inline, filters, itemno, indent)
@@ -438,7 +439,7 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
endif
unlet Val
endfor
- if len(comment) > 0
+ if len(comment) > 0 && ct == 'both'
let str = "\n" . str
endif
if stridx(','.settings.html.empty_elements.',', ','.current_name.',') != -1
@@ -490,7 +491,11 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
let str .= "" . current_name . ">"
endif
if len(comment) > 0
- let str .= "\n"
+ if ct == "lastonly"
+ let str .= ""
+ else
+ let str .= "\n"
+ endif
endif
if len(current_name) > 0 && current.multiplier > 0 || stridx(','.settings.html.block_elements.',', ','.current_name.',') != -1
let str .= "\n"