|
271 | 271 | "template": "{{#a}}{{b.c}}{{/a}}", |
272 | 272 | "expected": "" |
273 | 273 | }, |
| 274 | + { |
| 275 | + "name": "Implicit Iterators - Basic Interpolation", |
| 276 | + "desc": "Unadorned tags should interpolate content into the template.", |
| 277 | + "data": "world", |
| 278 | + "template": "Hello, {{.}}!\n", |
| 279 | + "expected": "Hello, world!\n" |
| 280 | + }, |
| 281 | + { |
| 282 | + "name": "Implicit Iterators - HTML Escaping", |
| 283 | + "desc": "Basic interpolation should be HTML escaped.", |
| 284 | + "data": "& \" < >", |
| 285 | + "template": "These characters should be HTML escaped: {{.}}\n", |
| 286 | + "expected": "These characters should be HTML escaped: & " < >\n" |
| 287 | + }, |
| 288 | + { |
| 289 | + "name": "Implicit Iterators - Triple Mustache", |
| 290 | + "desc": "Triple mustaches should interpolate without HTML escaping.", |
| 291 | + "data": "& \" < >", |
| 292 | + "template": "These characters should not be HTML escaped: {{{.}}}\n", |
| 293 | + "expected": "These characters should not be HTML escaped: & \" < >\n" |
| 294 | + }, |
| 295 | + { |
| 296 | + "name": "Implicit Iterators - Ampersand", |
| 297 | + "desc": "Ampersand should interpolate without HTML escaping.", |
| 298 | + "data": "& \" < >", |
| 299 | + "template": "These characters should not be HTML escaped: {{&.}}\n", |
| 300 | + "expected": "These characters should not be HTML escaped: & \" < >\n" |
| 301 | + }, |
| 302 | + { |
| 303 | + "name": "Implicit Iterators - Basic Integer Interpolation", |
| 304 | + "desc": "Integers should interpolate seamlessly.", |
| 305 | + "data": 85, |
| 306 | + "template": "\"{{.}} miles an hour!\"", |
| 307 | + "expected": "\"85 miles an hour!\"" |
| 308 | + }, |
274 | 309 | { |
275 | 310 | "name": "Interpolation - Surrounding Whitespace", |
276 | 311 | "desc": "Interpolation should not alter surrounding whitespace.", |
|
0 commit comments