Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,