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
Option mltabs to emit m-lines when string contains tabs #15
Conversation
Thanks! Tabs are not treated like spaces to help the user avoid mistakes (by making tabs visible). Also the parser is not able to properly filter out whitespace (used by indentation) if there are tabs because there is no standard that says n spaces == 1 tab. Can you tell me your use case for the tab output and how you would handle the parsing issue? |
Thanks for the detailed analysis! I'd just like to refactor the regex definitions to be easier to read first (by removing the duplication). |
Could you please take a look at b6b021b and 8e5652b and rebase your PR? Since all tests are shared across all implementations and
? That would make it easier to only run the test on implementations that support it. Thanks! |
Rebased. |
`Hjson.stringify(value, { mltabs: true }` generate multiple lines even if the string value contains `\t` characters. Exposed on the command-line as the flag `-mltab`
@laktak ok I have followed your instructions regarding the tests as best as I understood them. Please let me know if that is what you expected. If you find it easier, feel free to edit my fork - I added you as a collaborator. |
Yes that's great! Thanks! I only tweaked the test and changed the option to a string so it can be used for #16 as well. |
Thanks for the merge! I was also confused by this distinction. I had a hard time figuring out why you had to look for tab characters in the user input. Basically, expect if I'm missing something, but you just have to count the number of characters before the beginning |
@hmalphettes @AurelienRibon would it help if this were the default option? I think this can be changed without having a negative impact. |
@laktak certainly helps if it is the default. |
@laktak I'll make a PR to make this the default. |
Many thanks for a great project!
This PR add support for generating triple quoted multiple lines even if the string value contains
\t
characters:It is exposed on the command line as the flag
-mltab
I have not figured out why the tab character would be a problem for triple quotes multiple lines.
Let me know if I missed the obvious.
Thanks!