Jed Fox 2018-11-04 17:11:08 -05:00 committed by Lipis
parent e17512adcd
commit 2136fdc858
2 changed files with 38 additions and 0 deletions

View File

@ -6,3 +6,5 @@
- [ ] Ive added tests to confirm my change works.
- [ ] (If changing the API or CLI) Ive documented the changes Ive made (in the `docs/` directory)
- [ ] Ive read the [contributing guidelines](https://github.com/prettier/prettier/blob/master/CONTRIBUTING.md).
**✨[Try the playground for this PR](https://prettier.io/playground-redirect)✨**

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Redirecting…</title>
</head>
<body>
<h1>Redirecting…</h1>
<p>
Redirecting you to the appropriate playground. If the redirect doesnt
work, <a href="javascript:history.back()">go back to the PR</a> and click
the appropriate link:<br />
<img
src="https://cdn.netlify.com/f0b93f3003d5669924b6e73540bbfe07bc3d8d95/34c5d/img/blog/deploy-preview-workflow.gif"
alt="click on the link next to 'deploy/netlify'"
/>
</p>
<script>
const match = /^https:\/\/github\.com\/prettier\/prettier\/pull\/(\d+)/.exec(
document.referrer
);
if (match != null) {
const [, /* url */ pr] = match;
location.replace(
`https://deploy-preview-${pr}--prettier.netlify.com/playground`
);
} else {
const el = document.createElement("p");
el.textContent = `The referrer URL (${
document.referrer
}) was not recognized. Sorry :(`;
document.body.appendChild(el);
}
</script>
</body>
</html>