How to use the simple-markdown.defaultRules.Array 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 deltachat / deltachat-desktop / src / renderer / components / message / MessageMarkdown.js View on Github external
function assign (rule, order, object = {}) {
  return Object.assign({}, rule, { order }, object)
}

// function ignoreScope (rule) {
//   return Object.assign(rule, {
//     match: anyScopeRegex(rule.match.regex)
//   })
// }

// function ignoreScopeAssign (rule, order, object = {}) {
//   return ignoreScope(assign(rule, order, object))
// }

const previewRules = {
  Array: defaultRules.Array,
  // strong: ignoreScopeAssign(defaultRules.strong, 1), // bold
  // em: ignoreScopeAssign(defaultRules.em, 1), // italics
  // ubold: assign(ignoreScope(defaultRules.u), 2, { react: defaultRules.strong.react }),
  // del: ignoreScopeAssign(defaultRules.del, 3),
  // inlineCode: ignoreScopeAssign(defaultRules.inlineCode, 12),
  text: assign(defaultRules.text, 100)
}
const rules = Object.assign({
  // new mailto (open chat in dc?)
  // blockQuote ? (requires css; could be used for replies)
  // mentions? (this component requires somekind of access to the chat memberlist)
  // codeBlock: assign(defaultRules.codeBlock, 11, {
  //   react: function (node, output, state) {
  //     var className = node.lang
  //       ? 'markdown-code markdown-code-' + node.lang
  //       : undefined