@awesome-fe/translate
Version:
Translation utils
19 lines • 1.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mastToHastHandlers = void 0;
var all = require("mdast-util-to-hast/lib/all");
exports.mastToHastHandlers = {
emphasis: function (h, node) { return h(node, 'em', { 'nt__marker': node.marker }, all(h, node)); },
strong: function (h, node) { return h(node, 'strong', { 'nt__marker': node.marker }, all(h, node)); },
listItem: function (h, node) { return h(node, 'li', { 'nt__marker': node.marker }, all(h, node)); },
linkReference: function (h, node) { return h(node, 'a', { href: 'linkRef:' + (node.label || node.identifier) }, all(h, node)); },
anchor: function (h, node) { return h(node, 'a', { name: node.name }, all(h, node)); },
html: function (h, node) { return h(node, 'tag', { value: encodeURIComponent(node.value) }, all(h, node)); },
'htmlRaw': function (h, node) { return h(node, 'html-raw', { value: encodeURIComponent(node.value) }, all(h, node)); },
'comment': function (h, node) { return ({
type: 'comment',
value: node.value,
}); },
originalId: function (h, node) { return h(node, 'original-id', { translate: 'no', value: node.value }, all(h, node)); },
};
//# sourceMappingURL=mast-to-hast-handlers.js.map