tolgee-js icon indicating copy to clipboard operation
tolgee-js copied to clipboard

Self closing tags are not supported (<br />)

Open Goye opened this issue 3 years ago • 5 comments

Hey everyone hope all is going well,

I am trying to use the line break element without success, even if I try using the function form does not work. I guess this is happening will all these kinds of tags

Do you know what the problem might be? Or which file can I modify to fix it?

Thank you so much,

Screenshots

Screen Shot 2022-10-03 at 7 17 33 PM

Code snippet

{t({
	key: 'about.whoWeAre.lowFees.description',
	parameters: {
		s: <s />,
		strong: <strong />,
		br: <br />,
	},
})}

Enviorement

"@tolgee/react": "^4.9.2", "react": "^17.0.2", "next": "12.1.0",

Goye avatar Oct 04 '22 00:10 Goye

Hey, we are now using format.js for parsing tags and it doesn't support this, so now we don't have an easy way how to enable it. https://formatjs.io/docs/intl-messageformat#rich-text-support. We might change this by implementing our custom tag parser. Another thing is that we are preparing a new core library now, so after we release that, we might look at this again.

stepan662 avatar Oct 04 '22 07:10 stepan662

Thanks for letting me know! @stepan662

Goye avatar Oct 04 '22 15:10 Goye

Hi,

just wanted to ask if there are any updates on this?

Thanks in advance!

bpetermann avatar Mar 29 '23 08:03 bpetermann

Hey, sorry not yet. Will try to get to this, as I had multiple requests. In mean time, you can use <br></br>, it's a bit ugly, but it works.

stepan662 avatar Apr 03 '23 08:04 stepan662