index.jsView |
---|
3 | 3 … | function noop(){} |
4 | 4 … | var onLink = noop |
5 | 5 … | var extractor = new marked.Renderer() |
6 | 6 … | |
| 7 … | + |
| 8 … | + |
| 9 … | +extractor.code = function(code, lang, escaped) { return escaped ? unquote(code) : code } |
| 10 … | +extractor.blockquote = function(quote) { return unquote(quote) } |
| 11 … | +extractor.html = function(html) { return false } |
| 12 … | +extractor.heading = function(text, level, raw) { return unquote(text)+' ' } |
| 13 … | +extractor.hr = function() { return ' --- ' } |
| 14 … | +extractor.br = function() { return ' ' } |
| 15 … | +extractor.list = function(body, ordered) { return unquote(body) } |
| 16 … | +extractor.listitem = function(text) { return '- '+unquote(text) } |
| 17 … | +extractor.paragraph = function(text) { return unquote(text)+' ' } |
| 18 … | +extractor.table = function(header, body) { return unquote(header + ' ' + body) } |
| 19 … | +extractor.tablerow = function(content) { return unquote(content) } |
| 20 … | +extractor.tablecell = function(content, flags) { return unquote(content) } |
| 21 … | +extractor.strong = function(text) { return unquote(text) } |
| 22 … | +extractor.em = function(text) { return unquote(text) } |
| 23 … | +extractor.codespan = function(text) { return unquote(text) } |
| 24 … | +extractor.del = function(text) { return unquote(text) } |
| 25 … | + |
| 26 … | +function unquote (text) { |
| 27 … | + return text.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, '\'') |
| 28 … | +} |
| 29 … | + |
7 | 30 … | extractor.mention = function (_, id) { |
8 | 31 … | onLink({target: id}) |
9 | 32 … | } |
10 | 33 … | |