python-fluent
python-fluent copied to clipboard
Incorrect handling of tabs in message value
As identified in https://github.com/mozilla/pontoon/issues/2470#issuecomment-1107451952, this happens:
from fluent.syntax import ast, FluentParser, FluentSerializer
parser = FluentParser()
serializer = FluentSerializer()
string = """places-open-in-container-tab =
.label = Բացել նոր ներդիրում
.accesskey =
"""
string
'places-open-in-container-tab =\n .label = Բացել նոր ներդիրում\n .accesskey = \t\n'
serializer.serialize(parser.parse(string))
'places-open-in-container-tab =\n .label = Բացել նոր ներդիրում\n .accesskey = \n'
Tabs should not be lost; they count as valid inline_text characters according to the spec.
Probably also a bug in js syntax parser, and the runtime parser.
Yeah, will need to check all the implementations.