Commit 14a222f
committed
bug #113 Fixing null and false attributes (weaverryan)
This PR was merged into the main branch.
Discussion
----------
Fixing null and false attributes
Hi!
Suppose this config:
```yaml
webpack_encore:
script_attributes:
defer: false
async: null
```
This PR changes what this outputs:
```html
<!-- before -->
<script src="..." defer="" async=""></script>
<!-- after -->
<script src="..." async></script>
```
This was an oversight when I built the feature.
With this PR, `false` correctly means "do not show this attribute". `null` is a bit trickier: I chose to make this mean "show the attribute, but with value (e.g. `<script defer>`). Any other values are rendered normally.
Cheers!
Commits
-------
5dc7e3c Fixing null and false attributes2 files changed
+36
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
180 | 185 | | |
181 | 186 | | |
182 | 187 | | |
183 | | - | |
| 188 | + | |
184 | 189 | | |
185 | 190 | | |
| 191 | + | |
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
88 | 117 | | |
89 | 118 | | |
90 | 119 | | |
| |||
0 commit comments