Paul
Paul

Reputation: 4860

Jade using reserved word as tag

I am using jade to template XML files and one of my tags is called <block>...</block>.

So the snippet of my jade file is as follows:

block
    ...

When compiling I get the following error: Anonymous blocks are not allowed unless they are part of a mixin.

I assume this is because "block" is a reserved word. So my question is how does one use a reserved word as a tag?

Any information is appreciated.

Paul

Upvotes: 2

Views: 52

Answers (1)

robertklep
robertklep

Reputation: 203554

You can use string interpolation on a fixed string:

#{'block'}
  foo hello

Found here.

Upvotes: 3

Related Questions