diff --git a/productivity-suite/app/fragments/todos/src/worker/index.tsx b/productivity-suite/app/fragments/todos/src/worker/index.tsx index 19d916b2..7bc2e223 100644 --- a/productivity-suite/app/fragments/todos/src/worker/index.tsx +++ b/productivity-suite/app/fragments/todos/src/worker/index.tsx @@ -46,9 +46,11 @@ export default { env ).then((res) => res.text()); - const [pre, post] = initialPageHtml.split( - '
' - ); + const appRootElement = '
'; + const indexOfFragmentDiv = initialPageHtml.indexOf(appRootElement); + const indexForFragment = indexOfFragmentDiv + appRootElement.length; + const pre = initialPageHtml.slice(0, indexForFragment); + const post = initialPageHtml.slice(indexForFragment); const stream = wrapStreamInText( pre, post,