all-contributors / all-contributors/cli

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

Đang mở
#520 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
425
Fork
149
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 📝 Describe the bug

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

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

...ends up generating the following cell:

```html


Terry Mun-Andersen


Terry Mun-Andersen





🏵️

💻
```

...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:

```json
"types": {
"core": {
"symbol": "🏵️",
"description": "Core team",
"link": "https://github.com/bl-portal-bot"
}
}
```

```html


Terry Mun-Andersen


Terry Mun-Andersen





🏵️

💻

```

### 👣 Steps to Reproduce

Use the following configuration to add a custom emoji key as [described in the docs](https://allcontributors.org/en/bot/configuration/):

```json
"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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.