-
Notifications
You must be signed in to change notification settings - Fork 4
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
Problem with the preservation of multi-line basic strings #7
Comments
Hi @MoritzRitter, thank you for bringing this up. The issue you're describing is related to the smol-toml TOML parser that the library uses. The parser should check if a string in the JavaScript object contains newline characters (\n). If it does, the string should be formatted as a multi-line TOML string when converting it back to TOML format. This behavior should preserve the new lines as expected, instead of converting the string into a basic single-line format. |
To be honest, this seems simply out of scope for smol-toml since it's not meant as an editor, only a tool that correctly converts between Javascript data representation and TOML data representation which it does correctly. It's a completely different beast to represent semantically equivalent values differently based on some syntax metadata, especially if you are even gonna change the values without saying anything about the metadata. How does your GUI itself distinguish single line strings and multiline strings? The problem seems to be that it doesn't only not distinguish them but furthermore you somehow dropped the |
@2colours, thanks for your response.
got it, so it's not capable of doing that.
the GUI doesnt distinguish anything. it just parses and stringifies using the smol-toml library. and it wouldn't really matter. Even if the text editor interpreted the
which is invalid TOML syntax. Essentially, it seems there's no way to get the |
@maliknajjar I mean it makes exactly the difference of right and wrong whether the GUI produces separate lines as one long line or not. It is a bug in guifier that it doesn't escape |
since the smol-toml library doesnt plan on supporting specifying text style in the near future. I will close this for now |
Hi @maliknajjar Thanks for the update. There seems to be a new problem with the preservation of multi-line basic strings (acc. to https://toml.io/en/v1.0.0#string):
When I add such a string like in this example:
then it is already now displayed in the widget omitting the new lines.
And when I then edit the date (or any other object) using the widgets on the right, then the string is converted to a basic string:
While the content is probably still the same, this seems not to be the behavior that the user wants. Would you agree?
Originally posted by @MoritzRitter in #5 (comment)
The text was updated successfully, but these errors were encountered: