HenryLie / svelte-i18n-lingui

Use lingui for i18n in Svelte/Sveltekit projects
https://www.npmjs.com/package/svelte-i18n-lingui
MIT License
23 stars 2 forks source link

<T/> adds unwanted spaces #13

Closed bfontaine closed 2 months ago

bfontaine commented 2 months ago

Hello, When using <T/> the resulting text has unwanted spaces:

<T msg="(#)"><a href="#">foo</a></T>

Expected result:

(<a href="#">foo</a>)

Actual result:

( <a href="#">foo</a> )

I think this is because of the newlines here: https://github.com/HenryLie/svelte-i18n-lingui/blob/3380b8c02a9b6862440fc0152b509f682f0bf6e0/src/lib/T.svelte#L65-L75

HenryLie commented 2 months ago

Thanks for posting the issue! You're right, those lines are the cause of the issue. It seems I've made a fix in the next branch but haven't backported it to the stable branch just yet:

https://github.com/HenryLie/svelte-i18n-lingui/blob/40795b13d88d5a88434e2510dba3082117f737f4/src/lib/T.svelte#L65-L68

Let me make the fix and release a new version 😄

HenryLie commented 2 months ago

@bfontaine this issue is now fixed in the latest version (v0.1.8). Could you verify that it works as expected and close this issue?

bfontaine commented 2 months ago

Thank you! I confirm it now works as expected.