-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17fb403
commit b9c1559
Showing
11 changed files
with
575 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import React from "react"; | ||
import wcag from "../w3c/wcag/wcag22.json"; | ||
|
||
export const WcagContext = React.createContext(wcag); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { redirect } from "react-router-dom"; | ||
import type { WcagItem } from "../types"; | ||
import { parse } from "../utils"; | ||
|
||
const baseRedirectUrl = "https://www.w3.org/TR/WCAG22/" as const; | ||
|
||
export default async (item?: WcagItem) => | ||
item | ||
? redirect(`${baseRedirectUrl}#${parse(item.id)}`) | ||
: redirect(baseRedirectUrl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
export const parseId = (handle: string) => handle.split(":")[1]; | ||
|
||
export const parseNum = (num: string) => num.split(".").pop()!; | ||
|
||
export const parse = (segment: string) => { | ||
if (segment.startsWith("WCAG2")) { | ||
return parseId(segment); | ||
} | ||
if (segment.includes(".") || !isNaN(Number(segment))) { | ||
return parseNum(segment); | ||
} | ||
return segment; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
This work is being provided by the copyright holders under the following license. | ||
|
||
License | ||
|
||
By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. | ||
|
||
Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: | ||
|
||
- The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. | ||
- Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C software and document short notice should be included. | ||
- Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [$year-of-document] World Wide Web Consortium. https://www.w3.org/copyright/software-license-2023/" | ||
|
||
Disclaimers | ||
|
||
THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. | ||
|
||
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. | ||
|
||
The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders. | ||
|
||
Versions | ||
|
||
This version: https://www.w3.org/copyright/software-license-2023/ | ||
Latest version: https://www.w3.org/copyright/software-license/ | ||
Previous version: https://www.w3.org/copyright/software-license-2015/ | ||
|
||
Changes since the previous document | ||
|
||
The 2023 version updates identification of the copyright holder. | ||
|
Oops, something went wrong.