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.mjs 854B

12345678910111213141516171819202122232425
  1. export default classifyCharacter
  2. import codes from '../character/codes.mjs'
  3. import markdownLineEndingOrSpace from '../character/markdown-line-ending-or-space.mjs'
  4. import unicodePunctuation from '../character/unicode-punctuation.mjs'
  5. import unicodeWhitespace from '../character/unicode-whitespace.mjs'
  6. import constants from '../constant/constants.mjs'
  7. // Classify whether a character is unicode whitespace, unicode punctuation, or
  8. // anything else.
  9. // Used for attention (emphasis, strong), whose sequences can open or close
  10. // based on the class of surrounding characters.
  11. function classifyCharacter(code) {
  12. if (
  13. code === codes.eof ||
  14. markdownLineEndingOrSpace(code) ||
  15. unicodeWhitespace(code)
  16. ) {
  17. return constants.characterGroupWhitespace
  18. }
  19. if (unicodePunctuation(code)) {
  20. return constants.characterGroupPunctuation
  21. }
  22. }