nubolab-ffwd/svelte-fluent

Including non-printable UNICODE characters⁨⁩ `U+2068` and `U+2069` before/after a placement

Closed this issue · 1 comments

I don't know if it's expected, but I noticed that when using a placement, this library includes the UNICODE characters U+2068 and U+2069.

You can reproduce it by doing the following:

message = -{ $foo }-
<script>
  import { Localized } from "@nubolab-ffwd/svelte-fluent"
</script>

<Localized id="message" args={{ foo: 'value' }} let:text>
  {console.log(text)}
</Localized>

Then, copy the console output on VS Code:

image

It usually isn't a big deal, but if you are using the output on the img src attribute or making a string comparison, it can be bad.

@macabeus as far as I can tell this is an intentional behavior in fluent that is documented here: https://github.com/projectfluent/fluent.js/wiki/Unicode-Isolation

You can turn this behavior off by setting the useIsolating: false option when constructing the FluentBundle like this:

new FluentBundle(locale, {useIsolating: false});