UNPKG

@awesome-fe/translate

Version:
38 lines 1.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.customCompiler = void 0; var strong_visitor_1 = require("./strong-visitor"); var emphasis_visitor_1 = require("./emphasis-visitor"); var list_item_visitor_1 = require("./list-item-visitor"); var anchor_visitor_1 = require("./anchor-visitor"); var original_id_visitor_1 = require("./original-id-visitor"); var html_comment_visitor_1 = require("./html-comment-visitor"); var html_raw_visitor_1 = require("./html-raw-visitor"); var html_tag_visitor_1 = require("./html-tag-visitor"); var ng_doc_directive_visitor_1 = require("./ng-doc-directive-visitor"); function createTableCellVisitor(tableCell) { return function (node, parent, position, bullet) { var text = tableCell.call(this, node, parent, position, bullet); return text.replace(/\n/g, '
').replace(/\\\|/g, '|'); }; } /** * Teach remark that some HTML blocks never include markdown */ function customCompiler() { var processor = this; var Compiler = processor.Compiler; var visitors = Compiler.prototype.visitors; visitors.listItem = list_item_visitor_1.listItemVisitor; visitors.strong = strong_visitor_1.strongVisitor; visitors.emphasis = emphasis_visitor_1.emphasisVisitor; visitors.anchor = anchor_visitor_1.anchorVisitor; visitors['comment'] = html_comment_visitor_1.htmlCommentVisitor; visitors['htmlRaw'] = html_raw_visitor_1.htmlRawVisitor; visitors['htmlTag'] = html_tag_visitor_1.htmlTagVisitor; visitors.originalId = original_id_visitor_1.originalIdVisitor; visitors.tableCell = createTableCellVisitor(visitors.tableCell); visitors.ngDocDirective = ng_doc_directive_visitor_1.ngDocDirectiveVisitor; } exports.customCompiler = customCompiler; //# sourceMappingURL=custom-compiler-plugin.js.map