File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
packages/sandcastle/src/Gallery Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,20 @@ export function loadFromUrl(
4343) {
4444 const searchParams = new URLSearchParams ( window . location . search ) ;
4545
46+ const codeParam = searchParams . get ( "code" ) ;
47+ if ( codeParam ) {
48+ // This is a legacy support type url that was used by ion.
49+ // Ideally we use the #c= param as that results in shorter urls
50+ // The code query parameter is a Base64 encoded JSON string with `code` and `html` properties.
51+ const json = JSON . parse ( window . atob ( codeParam . replaceAll ( " " , "+" ) ) ) ;
52+
53+ return {
54+ title : "New Sandcastle" ,
55+ code : json . code ,
56+ html : json . html ,
57+ } ;
58+ }
59+
4660 if ( window . location . hash . indexOf ( "#c=" ) === 0 ) {
4761 const base64String = window . location . hash . substr ( 3 ) ;
4862 const { code, html } = decodeBase64Data ( base64String ) ;
You can’t perform that action at this time.
0 commit comments