Commit 6aba510
Fix ERB expression compilation when code contains a heredoc
When an ERB output tag wraps code in parentheses and that code contains
a heredoc (e.g. `method_call <<~GRAPHQL, variables`), the closing
parenthesis must appear on its own line after the heredoc terminator.
Without this, the compiled Ruby is syntactically invalid.
Includes a snapshot test for the compiled output.
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c7333-8beb-715a-9183-8434cd5fb15a1 parent f0aa35a commit 6aba510
3 files changed
Lines changed: 24 additions & 1 deletion
File tree
- lib/reactionview/template/handlers/herb
- test
- snapshots/herb/template_handler_test
- template/handlers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
345 | 358 | | |
0 commit comments