How to use the simple-markdown.sanitizeUrl 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 leovoel / embed-visualizer / src / components / markdown.jsx View on Github external
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>
        );
      }
    },
github synzen / Discord.RSS / src / web / client / src / js / components / ControlPanel / utils / textParser.js View on Github external
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>
        )
      }
    },
github Khan / perseus / src / perseus-markdown.jsx View on Github external
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,
};
github nurdism / neko / client / src / components / markdown.ts View on Github external
html(node, output, state) {
      return htmlTag(
        'a',
        output(node.content, state),
        { href: md.sanitizeUrl(node.target) as string, target: '_blank' },
        state,
      )
    },
  },
github leovoel / embed-visualizer / src / components / aboutmodal.jsx View on Github external
react(node, recurseOutput, state) {
      return (
        <a title="{node.title}" href="{SimpleMarkdown.sanitizeUrl(node.target)}">
          {recurseOutput(node.content, state)}
        </a>
      );
    },
  },