How to use the colorette.strikethrough function in colorette

To help you get started, we’ve selected a few colorette examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zamotany / react-slate / packages / react-slate-reflow / src / render / applyStyle.js View on Github external
const applySingleStyle = memoize((key: string, value: string, text: string) => {
  switch (key) {
    case 'fontWeight':
      return value === 'bold' ? colorette.bold(text) : text;
    case 'fontStyle':
      return value === 'italic' ? colorette.italic(text) : text;
    case 'textDecoration': {
      switch (value) {
        case 'line-through':
          return colorette.strikethrough(text);
        case 'underline':
          return colorette.underline(text);
        default:
          return text;
      }
    }
    case 'textTransform': {
      switch (value) {
        case 'uppercase':
          return text.toUpperCase();
        case 'lowercase':
          return text.toLowerCase();
        case 'capitalize':
          return capitalize(text);
        default:
          return text;