diff --git a/docs/api/command-line-switches.md b/docs/api/command-line-switches.md index f306599d371..6570758cd24 100644 --- a/docs/api/command-line-switches.md +++ b/docs/api/command-line-switches.md @@ -232,7 +232,7 @@ Specify ways of the inspector web socket url exposure. By default inspector websocket url is available in stderr and under /json/list endpoint on http://host:port/json/list. [app]: app.md -[append-switch]: app.md#appcommandlineappendswitchswitch-value +[append-switch]: command-line.md#commandlineappendswitchswitch-value [ready]: app.md#event-ready [play-silent-audio]: https://github.com/atom/atom/pull/9485/files [debugging-main-process]: ../tutorial/debugging-main-process.md diff --git a/docs/api/desktop-capturer.md b/docs/api/desktop-capturer.md index 42b7d09250b..236ae73666c 100644 --- a/docs/api/desktop-capturer.md +++ b/docs/api/desktop-capturer.md @@ -95,7 +95,7 @@ Returns `Promise` - Resolves with an array of [`Desktop which can detected by [`systemPreferences.getMediaAccessStatus`]. [`navigator.mediaDevices.getUserMedia`]: https://developer.mozilla.org/en/docs/Web/API/MediaDevices/getUserMedia -[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-macos +[`systemPreferences.getMediaAccessStatus`]: system-preferences.md#systempreferencesgetmediaaccessstatusmediatype-windows-macos ## Caveats diff --git a/docs/api/structures/ipc-renderer-event.md b/docs/api/structures/ipc-renderer-event.md index 4b2c0805ce2..1ac2def46d4 100644 --- a/docs/api/structures/ipc-renderer-event.md +++ b/docs/api/structures/ipc-renderer-event.md @@ -4,4 +4,4 @@ * `senderId` Integer - The `webContents.id` that sent the message, you can call `event.sender.sendTo(event.senderId, ...)` to reply to the message, see [ipcRenderer.sendTo][ipc-renderer-sendto] for more information. This only applies to messages sent from a different renderer. Messages sent directly from the main process set `event.senderId` to `0`. * `ports` MessagePort[] - A list of MessagePorts that were transferred with this message -[ipc-renderer-sendto]: #ipcrenderersendtowindowid-channel--arg1-arg2- +[ipc-renderer-sendto]: ../ipc-renderer.md#ipcrenderersendtowebcontentsid-channel-args diff --git a/docs/tutorial/progress-bar.md b/docs/tutorial/progress-bar.md index 6922b3464fb..93454a28808 100644 --- a/docs/tutorial/progress-bar.md +++ b/docs/tutorial/progress-bar.md @@ -32,4 +32,4 @@ win.setProgressBar(0.5) ``` [taskbar-progress-image]: https://cloud.githubusercontent.com/assets/639601/5081682/16691fda-6f0e-11e4-9676-49b6418f1264.png -[setprogressbar]: ../api/browser-window.md#winsetprogressbarprogress +[setprogressbar]: ../api/browser-window.md#winsetprogressbarprogress-options diff --git a/docs/tutorial/security.md b/docs/tutorial/security.md index 1eb899e1260..34afb4b7d25 100644 --- a/docs/tutorial/security.md +++ b/docs/tutorial/security.md @@ -814,6 +814,6 @@ which potential security issues are not as widely known. [web-contents]: ../api/web-contents.md [new-window]: ../api/web-contents.md#event-new-window [will-navigate]: ../api/web-contents.md#event-will-navigate -[open-external]: ../api/shell.md#shellopenexternalurl-options-callback +[open-external]: ../api/shell.md#shellopenexternalurl-options [sandbox]: ../api/sandbox-option.md [responsible-disclosure]: https://en.wikipedia.org/wiki/Responsible_disclosure diff --git a/script/check-relative-doc-links.py b/script/check-relative-doc-links.py index 6ecdcc0fb02..29f281f8e25 100755 --- a/script/check-relative-doc-links.py +++ b/script/check-relative-doc-links.py @@ -48,14 +48,20 @@ def getBrokenLinks(filepath): finally: f.close() - regexLink = re.compile('\[(.*?)\]\((?P(.*?))\)') + linkRegexLink = re.compile('\[(.*?)\]\((?P(.*?))\)') + referenceLinkRegex = re.compile('^\s{0,3}\[.*?\]:\s*(?P[^<\s]+|<[^<>\r\n]+>)') links = [] for line in lines: - matchLinks = regexLink.search(line) + matchLinks = linkRegexLink.search(line) + matchReferenceLinks = referenceLinkRegex.search(line) if matchLinks: - relativeLink = matchLinks.group('links') + relativeLink = matchLinks.group('link') if not str(relativeLink).startswith('http'): links.append(relativeLink) + if matchReferenceLinks: + referenceLink = matchReferenceLinks.group('link').strip('<>') + if not str(referenceLink).startswith('http'): + links.append(referenceLink) for link in links: sections = link.split('#')