将终端颜色编码的文本转换为Nodemailer电子邮件中的彩色文本

时间:2019-07-11 23:06:50

标签: nodemailer color-coding terminal-color

我喜欢以编程方式将以下颜色编码的文本转换成彩色的nodemailer电子邮件。如何使用react / javascript做到这一点?

[\n   ...\n   {\n     context: {\n     }\n     values: [\n       ...\n       {\n         context: {\n\u001b[31m-          rank: 0\u001b[39m\n\u001b[32m+          rank: 2\u001b[39m\n\u001b[31m-          whitelist: false\u001b[39m\n\u001b[32m+          whitelist: true\u001b[39m\n         }\n       }\n       {\n         context: {\n\u001b[31m-          rank: 0\u001b[39m\n\u001b[32m+          rank: 3\u001b[39m\n\u001b[31m-          whitelist: false\u001b[39m\n\u001b[32m+          whitelist: true\u001b[39m\n         }\n       }\n       ...\n       {\n         context: {\n\u001b[31m-          rank: 2\u001b[39m\n\u001b[32m+          rank: null\u001b[39m\n\u001b[31m-          whitelist: true\u001b[39m\n\u001b[32m+          whitelist: false\u001b[39m\n         }\n       }\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n       ...\n     ]\n   }\n   ...\n   ...\n   ...\n   ...\n   ...\n ]\n

0 个答案:

没有答案