[BUG]: Markdown provided in `types[key].link` is injected as-is into HTMLAnchorElement's href attribute

Đang mở
#520 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@theworker02 đang làm issue này rồi.

Từ ngày 26/9/2026.

  • #539 của @theworker02 — đang mở
  • #549 của @matbrgz — đã đóng, không merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
61/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu với cấu hình types tùy chỉnh đã được ghi chép và tái hiện anchor được tạo bằng giá trị Markdown được báo cáo trong types[key].link. Theo dõi cách giá trị đó trở thành HTML được tạo, sau đó xác minh rằng hành vi mong đợi tạo ra một anchor hoàn chỉnh thay vì đặt chuỗi Markdown vào href.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

📝 Describe the bug

When using the recommended setup when defining custom types, the following configuration:

"types": {
  "core": {
    "symbol": "🏵️",
    "description": "Core team",
    "link": "[<%= symbol %>](https://github.com/bl-portal-bot)"
  }
}

...ends up generating the following cell:

<td align="center" valign="top" width="14.28%">
  <a href="https://github.com/terrymun">
    <img src="https://avatars.githubusercontent.com/u/5593067?v=4?s=96" width="96px;" alt="Terry Mun-Andersen"/>
    <br />
    <sub><b>Terry Mun-Andersen</b></sub>
  </a>
  <br />
  <!-- NOTE: This is where the problem is, see `href` value below -->
  <a href="[🏵️](https://github.com/orgs/LEGO/teams/bricklink-portal)" title="Core team">
    🏵️
  </a>
  <a href="https://github.com/lego/bl-portal-frontend/commits?author=terrymun" title="Code">💻</a></td>

...which is incorrect, as the markdown is injected as-is into the href attribute of the HTMLAnchorElement. Updating the link field to just contain the URL will then generate the correct output:

"types": {
  "core": {
  "symbol": "🏵️",
    "description": "Core team",
    "link": "https://github.com/bl-portal-bot"
  }
}
<td align="center" valign="top" width="14.28%">
  <a href="https://github.com/terrymun">
    <img src="https://avatars.githubusercontent.com/u/5593067?v=4?s=96" width="96px;" alt="Terry Mun-Andersen"/>
     <br />
     <sub><b>Terry Mun-Andersen</b></sub>
  </a>
  <br />
  <!-- NOTE: Here the `href` value is correct -->
  <a href="https://github.com/orgs/LEGO/teams/bricklink-portal" title="Core team">
    🏵️
  </a>
  <a href="https://github.com/lego/bl-portal-frontend/commits?author=terrymun" title="Code">💻</a>
</td>
👣 Steps to Reproduce

Use the following configuration to add a custom emoji key as described in the docs:

"types": {
  "core": {
  "symbol": "🏵️",
    "description": "Core team",
    "link": "[<%= symbol %>](https://github.com/bl-portal-bot)"
  }
}

This results in the markdown string being inserted as-is into the href attribute.

🎯 Expected behavior

Using "link": "[<%= symbol %>](https://github.com/bl-portal-bot)" should generate the entire HTMLAnchorElement correctly.

💡 Additional context

No response

🤝 Participation
  • I am willing to submit a pull request for this issue.
Ngôn ngữ chính
JavaScript
Star
424
Fork
151
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của all-contributors/cli

Tất cả issue của all-contributors/cli

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.