Monday, June 3, 2013

Re: How to fix <h1> id strings?

> Hi all,
>
> Using snipMate, <h1> items have id strings that are the same as their
> text, meaning the id string has spaces.
>
> <h1 id="My h1 item">My h1 item</h1>
>
> This is an HTML4 no-no, so I want to create a Vim something or other so
> that, when my cursor is between the quotes delineating the id's value,
> it replaces all spaces with underscores.

Ouch, making the id attribute equivalent to the contents of the text is
very bad. The id tag is suppose to be unique in a document but there is no
such restriction on text nodes that happen to be child of a header node.

snipMate (I've never used it) should either not provide an id attribute or
if you want one, ask you to provide the string to use. There really isn't
a need for headers to have id attribute in most cases, really they are
only needed if you plan to use JS to modify it in which case using the
original string is even a worse idea. In my idea.

I would file a bug report with snipMate if I used that product, that's
just poorly done IMHO.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment