encode-info.d.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Check whether to encode (as a character reference) the characters
  3. * surrounding an attention run.
  4. *
  5. * Which characters are around an attention run influence whether it works or
  6. * not.
  7. *
  8. * See <https://github.com/orgs/syntax-tree/discussions/60> for more info.
  9. * See this markdown in a particular renderer to see what works:
  10. *
  11. * ```markdown
  12. * | | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) |
  13. * | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ |
  14. * | 1 (letter outside) | x*y*z | x*.*z | x* *z | x**z |
  15. * | 2 (punctuation outside) | .*y*. | .*.*. | .* *. | .**. |
  16. * | 3 (whitespace outside) | x *y* z | x *.* z | x * * z | x ** z |
  17. * | 4 (nothing outside) | *x* | *.* | * * | ** |
  18. * ```
  19. *
  20. * @param {number} outside
  21. * Code point on the outer side of the run.
  22. * @param {number} inside
  23. * Code point on the inner side of the run.
  24. * @param {'*' | '_'} marker
  25. * Marker of the run.
  26. * Underscores are handled more strictly (they form less often) than
  27. * asterisks.
  28. * @returns {EncodeSides}
  29. * Whether to encode characters.
  30. */
  31. export function encodeInfo(outside: number, inside: number, marker: "*" | "_"): EncodeSides;
  32. import type { EncodeSides } from '../types.js';
  33. //# sourceMappingURL=encode-info.d.ts.map