Skip to content

Unterminated template when parsing template literals with multiple newlines (regression from v1) #1945

@shilman

Description

@shilman

Initial checklist

Affected packages and versions

@mdx-js/mdx

Link to runnable example

https://stackblitz.com/edit/github-rumgbj?file=index.js

Steps to reproduce

Add an extra \n between .foo and .bar styles in the linked stackblitz example

Expected behavior

It should compile successfully. We are using this pattern in Storybook's starter template:

https://raw.githubusercontent.com/storybookjs/storybook/next/lib/cli/src/frameworks/common/Introduction.stories.mdx

Actual behavior

It will crash with

Could not parse expression with acorn: Unterminated template

Or perhaps this is an intentional breaking change in MDXv2?

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions