How to use the simple-markdown.defaultRules.blockQuote 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
del: {
    ...defaultRules.del,
    match: inlineRegex(/^~~([\S\s]+?)~~(?!_)/),
  },
  spoiler: {
    order: defaultRules.text.order,
    match: inlineRegex(/^\|\|([\S\s]+?)\|\|/),
    parse: (capture, parse, state) => ({
      content: parse(capture[1], state),
    }),
    react: (node, output, state) => (
      {output(node.content, state)}
    ),
  },
  blockQuote: {
    ...defaultRules.blockQuote,
    match: (source, state, previous) =>
      !/^$|\n *$/.test(previous) || state.inQuote || state.nested
        ? null
        : /^( *>>> +([\S\s]*))|^( *>(?!>>) +[^\n]*(\n *>(?!>>) +[^\n]*)*\n?)/.exec(
            source,
          ),
    parse: (capture, parse, state) => {
      const multiline = /^ *>>> ?/.test(capture[0])
      const trimmedContent = capture[0].replace(
        multiline ? /^ *>>> ?/ : /^ *> ?/gm,
        "",
      )

      const nestedContent = parse(trimmedContent, {
        ...state,
        inQuote: true,