misskey-dev / mfm.js

An MFM parser implementation with TypeScript.
MIT License
108 stars 19 forks source link

Cannot parse URL with CJK #99

Closed outloudvi closed 2 years ago

outloudvi commented 2 years ago

Summary

URL with CJK will be not recognized in []().

Input

[text](https://example.com/テスト)

Expected

[
  {
    "type": "link",
    "props": {
      "silent": false,
      "url": "https://example.com/テスト"
    },
    "children": [
      {
        "type": "text",
        "props": {
          "text": "text"
        }
      }
    ]
  }
]

Actual

[
  {
    "type": "text",
    "props": {
      "text": "[text]("
    }
  },
  {
    "type": "url",
    "props": {
      "url": "https://example.com/"
    }
  },
  {
    "type": "text",
    "props": {
      "text": "テスト)"
    }
  }
]
Johann150 commented 2 years ago

Duplicate of #98.