Commit d2da1e4a240525d0319f9bedceffc570047b41bc
Hide all outer HTML of non-markdown-native tags
Charles Lehner committed on 6/14/2016, 3:14:20 AMParent: a6da62055a73bcc0ca4d0d94052c6cef7193d73e
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -1,6 +1,11 @@ | ||
1 | 1 | var toMarkdown = require('to-markdown') |
2 | 2 | |
3 | +// Get just the inner HTML, not the outer HTML | |
4 | +toMarkdown.outer = function (node, content) { | |
5 | + return content | |
6 | +} | |
7 | + | |
3 | 8 | function debounce(fn, wait) { |
4 | 9 | var timeout |
5 | 10 | return function() { |
6 | 11 | clearTimeout(timeout) |
@@ -14,14 +19,8 @@ | ||
14 | 19 | var outputText = outputEl.appendChild(document.createTextNode('')) |
15 | 20 | var opt = { |
16 | 21 | gfm: true, |
17 | 22 | converters: [{ |
18 | - filter: ['span', 'div', 'small', 'font'], | |
19 | - replacement: function (content) { | |
20 | - return content | |
21 | - } | |
22 | - }, | |
23 | - { | |
24 | 23 | filter: 'li', |
25 | 24 | replacement: function (content, node) { |
26 | 25 | content = content.replace(/^\s+/, '').replace(/\n/gm, '\n ') |
27 | 26 | var parent = node.parentNode |
Built with git-ssb-web