react-syntax-highlighter
Version:
syntax highlighting component for react with prismjs or highlightjs ast using inline styles
25 lines • 855 B
JavaScript
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import _regeneratorRuntime from "@babel/runtime/regenerator";
export default (function (name, loader) {
return /*#__PURE__*/function () {
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(registerLanguage) {
var module;
return _regeneratorRuntime.wrap(function (_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 1;
return loader();
case 1:
module = _context.sent;
registerLanguage(name, module["default"] || module);
case 2:
case "end":
return _context.stop();
}
}, _callee);
}));
return function (_x) {
return _ref.apply(this, arguments);
};
}();
});