UNPKG

@awesome-fe/translate

Version:
24 lines 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hastToMastHandlers = void 0; var all = require("hast-util-to-mdast/lib/all"); exports.hastToMastHandlers = { em: function (h, node) { return h(node, 'emphasis', { marker: node.properties['nt__marker'] }, all(h, node)); }, strong: function (h, node) { return h(node, 'strong', { marker: node.properties['nt__marker'] }, all(h, node)); }, li: function (h, node) { return h(node, 'listItem', { marker: node.properties['nt__marker'] }, all(h, node)); }, 'plain-html': function (h, node) { return h(node, 'plainHtml', { value: unescape(node.properties['value']) }, all(h, node)); }, a: function (h, node) { var href = node.properties['href']; if (href === null || href === void 0 ? void 0 : href.startsWith('linkRef:')) { var url = href.replace(/^linkRef:/, ''); return h(node, 'linkReference', { identifier: url, label: url }, all(h, node)); } else if (href) { return h(node, 'link', { url: href }, all(h, node)); } else if (node.properties['name']) { return h(node, 'anchor', { name: node.properties['name'] }, all(h, node)); } }, }; //# sourceMappingURL=hast-to-mast-handlers.js.map