File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,12 @@ export type OnChange = (event?: {
183
183
currentTarget : EventTarget | HTMLElement | null | undefined ;
184
184
} ) => void ;
185
185
186
+ function base64Decode ( base64EncodedString : string ) : string {
187
+ return new TextDecoder ( ) . decode (
188
+ Uint8Array . from ( atob ( base64EncodedString ) , ( m ) => m . charCodeAt ( 0 ) )
189
+ ) ;
190
+ }
191
+
186
192
function App ( ) {
187
193
const [ searchParams ] = useSearchParams ( ) ;
188
194
const loaderData = useLoaderData < typeof loader > ( ) ;
@@ -195,7 +201,10 @@ function App() {
195
201
196
202
useEffect ( ( ) => {
197
203
if ( ! base64Body ) return ;
198
- document . documentElement . innerHTML = atob ( base64Body ) ;
204
+ let body = base64Decode ( base64Body ) ;
205
+ let frag = document . createRange ( ) . createContextualFragment ( body ) ;
206
+ document . documentElement . innerHTML = "" ;
207
+ document . documentElement . appendChild ( frag ) ;
199
208
} , [ base64Body ] ) ;
200
209
201
210
useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments