google / google/fonts

You should add a note about URL-encoding `|` as `%7C`

Open
#5,864 1 comment 0 reactions 0 assignees View on GitHub
-- Needs Eng team opinion I API / Website / Platform I Request
Dominant language
HTML
Stars
20.5k
Forks
2.9k
Avg merge
1d 21h
Merged PRs (30d)
95

Description

**Describe the issue**
Constructing a URL for an API call with multiple font family names can cause validation/parsing issues for a page.

**To Reproduce**
A link such as this one:

`
`

Can produce the validation error:

>Bad value [https://fonts.googleapis.com/css?family=UnifrakturMaguntia|Kalam|Noto+Music&display=swap](https://fonts.googleapis.com/css?family=UnifrakturMaguntia%7CKalam%7CNoto+Music&display=swap) for attribute href on element [link](https://html.spec.whatwg.org/multipage/#the-link-element): Illegal character in query: | is not allowed.

**Expected behavior**
A note that explains that the safest way to call the API for all situations is to URL-encode the `|` character as `%7C`.

**Additional context**

**Screenshots**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.