blob: 96da5421754e828a4c98f2d5ca70cd36a52e0e36 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// 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}`;
}
let output = '<a class="theme" href="' + outHref + '"';
if (title) {
output += ' title="' + title + '"';
}
output += '>' + text + '</a>';
return output;
}
}
|