File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @typescript/sandbox " : patch
3+ ---
4+
5+ getInitialCode should not use URL hash without full prefix
Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ import lzstring from "./vendor/lzstring.min"
77 */
88export const getInitialCode = ( fallback : string , location : Location ) => {
99 // Old school support
10- if ( location . hash . startsWith ( "#src" ) ) {
10+ if ( location . hash . startsWith ( "#src= " ) ) {
1111 const code = location . hash . replace ( "#src=" , "" ) . trim ( )
1212 return decodeURIComponent ( code )
1313 }
1414
1515 // New school support
16- if ( location . hash . startsWith ( "#code" ) ) {
16+ if ( location . hash . startsWith ( "#code/ " ) ) {
1717 const code = location . hash . replace ( "#code/" , "" ) . trim ( )
1818 let userCode = lzstring . decompressFromEncodedURIComponent ( code )
1919 // Fallback incase there is an extra level of decoding:
You can’t perform that action at this time.
0 commit comments