Actually no, custom element tag names must be closed -- the issue is that
within custom elements, other tags are not indented when they ought to be:
<x-custom-element>
<div>Inner</div>
<x-custom-empty-element></x-custom-empty-element>
</x-custom-element>
FWIW, I'm going to start using html5.vim
<https://github.com/othree/html5.vim> as it adds support for syntax
highlighting as well as omnicompletion and indentation for custom elements.
But I think something in between my patch and html5.vim should be applied
to the vim tree.
(also, html5.vim implements indenting by simply adding '\|\w\+\(-\w\+\)\+'
to the tag list rather than adding a separate function to check for
hyphenated elements. I tried this but couldn't get it to work for some
reason.)
Michael
On Fri, Feb 27, 2015 at 6:04 AM, Bram Moolenaar <[email protected]> wrote:
>
> Michael wrote:
>
> > I'm new to Vim and trying to get HTML to indent properly with web
> > components has been, well, impossible.
> >
> > This patch makes indent/html.vim aware of new HTML5 elements and
> > support for custom elements (hyphenated tags):
> >
> > * <template> http://www.w3.org/TR/html5/scripting-1.html
> > * <content>, <shadow> http://www.w3.org/TR/shadow-dom/
> > * <custom-element-tags> http://www.w3.org/TR/custom-elements/
> >
> > so that the descendants of these elements indent properly.
> >
> > This goes beyond just adding tags to g:html_indent_inctags because with
> custom elements, the set of possible tag names is virtually infinite.
> >
> > For more information, see http://webcomponents.org/.
> >
> > Please keep in mind I don't have a solid grasp of vimscript so feel
> > free to explain why this patch is awful :-)
>
> Thanks. I suppose we need to move away trying to recognize all tag
> names and only recognize those who may be unclosed or are always
> unclosed. E.g. <p> and <br>. I assume all the new tags are always
> closed?
>
>
> --
> Ten bugs in the hand is better than one as yet undetected.
>
> /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net
> \\\
> /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/
> \\\
> \\\ an exciting new programming language -- http://www.Zimbu.org
> ///
> \\\ help me help AIDS victims -- http://ICCF-Holland.org
> ///
>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.