How to use the simple-markdown.defaultRules.codeBlock function in simple-markdown

To help you get started, we’ve selected a few simple-markdown 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 jaylineko / discohook / src / markup / parseMarkup.tsx View on Github external
{output(node.content, state)}
      
    ),
  },
}

const inlineRules: ReactRules = {
  ...baseRules,
}

const blockRules: ReactRules = {
  ...baseRules,
  newline: defaultRules.newline,
  paragraph: defaultRules.paragraph,
  codeBlock: {
    order: defaultRules.codeBlock.order,
    // eslint-disable-next-line unicorn/regex-shorthand
    match: anyScopeRegex(/^```(?:([\da-z-]+?)\n+)?\n*([\S\s]+?)\n*```/i),
    parse: (capture, _, state) => ({
      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
      language: capture[1]?.trim(),
      content: capture[2],
      inQuote: state.inQuote,
    }),
    react: (node, _, state) => (
      
    ),
  },