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
escape #
in encoder so #{
can't happen in resulting string
#14
Conversation
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.
Good catch! Seems like I really missed out on interpolation when setting up the escaping. 😅
@@ -69,7 +69,7 @@ module BakedFileSystem | |||
def write(slice : Bytes) | |||
slice.each do |byte| | |||
case byte | |||
when 35_u8..91_u8, 93_u8..127_u8 | |||
when 36_u8..91_u8, 93_u8..127_u8 |
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.
Maybe add when 35_u8; @io << "\\#"
? That would result in a few bytes less in the baked string.
@@ -0,0 +1 @@ | |||
L#9U"gAc-XLA*/Ac|1M: |
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.
Could you please add a description for this file's purpose so it doesn't get lost?
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.
i can't modify the file without messing up the test. I named the folder to give hints on what it's for. Further explanation in the test.
Would you mind also adding a spec for describe "Loader::Encoder" do
it "escapes string interpolation" do
String.build do |str|
Encoder.new(str) << "foo\#{bar}"
end.should eq "foo\\\#{bar} "
end
end |
@jreinert Are you still up for this? |
No description provided.