Comments (1)
Maybe I should change the way the "-" works.
It is different from ruby haml -- it begins a block of inline javascript.
So, if you want to use it with conditionals, you cannot indent the contents.
- if (true){
%h1 Will work
- }
demonstrating blocks and nesting:
- a = 4;
b = a % 2;
if (b >= a){
.someDiv
%h1 Will work
- }
This is a little awkward, yes, but you only need to do this if you need an
:else.. adding :else to the compiler is actually quite tricky given the way
it is currently implemented :/
- Aaron
On Wed, Sep 28, 2011 at 2:30 AM, Ivan Torres <
[email protected]>wrote:
Hey Aaron,
I don't know if this is an issue, or I'm doing something wrong. But if you
indent an if block it does generates invalid JS:- if (true) { %h1 Wont Work - }This is what I get:
return "";if (error !== undefined) { - if (true) { %h1 Wont Work - }; _$output = _$output + "";}; _$output = _$output ; }};BTW I'm using
haml.compile
Also, it would be nice to have a
:elsif
or:else if
plugin ;)Reply to this email directly or view it on GitHub:
#49
from haml-js.
Related Issues (20)
- inconsistent handling of indent HOT 4
- Support :if, :else statements HOT 1
- cli.js needs a #! HOT 2
- Attribute splats HOT 2
- Multiline attributes fail HOT 13
- Haml-js vim plugin
- Convert to Ruby syntax HOT 2
- Fix running JavaScript (-) to specification. PR submitted downstream
- bug: conditional comments don't work HOT 1
- Attribute parsing fails HOT 8
- Attribute with no value is being stripped from output HOT 4
- TypeError: undefined is not a function HOT 7
- Possibility to always prevent HTMLescaping
- Indentation problem HOT 1
- "Unexpected reserved word..." error returned after gulp-haml build HOT 1
- Multiline pipe appears not to be honored HOT 3
- Error behavior inconsistent HOT 3
- :each filter not working
- haml-lang.com is down, update readme HOT 3
- How to split HAML document in multiple smaller ones? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haml-js.