lit / lit/lit

[localize] Nested msg call inside html next to attribute creates invalid placeholder

Open
#2,690 1 comment 0 reactions 1 assignee View on GitHub

@aomarks is already working on this.

Since Feb 16, 2023.

Dominant language
TypeScript
Stars
21.8k
Forks
1.1k
Avg merge
18h 25m
Merged PRs (30d)
2

Description

`msg(html(msg)))` when the `msg` is placed as an attribute value produces invalid placeholder when extracted and fails when utilized during build. This affects both runtime and transform mode, and xliff and xlb format.

This
```ts
msg(html`Hello ${"World"}!`);
```

produces
```xml

Hello !

```

expected
```xml

Hello !

```

I suspect that the placeholder's `equiv-text` is getting html encoded twice so the `"` becomes `"` as well as having the quotes added around the expression (is that actually expected/necessary?)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.