| 670 | ]; |
| 671 | |
| 672 | function TurndownService (options) { |
| 673 | if (!(this instanceof TurndownService)) return new TurndownService(options) |
| 674 | |
| 675 | var defaults = { |
| 676 | rules: rules, |
| 677 | headingStyle: 'setext', |
| 678 | hr: '* * *', |
| 679 | bulletListMarker: '*', |
| 680 | codeBlockStyle: 'indented', |
| 681 | fence: '```', |
| 682 | emDelimiter: '_', |
| 683 | strongDelimiter: '**', |
| 684 | linkStyle: 'inlined', |
| 685 | linkReferenceStyle: 'full', |
| 686 | br: ' ', |
| 687 | blankReplacement: function (content, node) { |
| 688 | return node.isBlock ? '\n\n' : '' |
| 689 | }, |
| 690 | keepReplacement: function (content, node) { |
| 691 | return node.isBlock ? '\n\n' + node.outerHTML + '\n\n' : node.outerHTML |
| 692 | }, |
| 693 | defaultReplacement: function (content, node) { |
| 694 | return node.isBlock ? '\n\n' + content + '\n\n' : content |
| 695 | } |
| 696 | }; |
| 697 | this.options = extend({}, defaults, options); |
| 698 | this.rules = new Rules(this.options); |
| 699 | } |
| 700 | |
| 701 | TurndownService.prototype = { |
| 702 | /** |