Skip to content

Instantly share code, notes, and snippets.

@ykhs
Created March 28, 2011 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ykhs/890605 to your computer and use it in GitHub Desktop.
Save ykhs/890605 to your computer and use it in GitHub Desktop.
--- a/autoload/zencoding.vim
+++ b/autoload/zencoding.vim
@@ -456,7 +456,11 @@ function! s:zen_toString_html(settings, current, type, inline, filters, itemno,
else
if inline == 0
if stridx(','.settings.html.empty_elements.',', ','.current.name.',') != -1
- let str .= " />\n"
+ if &ft != 'xhtml'
+ let str .= ">\n"
+ else
+ let str .= " />\n"
+ endif
else
if stridx(','.settings.html.inline_elements.',', ','.current.name.',') == -1 && len(current.child)
let str .= ">\n" . inner . '${cursor}</' . current.name . ">\n"
@@ -466,7 +470,11 @@ function! s:zen_toString_html(settings, current, type, inline, filters, itemno,
endif
else
if stridx(','.settings.html.empty_elements.',', ','.current.name.',') != -1
- let str .= " />"
+ if &ft != 'xhtml'
+ let str .= ">\n"
+ else
+ let str .= " />\n"
+ endif
else
let str .= ">" . inner . '${cursor}</' . current.name . ">"
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment