summaryrefslogtreecommitdiffstats
path: root/web/react/utils/markdown.jsx
blob: 8c63810cde0d6413a2a5a0dd41d2212133a3d18f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.

const marked = require('marked');

export class MattermostMarkdownRenderer extends marked.Renderer {
    link(href, title, text) {
        let outHref = href;

        if (outHref.lastIndexOf('http', 0) !== 0) {
            outHref = `http://${outHref}`;
        }

        return super.link(outHref, title, text);
    }
}