Making WordPress.org

#6877 closed defect (bug) (fixed)

Slack icon incorrectly showing for URLs on Make

Reported by: desrosj's profile desrosj Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Make (Get Involved) / P2 Keywords: has-patch commit
Cc:

Description

I noticed while reading a recent post on the Community Make blog that all anchor tags with .slack.com show the Slack icon to the left of the link, regardless of where that string matches within the href attribute.

In this case, the link is a Google Calendar link that includes a link to a Slack channel. This is because the attr*=value substring matching selector is being used, which matches elements that contain the value anywhere within the specified attribute.

Changing the CSS selector to use the attr^=val value selector will only add the icon to elements that start with a Slack URL. I think the original intent was probably to always show the icon no matter which Slack instance is being linked to, but adding a rule for each officially endorsed Slack instance seems fine as there won't be many (if there's even others today).

Attachments (1)

6877.patch (5.7 KB) - added by desrosj 21 months ago.

Download all attachments as: .zip

Change History (4)

#1 @desrosj
21 months ago

When looking to make a patch, it seems other areas of the CSS have adopted a[href*="//wordpress.slack.com"]. This still uses *= matching, but makes it specific only to the wordpress.slack.com instance while allowing for both http and https links. The bug described here would still occur.

A Google search shows that there are no indexed instances of http://wordpress.slack.com on make.wordpress.org.

I think it's safe to change the rule to a[href^="https://wordpress.slack.com"].

@desrosj
21 months ago

#2 @dd32
21 months ago

  • Keywords commit added

I agree, I think we can limit this to https://wordpress.slack.com/ links.

#3 @dd32
18 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 12665:

Make: Use more specific CSS for matching slack URLS.

Props desrosj.
Fixes #6877.

Note: See TracTickets for help on using tickets.