Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parse: (capture, parse, state) => {
var title = SimpleMarkdown.parseInline(parse, capture[1], state);
// Remove our [0] and [1] captures, and pass the rest to
// the nptable parser
var tableCapture = _.rest(capture, 2);
var table = SimpleMarkdown.defaultRules.nptable.parse(
tableCapture,
parse,
state
);
return {
title: title,
table: table,
};
},
react: (node, output, state) => {
parse: (capture, parse, state) => {
// Remove a trailing newline because sometimes it sneaks in from when we add the newline to create the initial block
const content = Styles.isMobile ? capture[1].replace(/\n$/, '') : capture[1]
return {
content: SimpleMarkdown.parseInline(parse, content, {...state, inParagraph: true}),
}
},
},
parse: function(capture, parse, state) {
const preContent =
Styles.isMobile && !!capture[1]
? wrapInParagraph(parse, capture[1], state)
: SimpleMarkdown.parseInline(parse, capture[1], state)
return {
content: [
...preContent,
{
content: capture[2],
type: 'fence',
},
],
type: 'blockQuote',
}
},
},
parse: (capture, parse, state) => {
const content = capture[CONTENT_WITHIN_MARKERS];
return {
content: SimpleMarkdown.parseInline(parse, content, state)
};
},
react: (node, output, state) => {
parse(capture, recurseParse, state) {
return { content: SimpleMarkdown.parseInline(recurseParse, capture[1], state) };
},
const wrapInParagraph = (parse, content, state) => [
{
content: SimpleMarkdown.parseInline(parse, content, {...state, inParagraph: true}),
type: 'paragraph',
},
]