safe.d.ts 1000 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Make a string safe for embedding in markdown constructs.
  3. *
  4. * In markdown, almost all punctuation characters can, in certain cases,
  5. * result in something.
  6. * Whether they do is highly subjective to where they happen and in what
  7. * they happen.
  8. *
  9. * To solve this, `mdast-util-to-markdown` tracks:
  10. *
  11. * * Characters before and after something;
  12. * * What “constructs” we are in.
  13. *
  14. * This information is then used by this function to escape or encode
  15. * special characters.
  16. *
  17. * @param {State} state
  18. * Info passed around about the current state.
  19. * @param {string | null | undefined} input
  20. * Raw value to make safe.
  21. * @param {SafeConfig} config
  22. * Configuration.
  23. * @returns {string}
  24. * Serialized markdown safe for embedding.
  25. */
  26. export function safe(state: State, input: string | null | undefined, config: SafeConfig): string;
  27. import type { State } from 'mdast-util-to-markdown';
  28. import type { SafeConfig } from 'mdast-util-to-markdown';
  29. //# sourceMappingURL=safe.d.ts.map