How to use the simple-markdown.parseInline 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 Khan / perseus / src / perseus-markdown.jsx View on Github external
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) => {
github keybase / client / shared / common-adapters / markdown / shared.js View on Github external
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}),
      }
    },
  },
github keybase / client / shared / common-adapters / markdown / shared.js View on Github external
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',
      }
    },
  },
github JetBrains / youtrack-mobile / src / components / wiki / wiki__rules.js View on Github external
parse: (capture, parse, state) => {
        const content = capture[CONTENT_WITHIN_MARKERS];
        return {
          content: SimpleMarkdown.parseInline(parse, content, state)
        };
      },
      react: (node, output, state) => {
github leovoel / embed-visualizer / src / components / aboutmodal.jsx View on Github external
parse(capture, recurseParse, state) {
      return { content: SimpleMarkdown.parseInline(recurseParse, capture[1], state) };
    },
github keybase / client / shared / common-adapters / markdown / shared.js View on Github external
const wrapInParagraph = (parse, content, state) => [
  {
    content: SimpleMarkdown.parseInline(parse, content, {...state, inParagraph: true}),
    type: 'paragraph',
  },
]