Skip to content

The image link has an extra \ added during the conversion process #64

Closed as not planned
@hyoban

Description

@hyoban

Initial checklist

Affected packages and versions

2.1.2

Link to runnable example

https://codesandbox.io/p/sandbox/remark-debug-formatted-autolink-simple-forked-mhn96l

Steps to reproduce

const sourceMarkdown =
  "![](https://image-proxy.zslren.com/img-proxy/?k=3507a87d&u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Ftc9Zic7wWc9BZCDeUpBKjNhykdf3v3OKrGjF1mYlX8BEm3zCWWkhMH4S362huEz93Dz9qqIhJHmH4aLqiaOQa2jQ%2F0%3Fwx_fmt%3Djpeg)";

const mdast = remark().parse(sourceMarkdown);
const contents = toMarkdown(mdast);

Expected behavior

The image link should be

https://image-proxy.zslren.com/img-proxy/?k=3507a87d&u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Ftc9Zic7wWc9BZCDeUpBKjNhykdf3v3OKrGjF1mYlX8BEm3zCWWkhMH4S362huEz93Dz9qqIhJHmH4aLqiaOQa2jQ%2F0%3Fwx_fmt%3Djpeg

Actual behavior

The image link is

https://image-proxy.zslren.com/img-proxy/?k=3507a87d\&u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2Ftc9Zic7wWc9BZCDeUpBKjNhykdf3v3OKrGjF1mYlX8BEm3zCWWkhMH4S362huEz93Dz9qqIhJHmH4aLqiaOQa2jQ%2F0%3Fwx_fmt%3Djpeg

An extra \ appears before &u=, causing the image to not be displayed correctly.

Affected runtime and version

[email protected]

Affected package manager and version

No response

Affected OS and version

No response

Build and bundle tools

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    👀 no/externalThis makes more sense somewhere else👎 phase/noPost cannot or will not be acted on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions