我想从设置了Dark Theme的Visual Studio 2019社区复制代码部分,并将其粘贴到MS Word,同时保留复制的文本样式,就像在Visual Studio 2017中一样-使用默认代码样式。
带有深色主题的Visual Studio 2017-复制结果(这就是我想要的):
带有深色主题的Visual Studio 2019-复制结果(不需要):
如何在VS 2019中保留这种行为?
我测试了Copy As Html扩展名,但似乎无法解决问题(或者我遗漏了一些东西)。
答案 0 :(得分:2)
a。将BeforeCodeSnippet更改为:-
<style type='text/css'> .user{color:#006600 !important} .identifier{color: black !important;} .keyword{color: blue !important;} .literal{color: black !important;} .operator{color: black !important;} .string{color: #A31515 !important;} .number{color: black !important;} .Types{color: #2B91AF !important;} .Class{color: #2B91AF !important;} .delegate{color: #2B91AF !important;} .Interface{color: #79B351 !important;} .Interface.name{color: #79B351 !important;} .enum{color: #79B351 !important;} .enum.name{color: #79B351 !important;} .enum.member.name{color: black !important;} .comment{color: #008000 !important;} </style> <pre>
b。将EmitSpanClass更改为 true 。
c。检查EmitSpanStyle是否为真。