Skip to content
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

Formatter: escape bi-directional control characters within strings #13067

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Feb 13, 2023

This patch makes the formatter escape Unicode bi-directional control characters that appear in the following contexts (where 😂 is any of the control characters):

"😂"
"😂#{1}"
%(😂)
%Q(😂)

<<-EOS
😂
EOS

<<-EOS
😂#{1}
EOS

def foo("😂" x)
end

foo("😂": 1)
NamedTuple("😂": Int32)
{"😂": 1}

It does not cover symbol literals yet.

See #11392 and #12923.

@straight-shoota straight-shoota added this to the 1.9.0 milestone May 25, 2023
@straight-shoota straight-shoota merged commit 5761bbb into crystal-lang:master May 26, 2023
46 checks passed
@HertzDevil HertzDevil deleted the feature/format-unescaped-bidi-controls branch June 5, 2023 18:05
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants