Closed
Description
Bug Description
When formatting a string with multiple usages of the same component in the same scope, formatElements
only considers the outermost opening and closing tags
To Reproduce
Use a Trans tag like <Trans id="<0>Superscript</0> regular <0>super</0>" components=[{<sup />}] />
, observe rendered HTML is <sup>Superscript</0> regular <0>super</sup>
it("should format multiple usages of same element in the same scope", function() {
expect(
html(formatElements("<0>First</0> second <0>third</0> <0>fourth</0>", [<sup />]))
).toEqual(
wrap("<sup>First</sup> second <sup>third</sup> <sup>fourth</sup>")
)
})
Expected behavior
The formatter should correctly replace multiple instances of the same component
- jsLingui version
2.8.3
- Babel version
6.26.3
- This issue affects a project created with simple-react-app, but also affects Lingui's
master
Metadata
Metadata
Assignees
Labels
No labels