Skip to content

Commit

Permalink
Other fixes for Mozilla docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Aug 8, 2024
1 parent 254933d commit 1c6de78
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
12 changes: 12 additions & 0 deletions config/allowed-code-link-text.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ steps(n, <jumpterm>)
"x" in obj
FileSystemHandle.requestPermission({mode: 'readwrite'})
Math.floor(x + 0.5)
MediaStream.addEventListener('addtrack', ...)
Object.defineProperty(obj, prop, { get: func, configurable: true, enumerable: true })
Object.defineProperty(obj, prop, { set: func, configurable: true, enumerable: true })
Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false
Expand All @@ -55,6 +56,7 @@ arr.slice(0, -1)
canvas.getContext('2d', { alpha: false })
canvas.toDataURL('image/jpeg', quality)
concat([v1, v2])
contain-intrinsic-size: auto none
cubic-bezier(0, 0, 1, 1)
cubic-bezier(p1, p2, p3, p4)
delete obj.x
Expand All @@ -66,8 +68,15 @@ navigator.credentials.get({otp: ..., ...})
navigator.credentials.get({publicKey: ..., ...})
new Proxy(target, handler)
slice(0, -1)
tabs.query({active: true})
tabs.query({currentWindow: true})

JS_DoubleToInt32()
NPN_GetValue()
NPP_GetValue()

Other stuff:
<all_urls>
<full version>
<module specifier map>
<significant version>
Expand All @@ -87,3 +96,6 @@ gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS)
non-standard_header
non-standard_inline
secureContext_header

declarative_net_request.rule_resources
browser_specific_settings.gecko.id
1 change: 0 additions & 1 deletion docs/warning-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,4 @@ In an editor, you can do the following regex replacements:
| `https?:\/\/(issues\.chromium\.org)\/issues\/(\d+)` | `https://crbug.com/$2` |
| `https?:\/\/(bugs\.chromium\.org\|code\.google\.com)\/p\/chromium\/issues\/detail\?id=(\d+)` | `https://crbug.com/$2` |
| `https?:\/\/(bugs\.chromium\.org\|code\.google\.com)\/p\/((?!chromium)\w+)\/issues\/detail\?id=(\d+)` | `https://crbug.com/$2/$3` |
| `https?:\/\/chromium\.googlesource\.com\/chromium\/src\/\+\/([\w\d]+)` | `https://crrev.com/$1` |
| `https?:\/\/bugs\.webkit\.org\/show_bug\.cgi\?id=(\d+)` | `https://webkit.org/b/$1` |
10 changes: 5 additions & 5 deletions src/server/create-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const allowedCodeLinkTextRec = new Map(

const allowedSpacedCodeLink = [
// HTML tags
/^<(a|area|font|iframe|input|link|meta|object|ol|script|th|tr)( [a-z-]+="[\w .…-]+"| ping| defer)+>$/,
/^<(a|area|font|iframe|input|link|meta|object|ol|script|th|tr)( [a-z-]+="[\w .…-]+"| ping| defer| sandbox| nomodule)+>$/,
/^<\?xml[^>]+\?>$/,
/^<xsl:[^>]+>$/,
/^[a-z-]+="[\w .…-]+"$/,
Expand All @@ -21,13 +21,13 @@ const allowedSpacedCodeLink = [
// want to check that methods in interface DLs don't have params
/^[\w.]+\([\w.]+(, [\w.]+)*\)$/,
// CSS code
/^([a-z-]+: ([a-z-]+|\d+(px|em|vh|vw|%)|0);?|@(container|import|media|namespace|supports) [()a-z: -]+|transform: [\w-]+\(\);?|transform-style: [\w-]+;?)$/,
/^([a-z-]+: ([a-z-]+|\d+(px|em|vh|vw|%)|0);?|@(container|import|media|namespace|supports) [()a-z\d: -]+|transform: [\w-]+\(\);?|transform-style: [\w-]+;?)$/,
// Shell commands
/^(ng|npm) [a-z\d]+$/,
// HTTP status
/^\d+ [\w '-]+$/,
// HTTP header
/^(Cache-Control|Clear-Site-Data|Connection|Content-Length|Content-Security-Policy|Cross-Origin-Opener-Policy|Cross-Origin-Resource-Policy|Permissions-Policy|Sec-Purpose|Transfer-Encoding): ([\w-]+|"[\w-]+")$/,
/^(Cache-Control|Clear-Site-Data|Connection|Content-Length|Content-Security-Policy|Cross-Origin-Opener-Policy|Cross-Origin-Resource-Policy|Feature-Policy|Permissions-Policy|Sec-Purpose|Transfer-Encoding): ([\w-]+|"[\w-]+")$/,
// MIME
/^[a-z]+\/[\w+-]+; [a-z]+=("[\w ,.-]+"|\w+);?$/,
// Macro calls
Expand All @@ -50,7 +50,7 @@ const allowedUnderscoreCodeLink = [
// Link targets
/^_(blank|parent|replace|self|top)$/,
// File names
/\.(js|html)$/,
/\.(js|html|json)$/,
// String constants
/^"\w+"$/,
// Macro calls
Expand Down Expand Up @@ -166,7 +166,7 @@ graph.forEachNode((node) => {
.contents()
.filter((i, el) => el.type === "text");
for (const text of texts) {
if (/`.*`|\*.*\*|\[.*\]\(.*\)|\b_.*_\b/.test(text.data)) {
if (/`.+`|\*.+\*|\[.+\]\(.+\)|\b_.+_\b/.test(text.data)) {
report(node, "Possibly unrendered Markdown", text.data);
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/server/process-warnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ const bugLinkShorteners: [RegExp, string][] = [
/^https?:\/\/(bugs\.chromium\.org|code\.google\.com)\/p\/((?!chromium)\w+)\/issues\/detail\?id=(\d+)/g,
"https://crbug.com/$2/$3",
],
[
/^https?:\/\/chromium\.googlesource\.com\/chromium\/src\/\+\/([\w\d]+)/g,
"https://crrev.com/$1",
],
// I don't think it works
// [
// /^https?:\/\/chromium\.googlesource\.com\/chromium\/src\/\+\/([\w\d]+)/g,
// "https://crrev.com/$1",
// ],
[
/^https?:\/\/bugs\.webkit\.org\/show_bug\.cgi\?id=(\d+)/g,
"https://webkit.org/b/$1",
Expand Down

0 comments on commit 1c6de78

Please sign in to comment.