lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

🐛 BUG: Scripts inside script tags inside markdown crash dev and build

Open Tc-001 opened this issue 3 years ago • 0 comments

What version of astro are you using?

v1.0.0-beta.44

Are you using an SSR adapter? If so, which one?

no

What package manager are you using?

npm, pnpm

What operating system are you using?

Linux

Describe the Bug

Creating a markdown file with a <script> that has some script inside will error the md parser

  1. Create a markdown file with
<script type="text/javascript">
	function test() {return}
</script>
  1. Import said file into index.astro
  2. Run dev or build
 error   Failed to parse Markdown file "/home/projects/github-2zg3f6/src/pages/test.md":
  Unexpected end of file in expression, expected a corresponding closing brace for `{`
11:37:05 PM [astro] reload /src/pages/test.md
[2:19: Failed to parse Markdown file "/home/projects/github-2zg3f6/src/pages/test.md":
Unexpected end of file in expression, expected a corresponding closing brace for `{`] {
  reason: 'Unexpected end of file in expression, expected a corresponding closing brace for `{`',
  line: 2,
  column: 19,
  source: 'micromark-extension-mdx-expression',
  ruleId: 'unexpected-eof',
  position: {
    start: { line: 2, column: 19, offset: 51, _index: 1, _bufferIndex: -1 },
    end: { line: null, column: null }
  }
}

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-2zg3f6?file=src/pages/test.md

Participation

  • [ ] I am willing to submit a pull request for this issue.

Tc-001 avatar Jun 13 '22 20:06 Tc-001