Skip to content

Markdown/MDX URL shorthand syntax <http://some-url.com> isn't supported #141

@marcofranssen

Description

@marcofranssen

Following mdx file fails.

This is some markdown with a shorthand syntax for urls <https://marcofranssen.nl>.
This is shorter then doing the full syntax like [https://marcofranssen.nl](https://marcofranssen.nl)
for the cases where my link text equals the hyperlink itself.
[ERROR] [plugin esbuild-xdm] Error: Unexpected character `/` (U+002F) before local name, expected a character that can start a name, such as a letter, `$`, or `_` (note: to create a link in MDX, use `[text](url)`)

    _mdx_bundler_entry_point-d461f132-071c-406d-ab5f-9b7ee69ebf34.mdx:315:9:
      315 │ - <https://marcofranssen.nl>

This very similar markdown/mdx works with https://github.com/hashicorp/next-mdx-remote. Using exactly the same remark and rehype plugins.

Also filed an issue with mdx-bundler as it seems this is the component contentlayer is using for this.

kentcdodds/mdx-bundler#159

Similarly I also seem to get errors on the frontmatter divider.

[ERROR] [plugin esbuild-xdm] Error: Cannot handle unknown node `raw`
    at Object.unknown (file:///Users/marco/code/priv/nextjs-blog/node_modules/hast-util-to-estree/index.js:155:9)
    at Object.one [as handle] (file:///Users/marco/code/priv/nextjs-blog/node_modules/hast-util-to-estree/node_modules/zwitch/index.js:52:17)
    at all (file:///Users/marco/code/priv/nextjs-blog/node_modules/hast-util-to-estree/index.js:583:28)
    at Object.root (file:///Users/marco/code/priv/nextjs-blog/node_modules/hast-util-to-estree/index.js:508:20)
    at Object.one [as handle] (file:///Users/marco/code/priv/nextjs-blog/node_modules/hast-util-to-estree/node_modules/zwitch/index.js:52:17)
    at toEstree (file:///Users/marco/code/priv/nextjs-blog/node_modules/hast-util-to-estree/index.js:119:24)
    at file:///Users/marco/code/priv/nextjs-blog/node_modules/xdm/lib/plugin/rehype-recma.js:15:20
    at wrapped (file:///Users/marco/code/priv/nextjs-blog/node_modules/trough/index.js:111:16)
    at next (file:///Users/marco/code/priv/nextjs-blog/node_modules/trough/index.js:62:23)
    at done (file:///Users/marco/code/priv/nextjs-blog/node_modules/trough/index.js:145:7)

    _mdx_bundler_entry_point-0630f1b9-63ca-4796-8c77-73aca0f3d548.mdx:0:0:
      0 │ ---

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked-upstreamThis issue is currently blocked by another problem/limitation in an upstream packagemeta: stale

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions