Flip
Flip

Reputation: 6761

HAML: How do I generate a self-closing (href-lang) link tag?

I need to generate this exact (href-lang) link HAML:

<link rel="alternate" hreflang="es" href="http://es.example.com/" />

This HAML code:

%link{href: "http://es.example.com/", hreflang: "es", rel: "alternate"}

gets converted to:

<link href="http://es.example.com/" hreflang="es" rel="alternate"></link>

Any ideas anyone?

Upvotes: 0

Views: 560

Answers (1)

Dean Galvin
Dean Galvin

Reputation: 169

Can you post what version of HAML you are running? Also make sure that your list of auto closed tags has not been altered.

I would also double check that your link tags are not just HTML5 "assumed closed" w/ no trailing / at the end of the tag.

https://github.com/haml/haml/blob/master/REFERENCE.md#empty-void-tags-

Upvotes: 2

Related Questions