Commit 2b684b7
fix(compiler): skipping leading whitespace should not break placeholder source-spans (#39589)
Tokenized text node may have leading whitespace skipped from their
source-span. But the source-span is used to compute where there are
interpolated blocks, resulting in placeholder nodes whose source-spans
are offset by the amount of skipped characters.
This fix uses the `fullStart` location of text source-spans for computing
the source-span of placeholders, so that they are accurate.
Fixes #39195
PR Close #395891 parent ff31b43 commit 2b684b7Copy full SHA for 2b684b7
File tree
Expand file treeCollapse file tree
4 files changed
+30
-7
lines changedOpen diff view settings
Filter options
- packages/compiler
- src
- i18n
- render3/view
- test/render3/view
Expand file treeCollapse file tree
4 files changed
+30
-7
lines changedOpen diff view settings
Collapse file
packages/compiler/src/i18n/i18n_parser.ts
Copy file name to clipboardExpand all lines: packages/compiler/src/i18n/i18n_parser.ts+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
191 | 191 | |
192 | 192 | |
193 | 193 | |
194 | | - |
| 194 | + |
195 | 195 | |
196 | 196 | |
197 | 197 | |
|
Collapse file
packages/compiler/src/render3/view/template.ts
Copy file name to clipboardExpand all lines: packages/compiler/src/render3/view/template.ts+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
52 | 52 | |
53 | 53 | |
54 | 54 | |
55 | | - |
| 55 | + |
56 | 56 | |
57 | 57 | |
58 | 58 | |
|
Collapse file
packages/compiler/test/render3/view/i18n_spec.ts
Copy file name to clipboardExpand all lines: packages/compiler/test/render3/view/i18n_spec.ts+23-2Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
18 | 18 | |
19 | 19 | |
20 | 20 | |
| 21 | + |
21 | 22 | |
22 | 23 | |
23 | 24 | |
| ||
355 | 356 | |
356 | 357 | |
357 | 358 | |
358 | | - |
| 359 | + |
359 | 360 | |
360 | 361 | |
361 | 362 | |
| ||
446 | 447 | |
447 | 448 | |
448 | 449 | |
449 | | - |
| 450 | + |
450 | 451 | |
451 | 452 | |
452 | 453 | |
| ||
478 | 479 | |
479 | 480 | |
480 | 481 | |
| 482 | + |
| 483 | + |
| 484 | + |
| 485 | + |
| 486 | + |
| 487 | + |
| 488 | + |
| 489 | + |
| 490 | + |
| 491 | + |
| 492 | + |
| 493 | + |
| 494 | + |
| 495 | + |
| 496 | + |
| 497 | + |
| 498 | + |
| 499 | + |
| 500 | + |
| 501 | + |
481 | 502 | |
482 | 503 | |
483 | 504 | |
|
Collapse file
packages/compiler/test/render3/view/util.ts
Copy file name to clipboardExpand all lines: packages/compiler/test/render3/view/util.ts+5-3Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | | - |
| 81 | + |
| 82 | + |
82 | 83 | |
83 | 84 | |
84 | | - |
85 | | - |
| 85 | + |
| 86 | + |
| 87 | + |
86 | 88 | |
87 | 89 | |
88 | 90 | |
|
0 commit comments