Skip to content

Facebook share URL rejects URLs with underscores in domain name #13

Description

@waharnum

This issue resulted in having to remove the social media link implementation until we can figure out a way around it. FB's sharer URL validator seems to be strict and follow the distinction made in this Stack Overflow post between domain name and hostname.

Twitter's share URL is OK with them, and pasting a link to a hostname with underscores directly into FB works.

Replication:

Possible workarounds:

  • do space replacement on hyphens as well as underscores. Convert any hostnames with underscores into hyphenated ones when sharing to social media. Disadvantage: people can no longer use hyphenated words in subdomains
  • do space replacement in subdomain via a double hyphen -- as well as underscores. Convert any hostnames with underscores into double hyphentated when sharing to social media.
  • travel back in time and make the hostname spec the same as the domain name spec Judged non-viable

Option 2 is probably the least bad.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions