sxsdlxw / zen-coding

Automatically exported from code.google.com/p/zen-coding
0 stars 0 forks source link

I want to climb the DOM tree and climb back down #206

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I assume a happy accident of the bracket parsing function - that I can write: 
html>(head>title+style+script:src(body>(#header(#main>h1+p(#footer>p.small
Instead 
of:html>(head>title+style+script:src)+(body>(#header)+(#main>h1+p)+(#footer>p.sm
all))
Amd get nicely structured page without ever closing my brackets, or having to 
think too much about pairing them up.

I would prefer though if there was a cleaner, more robust, more versatile 
solution - for example using '^' to ascend the DOM Tree thus I could write: 
html>head>title+style+script:src^body>#header+#main>h1+p^#footer>p.small

Original issue reported on code.google.com by billymoo...@gmail.com on 15 Sep 2010 at 7:31

GoogleCodeExporter commented 9 years ago
It's really a bad idea writing such large abbreviations.

Large abbreviations require a lot of brain work and may produce errors, so you 
have to double-check the expanded result. You'll gain much more speed if you 
write small abbreviations and expand them as needed.

At least, i'll think about syntax augmentation, but it's not gonna be be a 
priority feature.

Original comment by serge....@gmail.com on 15 Sep 2010 at 7:39

GoogleCodeExporter commented 9 years ago
Added `^` operator to climb up  the tree:
https://github.com/sergeche/zen-coding/commit/e14e9c56eccf77cce9d8ed0746ea71b055
0e5b96

Will be available in the next release

Original comment by serge....@gmail.com on 4 Jul 2012 at 9:10