Skip to content

position info missing when use plain [url] syntax #79

@JounQin

Description

@JounQin

Initial checklist

Affected package

remark-gfm@4.0.1

Steps to reproduce

https://github.com/Project-HAMi/HAMi/pull/1271

[https://github.com/Project-HAMi/HAMi/pull/1271]

Actual behavior

The first link and text both have correct position info, while the second link and texts all have no position info unexpectedly.

{
  "type": "root",
  "children": [
    {
      "type": "paragraph",
      "children": [
        {
          "type": "link",
          "title": null,
          "url": "https://github.com/Project-HAMi/HAMi/pull/1271",
          "children": [
            {
              "type": "text",
              "value": "https://github.com/Project-HAMi/HAMi/pull/1271",
              "position": {
                "start": {
                  "line": 1,
                  "column": 1,
                  "offset": 0
                },
                "end": {
                  "line": 1,
                  "column": 47,
                  "offset": 46
                }
              }
            }
          ],
          "position": {
            "start": {
              "line": 1,
              "column": 1,
              "offset": 0
            },
            "end": {
              "line": 1,
              "column": 47,
              "offset": 46
            }
          }
        }
      ],
      "position": {
        "start": {
          "line": 1,
          "column": 1,
          "offset": 0
        },
        "end": {
          "line": 1,
          "column": 47,
          "offset": 46
        }
      }
    },
    {
      "type": "paragraph",
      "children": [
        {
          "type": "text",
          "value": "["
        },
        {
          "type": "link",
          "title": null,
          "url": "https://github.com/Project-HAMi/HAMi/pull/1271",
          "children": [
            {
              "type": "text",
              "value": "https://github.com/Project-HAMi/HAMi/pull/1271"
            }
          ]
        },
        {
          "type": "text",
          "value": "]"
        }
      ],
      "position": {
        "start": {
          "line": 3,
          "column": 1,
          "offset": 48
        },
        "end": {
          "line": 3,
          "column": 49,
          "offset": 96
        }
      }
    }
  ],
  "position": {
    "start": {
      "line": 1,
      "column": 1,
      "offset": 0
    },
    "end": {
      "line": 3,
      "column": 49,
      "offset": 96
    }
  }
}

Expected behavior

position should always be there

Runtime

node@18.20.8

Package manager

yarn@4.9.2

Operating system

macOS Sequoia 15.6.1

Build and bundle tools

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🤞 phase/openPost is being triaged manually

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions