sindresorhus / awesome-lint

Linter for Awesome lists
MIT License
600 stars 56 forks source link

Images and emojis in ToC items and headings #162

Closed grem11n closed 1 year ago

grem11n commented 1 year ago

Currently, the code as below produces either ToC item does not match corresonding heading or link not found error depending on whether an image or emoji is included into the Markdown link syntax, i.e. is inside [ ]. Yet, emojis and custom images do not break Markdown links.

Sample code (dots ... correspond to an arbitrary paragraph text).

- ⚙️ [Gear Emoji](#gear-emoji)
- <img src="media/image.png" width="20" height="20" alt="image"/> [Custom Image](#custom-image)

## ⚙️ Gear Emoji
...

## <img src="media/image.png" width="20" height="20" alt="image"/> Custom Image
...

Thus, neither emojis nor custom images are allowed in ToC and headings. Is it done on purpose, or can you otherwise allow emojis in ToC?

Thank you!

sindresorhus commented 1 year ago

Thus, neither emojis nor custom images are allowed in ToC and headings. Is it done on purpose, or can you otherwise allow emojis in ToC?

It's not done on purpose, but it does have the benefit of not letting people create messy readme's with lots of unnecessary emojis.

grem11n commented 1 year ago

Although, some emojis can make a list a bit prettier I totally understand that it can easily go out of hand. Thank you for the explanation!