Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

format-link-as-autolink.js 827B

1234567891011121314151617181920212223242526
  1. module.exports = formatLinkAsAutolink
  2. var toString = require('mdast-util-to-string')
  3. function formatLinkAsAutolink(node, context) {
  4. var raw = toString(node)
  5. return (
  6. !context.options.resourceLink &&
  7. // If there’s a url…
  8. node.url &&
  9. // And there’s a no title…
  10. !node.title &&
  11. // And the content of `node` is a single text node…
  12. node.children &&
  13. node.children.length === 1 &&
  14. node.children[0].type === 'text' &&
  15. // And if the url is the same as the content…
  16. (raw === node.url || 'mailto:' + raw === node.url) &&
  17. // And that starts w/ a protocol…
  18. /^[a-z][a-z+.-]+:/i.test(node.url) &&
  19. // And that doesn’t contain ASCII control codes (character escapes and
  20. // references don’t work) or angle brackets…
  21. !/[\0- <>\u007F]/.test(node.url)
  22. )
  23. }