build-system/tasks/check-links.js
/**
 * Filters out whitelisted links before running the link checker.
 *
 * @param {string} markdown Original markdown.
 * @return {string} Markdown after filtering out whitelisted links.
 */
Filters out whitelisted links before running the link checker.
@param {string} markdown Original markdown.
@return {string} Markdown after filtering out whitelisted links.
Filters out whitelisted links before running the link checker . @param { string } markdown Original markdown . @return { string } Markdown after filtering out whitelisted links .
function filterWhitelistedLinks(markdown) {
  var filteredMarkdown = markdown;
  filteredMarkdown =
      filteredMarkdown.replace(/(\(|\[)?http:\/\/localhost:8000/g, '');
  filteredMarkdown = filteredMarkdown.replace(/src="http.*?"/g, '');
  filteredMarkdown = filteredMarkdown.replace(/<code>(.*?)<\/code>/g, '');
  filteredMarkdown = filteredMarkdown.replace(/\ \`\`\ /g, '');
  return filteredMarkdown;
}
function filterWhitelistedLinks ( markdown ) { var filteredMarkdown = markdown ; filteredMarkdown = filteredMarkdown . replace ( / (\(|\[)?http:\/\/localhost:8000 / g , '' ) ; filteredMarkdown = filteredMarkdown . replace ( / src="http.*?" / g , '' ) ; filteredMarkdown = filteredMarkdown . replace ( / <code>(.*?)<\/code> / g , '' ) ; filteredMarkdown = filteredMarkdown . replace ( / \ \`\`\  / g , '' ) ; return filteredMarkdown ; }
Filters out whitelisted links before running the link checker.
Filters out whitelisted links before running the link checker .
// localhost links optionally preceded by ( or [ (not served on Travis) // Links in script tags (illustrative, and not always valid) // Links inside a <code> block (illustrative, and not always valid) // After all whitelisting is done, clean up any remaining empty blocks bounded // by backticks. Otherwise, `` will be treated as the start of a code block // and confuse the link extractor.