I just released a new version of my Windows Live Writer plugin Paste From Visual Studio.
The new version sports:
- More compact HTML output
- Support for non-ASCII characters
- Automatic stripping of leading whitespace
Sample output:
public string CssColor(int i) { if (i >= 0 && i < colors.Count) { string name = null; Color color = colors[i]; if (namedColors.TryGetValue(color.ToArgb(), out name) && name.Length <= 7) return name.ToLower(); else return string.Format("#{1:x2}{2:x2}{3:x2}", i, color.R, color.G, color.B); } else return "black"; }
<pre class="code"><span style="color:blue">public string </span>CssColor(<span style="color:blue">int </span>i) { <span style="color:blue">if </span>(i >= 0 && i < colors.Count) { <span style="color:blue">string </span>name = <span style="color:blue">null</span>; <span style="color:maroon">Color </span>color = colors[i]; <span style="color:blue">if </span>(namedColors.TryGetValue(color.ToArgb(), <span style="color:blue">out </span>name) && name.Length <= 7) <span style="color: blue">return </span>name.ToLower(); <span style="color:blue">else return string</span>.Format(<span style="background:yellow;color:#a31515">"#{1:x2}{2:x2}{3:x2}"</span>, i, color.R, color.G, color.B); } <span style="color:blue">else return </span><span style="background:yellow;color:#a31515">"black"</span>; }</pre>
0 Comments
