Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview after packaging, parsing error appears when refreshing page #195

Open
2 tasks done
codersjj opened this issue Aug 4, 2023 · 0 comments
Open
2 tasks done

Comments

@codersjj
Copy link
Contributor

codersjj commented Aug 4, 2023

Describe the bug

I wrote several code blocks of html in the markdown document:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>document1</title>
</head>
<body>
  <script>

  </script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>document2</title>
</head>
<body>
  <script>

  </script>
</body>
</html>

then previewed after packaging.

From the homepage, I entered the page corresponding to the markdown document, which was normal, but at this time if I refresh the page, a parsing error will appear.

image

I think it's because the </script> in the code block was parsed as the ending tag of the <script> where window.ISLAND_PAGE_DATA is located, and then the content after that could not be parsed correctly.

Reproduction

refresh-parse-error

See: https://codesandbox.io/p/sandbox/island-app-script-issue-qy5fpq?file=%2Fisland-app%2Fdocs%2Farticle%2Fastro.md%3A24%2C7

Expected behavior

parse </script> correctly

System Info

-

Additional context

No response

Validations

  • Read the docs
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant