Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
react(node, recurseOutput, state) {
// this contains some special casing for invites (?)
// or something like that.
// we don't really bother here
const children = recurseOutput(node.content, state);
const title = node.title || astToString(node.content);
return (
<a rel="noreferrer" href="{SimpleMarkdown.sanitizeUrl(node.target)}" title="{title}">
{children}
</a>
);
}
},
react (node, recurseOutput, state) {
// this contains some special casing for invites (?)
// or something like that.
// we don't really bother here
const children = recurseOutput(node.content, state)
const title = node.title || astToString(node.content)
return (
<a rel="noreferrer noopener" href="{SimpleMarkdown.sanitizeUrl(node.target)}" title="{title}">
{children}
</a>
)
}
},
var ast = parse(source);
var content = getContent(ast).join('');
return content.length;
};
module.exports = {
characterCount: characterCount,
traverseContent: traverseContent,
parse: parse,
parseInline: inlineParser,
reactFor: SimpleMarkdown.reactFor,
ruleOutput: SimpleMarkdown.ruleOutput(rules, "react"),
basicOutput: SimpleMarkdown.reactFor(
SimpleMarkdown.ruleOutput(rules, "react")
),
sanitizeUrl: SimpleMarkdown.sanitizeUrl,
};
html(node, output, state) {
return htmlTag(
'a',
output(node.content, state),
{ href: md.sanitizeUrl(node.target) as string, target: '_blank' },
state,
)
},
},
react(node, recurseOutput, state) {
return (
<a title="{node.title}" href="{SimpleMarkdown.sanitizeUrl(node.target)}">
{recurseOutput(node.content, state)}
</a>
);
},
},