我经常在WordPress博客和网络论坛(phpbb)上分享代码段。
我将Visual Studio 2010与Productivity Power Tools一起使用。
通过使用此扩展程序的{strong>对齐分配选项(Ctrl+Alt+]
),我得到了很好的格式:
static void Main()
{
int firstInt = 20;
int secondInt = 50;
int thisWillBeTheThirdInt = 100;
}
但是,如果我使用FireFox,Chrome或粘贴到Notepadd ++中的网站表单进行复制粘贴(或无格式复制粘贴),格式将恢复为:
static void Main()
{
int firstInt = 20;
int secondInt = 50;
int thisWillBeTheThirdInt = 100;
}
问题:我如何使用复制代码来复制代码?
到目前为止没有用的是什么:
使用Better Fixed Mixed tabs确实有所帮助,因为大多数空格都被标签取代(可以正确复制/粘贴)。但是,在复制粘贴时,仍然存在的空格仍然会导致格式混乱。
答案 0 :(得分:1)
在您的博客或论坛中,您需要使用等宽字体