const hljs = require('highlight.js');hljs.registerLanguage('repl',hljs => ({contains: [{ begin: '^> ', end: '$', // inputcontains: [{ className: 'comment', begin: '//', end: '$' },],},{ className: 'meta', begin: '^', end: '$' }, // output],}));const txt = `> foo(true) // call foo'abc'> 3 + 36`.trim();console.log(hljs.highlight('repl', txt).value);