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.

classify-character.js 711B

12345678910111213141516171819202122232425
  1. 'use strict'
  2. var markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')
  3. var unicodePunctuation = require('../character/unicode-punctuation.js')
  4. var unicodeWhitespace = require('../character/unicode-whitespace.js')
  5. // Classify whether a character is unicode whitespace, unicode punctuation, or
  6. // anything else.
  7. // Used for attention (emphasis, strong), whose sequences can open or close
  8. // based on the class of surrounding characters.
  9. function classifyCharacter(code) {
  10. if (
  11. code === null ||
  12. markdownLineEndingOrSpace(code) ||
  13. unicodeWhitespace(code)
  14. ) {
  15. return 1
  16. }
  17. if (unicodePunctuation(code)) {
  18. return 2
  19. }
  20. }
  21. module.exports = classifyCharacter