Skip to content

Conversation

@apple502j
Copy link
Contributor

@apple502j apple502j commented Feb 7, 2021

Resolves #56
Resolves #58
Resolves scratchfoundation/scratch-www#3497
Resolves scratchfoundation/scratch-gui#5299
Resolves scratchfoundation/scratch-vm#3749

parse.js now checks the number of backslashes. An escaped backslash is represented by 2 backslashes, so if it matches odd number of backslashes (e.g. \\\b), it uses current behavior, and if it doesn't (e.g. \\\\b), it does not strip at all.

Added 2 unit tests.

@benjiwheeler
Copy link

Amalgamating some feedback from the team --

We took a quick look and it looks good — it fixes some open issues we had, though a more thorough review of this PR would have to check to make sure we’re not undoing what was fixed for scratchfoundation/scratch-vm#1077

Since this PR relates to a complex issue that no one is currently working on/thinking about, this seems like a good candidate for something like a "PR-apalooza" (where a bunch of us can look at it at once)

@benjiwheeler
Copy link

Marked this as good for a palooza in the future, per conversation with @kchadha

GarboMuffin added a commit to TurboWarp/scratch-parser that referenced this pull request Aug 19, 2021
@AmazingMech2418
Copy link

This seems like it should work! It will still catch backspaces and, looking more at the errors thrown, it seems the issue is because the backslash is escaping a quote that shouldn't be escaped after the backspace is removed, so this should fix that!

@cwillisf cwillisf self-requested a review November 22, 2022 15:14
@cwillisf cwillisf changed the title fix(parse): do not remove backslashes followed by b ENA-174 fix(parse): do not remove backslashes followed by b Nov 22, 2022
@aoneill01 aoneill01 self-requested a review December 9, 2022 22:49
Copy link
Contributor

@aoneill01 aoneill01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @apple502j! This looks good to me. I can't think of a way to break this. I also pulled it into my local scratch-www and tested by uploading some hand-crafted project files.

@aoneill01 aoneill01 merged commit 7244904 into scratchfoundation:master Dec 13, 2022
@scratch-deployer
Copy link

🎉 This PR is included in version 5.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants