@awesome-fe/translate
Version:
Translation utils
18 lines • 666 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.emphasisVisitor = void 0;
function emphasisVisitor(node) {
var _a;
var marker = (_a = node.marker) !== null && _a !== void 0 ? _a : this.options.emphasis;
var content = this.all(node).join('');
// When in pedantic mode, prevent using underscore as the marker when there
// are underscores in the content.
if (this.options.pedantic &&
marker === '_' &&
content.indexOf(marker) !== -1) {
marker = '*';
}
return marker + content + marker;
}
exports.emphasisVisitor = emphasisVisitor;
//# sourceMappingURL=emphasis-visitor.js.map