MCPcopy Create free account
hub / github.com/TruthHun/BookStack / TurndownService

Function TurndownService

static/word2md/turndown.js:672–699  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

670];
671
672function 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
701TurndownService.prototype = {
702 /**

Callers

nothing calls this directly

Calls 1

extendFunction · 0.70

Tested by

no test coverage detected