Skip to content

Unexpected escaping of characters since 2.1.1 #65

Closed
@tripodsan

Description

@tripodsan

Initial checklist

Affected packages and versions

mdast-util-to-markdown@2.1.1

Link to runnable example

No response

Steps to reproduce

the changes in mdast-util-to-markdown@2.1.1 cause unexpected escaping of normal characters, for example:

├─8  paragraph[3]
│    ├─0 strong[1]
│    │   └─0 link[3]
│    │       │ url: "https://www.example.com"
│    │       │ title: ""
│    │       ├─0 text "Curves on"
│    │       ├─1 emphasis[1]
│    │       │   └─0 text "the"
│    │       └─2 text " ipad. "

generates:

      **[Curves on_the_ ipad. ](https://www.example.com)**

it used to generate:

      **[Curves on_the_ ipad. ](https://www.example.com)**

another example:

├─2 paragraph[1]
│   └─0 emphasis[2]
│       ├─0 text "first"
│       └─1 strong[2]
│           ├─0 text "second"
│           └─1 emphasis[1]
│               └─0 link[1]
│                   │ url: "about:blank"
│                   │ title: "title"
│                   └─0 text "important"

generates:

_first**second_[important](about:blank "title")_**_

before:

_first**second_[important](about:blank "title")_**_

Expected behavior

it should not escape characters that are not needed to be escaped.

Actual behavior

it escapes unexpected characters.

Affected runtime and version

node v20.18.0

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

    👎 phase/noPost cannot or will not be acted on🙋 no/questionThis does not need any changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions