Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions latte/cs/html-attributes.texy
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Pokud používáte filtry, mějte na paměti, že obvykle převádějí `null` n
<div title="{$title?|upper}"></div>
```

Stejné pravidlo platí i pro URL atributy jako `href` nebo `src`. Latte [kontroluje jejich hodnotu |safety-first#Kontrola odkazů] kvůli nebezpečným adresám, ale `null` nechává být, takže `<a href={$link}>` s `$link` nastaveným na `null` se vypíše jako prosté `<a>`. Dřívější verze zde vypisovaly `href=""`, čímž se z elementu stal odkaz na aktuální stránku. .{data-version:3.2.0}


Třídy (Classes)
===============
Expand Down
2 changes: 2 additions & 0 deletions latte/cs/safety-first.texy
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ Vypíše:
<a href="">klikni</a>
```

Pokud je proměnná `null`, atribut se vůbec nevypíše, stejně jako [u ostatních atributů |html-attributes#Hodnoty null]. .{data-version:3.2.0}

Kontrola se dá vypnout pomocí filtru [nocheck |filters#nocheck].


Expand Down
2 changes: 2 additions & 0 deletions latte/en/html-attributes.texy
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ If you use filters, keep in mind that they usually convert `null` to a string (e
<div title="{$title?|upper}"></div>
```

The same rule applies to URL attributes like `href` or `src`. Latte [checks their value |safety-first#Link Checking] for dangerous addresses, but it leaves `null` alone, so `<a href={$link}>` with `$link` set to `null` renders as just `<a>`. Earlier versions printed `href=""` here, which turned the element into a link to the current page. .{data-version:3.2.0}


Classes
=======
Expand Down
2 changes: 2 additions & 0 deletions latte/en/safety-first.texy
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ Outputs:
<a href="">click here</a>
```

If the variable is `null`, the attribute is omitted entirely, just like [other attributes |html-attributes#Null Values]. .{data-version:3.2.0}

The check can be disabled using the [nocheck |filters#nocheck] filter.


Expand Down
Loading