-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix quote within quotes formatted incorrectly by fmt #7045
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
Conversation
|
I think it could be easier to change |
|
That's actually a great idea @francislavoie |
|
Sorry for the late reply. I will modify the code and update the pull request. |
|
Oh this is going to be a nice addition! :) |
|
@keystroke3 any interest in finishing this up? |
|
Apologies for the delay in delivering the fix, life got in the way. I will attempt to work it and deliver by the end of next week. If I can't, then I will update the issue as such so someone else can pick it up. |
|
I still want to fix this, I will need more time, hopefully this weekend I can make some time. Thanks for the patience. |
|
I need to synchronize with the repo, so I will create a new pull request. |
|
OK, I tried the suggested way of using a rune, but it proved more confusing for me to implement. So I used a string instead and checked the cases five we can have; no quote, backtick, quote, quoted backtick and backticked quote: If you feel the suggested way is better, please feel free to reject and re-write as you see fit. I would also like to see how the suggestion looks like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think that'll work... at least better than what we had before!
Fixes #6998 by looking for `" and "` patterns. If the first quote character is encountered before the second one, then the second character is treated as quoted and the outer quote block ends there. If the second character is encountered before the first, then the inner quote is considered closed, but the other one is not closed. So after the second " in `"" we are still in backtick block. For `"` we are not within any quote block after the last `