Skip to content

Incorrect handling of tabs in message value #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eemeli opened this issue Apr 23, 2022 · 2 comments · Fixed by #179
Closed

Incorrect handling of tabs in message value #173

eemeli opened this issue Apr 23, 2022 · 2 comments · Fixed by #179

Comments

@eemeli
Copy link
Member

eemeli commented Apr 23, 2022

As identified in mozilla/pontoon#2470 (comment), 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.

@Pike
Copy link
Contributor

Pike commented Apr 23, 2022

Probably also a bug in js syntax parser, and the runtime parser.

@eemeli
Copy link
Member Author

eemeli commented Apr 23, 2022

Yeah, will need to check all the implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants