sindresorhus / awesome-lint

Linter for Awesome lists
MIT License
611 stars 59 forks source link

`awesome-list-item` Bug with selection of link to validate #199

Open sancarn opened 3 months ago

sancarn commented 3 months ago

Please see awesome-vba. We use symbology to indicate various things from OS compatibility to application compatibility among other things. This provides users with up-front knowledge as to what they are signing up to when using such a library. If a user is using e.g. a mac they can search specifically for libraries compatible on mac etc.

I think this symbology would be useful in other awesome lists, but I feel it is required in the case of VBA.

sancarn commented 2 months ago

We have identified the source of the issue and are upgrading this to a Bug as this is really from a poor algorithm of determining where the title should be.

Existing algorithm:

// Might have children like: '{image} {text} {link} { - description}'
// Keep discarding prefix elements until we find something link-like.
while (link.type !== 'linkReference' && link.type !== 'link' && description.length > 1) {
    link = description[0];
    description = description.slice(1);
}

In my opinion the key here isn't that there is something link-like but rather that it is prefixed by -.