Windows/Open Live Writer Code Plugin

The Live Writer Source Code Plug-in For WordPress.com Blogs

The following software is free to download and use, subject to the Creative Commons License.

This is a Live Writer Plug-In for ‘Syntax Highlighting in WordPress.com blogs’. It uses the Syntax Highlighting feature of WordPress.com to format your source code into the correct syntax for the type of source code snippet (e.g: C#, XML, Java etc). The result is a clear formatted code snippet in your blog like this:

public override System.Windows.Forms.DialogResult CreateContent(System.Windows.Forms.IWin32Window dialogOwner, ref string newContent)
{
    using (codeEntryForm entryform = new codeEntryForm())
    {
        entryform.StartPosition = FormStartPosition.CenterParent;
        DialogResult result = entryform.ShowDialog(dialogOwner); 
        if (result == DialogResult.OK)
        {
            newContent = entryform.GetData();
        }                
        return result;
    }
} 

Whilst there are numerous plug-ins for self-hosted WordPress blogs and for other blog engines this one fills the specific requirements needed for a plug-in that targets WordPress.com hosted blogs. It inserts the correct ‘Wordpress shortcode’ entry around your code snippet to ensure it is displayed correctly in your WordPress.com blog. For details of Syntax Highlighting in WordPress.com, and the supported languages, check out: http://support.wordpress.com/code.

For more details on this plug-in and how it was created then checkout my related blog posts:

1) Syntax highlighting in WordPress.com hosted blogs and how to create a windows live writer plug-in

2) New version of source code syntax highlighting live writer plugin for wordpress.com blogs/

3) Live Writer Syntax Highlighting Plug-in v1.2.0 Released

4) Live Writer Syntax Highlighting Plug-in v1.3.0 Released

5) New WordPress.com Source Code Live Writer Plugin Version (v1.4) Released

6) Minor Update (v1.4.1) Released

7) Critical Preview Fix For Live Writer Code Plugin (v1.4.2) Released

8) OpenLiveWriter Version Of Syntax Highlighter Plugin Available Now

Using the Plug-In:

Create your blog post in Live Writer as normal but when you want to key some Source Code choose Insert > Source Code Highlighter from the right hand Menu, then key or paste your source code into the pop up form. Select the type of source code it is (e.g.CSharp etc) and click insert. Once inserted you can use the properties menu bar to customise the way source code is displayed.  The plug-in will also display a preview in the editor of what the source code will look like once posted on your blog.

Screenshots:

Inserting a code snippet & setting options:
WLW1200_6 CodeEntry PropsWLW2011
Preview your code in the code editor:

CodeEntry2 CodeEntry3

For Versions of Live Writer pre 2011 preview your code in the editor:

WLWPre2010EditorPreview WLWPre2010PProps

For Live Writer 2011 you can preview your changes within your blog template externally to Live Writer:
WLW2011Edit1 WLW2011TemplatePreview WLWPre2010Preview

Features:

  1. Easy to insert code and manage it within the editor. Not only does it make your source code stand out on your blog but this plug-in also enables you to manage the code snippet easily without messing about with formatting or spell checking.
  2. Choose from the large number of languages supported by WordPress.com. Plus this list can be modified on your machine to just see a smaller list. By modifying the text file included in the download zip file, and locating it in the same folder as the plug-in, it is possible to customise the list of languages in the plug-in. If you only post code snippets in a few formats (e.g: C# and XML) then you can remove the others from the text file thus removing them from the plug-in list for improved usability. Also if WordPress add more languages to the list of supported syntaxes then it’s possible to add the new language to the text file which will allow you to use the new language syntax without downloading a new version.
  3. Supports all the features of the WordPress.com code highlighting functionality, such as ‘no toolbar’, ‘line highlighting’ etc. For the full list check out http://support.wordpress.com/code.
  4. Easy Installation. Just copy the files to the Live Writer plugins folder (see instructions below).
  5. Preview functionality shows how your code snippet will look once its posted making it easy to visualise how your post will look. For Live Writer 2011 & Open Live Writer it is not possible to view the code snippet preview on the Edit and Preview views but instead you can choose to display the code snippet externally in your browser at the click of a button. This external preview will show the code inside your cached blog theme template.
    (For Pre 2011 Versions of Live Writer you can view a preview of your code snippet within the Edit and Preview views in Live Writer itself. (NB: This is implemented by adding hidden JavaScript to your post whilst it’s in Live Writer but then substitutes this with the correct WordPress tags when you publish. This feature can be turned on/off for each code snippet))
  6. For all versions you can now preview your changes within the Code Editor window for fast review of your code changes.
  7. You can trim the whitespace from the code snippet after pasting it in.
  8. You can easily see the line and column number for each position in the code snippet to ensure that you are highlighting the right lines or that you don’t exceed your chosen snippet width.
  9. The Code Entry Window now enables scrolling so that you can easily mange your code snippet.
  10. As of V1.4.1 you can now control whether the plugin performs HTML encoding when publishing the post, useful for non-Wordpress.com hosted blogs. Configured via the Plugin Options in Live Writer. For more information see here.

Downloads For Windows Live Writer (use Version 1.x below)

Version 1.4.2  (Recommended) More Details Download Now
Version 1.4.1 More Details Download Now
Version 1.4.0 More Details Download Now
Version 1.3.0 More Details Download Now
Version 1.2.0 More Details Download Now
Version 1.1.0 More Details Download Now
Version 1.0.0 More Details No longer available

Note: This plug-in requires the Microsoft.Net Framework V2.0 or above (installed with Live Writer), available here.

Installation Guide For Windows Live Writer Plugin (v1.x.x):

To install the plug-in download it from the link above, unzip it and then copy the files to the Plugins folder under the Windows Live Writer program files folder, for example C:\Program Files\Windows Live\Writer\Plugins. Optionally you can make use of the customisable language list by updating the text file, or delete it as the plug-in will work without it .

 

Downloads For Open Live Writer (use Version 2.x.x below):

Version 2.0.0 BETA (Recommended) More Details Download Now

Note: This plug-in requires the Microsoft.Net Framework V4.5.2 or above (installed with Open Live Writer).

Installation Guide For Open Live Writer Plugin (v2.x.x):

To install the plug-in download it from the link above and unzip it and then copy the files as outlined below. Optionally you can make use of the customisable language list by updating the supplied text file, or delete it as the plug-in will work without it fine.

As OpenLiveWriter is very much BETA please be aware that the location of plugins and the way that they are handled will change in the future and this may impact your plugin when you update OLW. You have 2 options.

Option 1: By default OLW will look in the Plugins folder inside the application path (e.g: C:\Users\UserName\AppData\Local\OpenLiveWriter\app-0.5.1.3\Plugins)  but this path will change as OLW auto-updates itself (i.e. the app number will change). To install copy the plugin (and its supporting txt file in the downloaded Zip package) to that path using the latest …\app-x.x.x.x folder present on your system. Each time OLW updates to a new version you will need to re-copy or move the plugin into the new  …\app-x.x.x.x folder.

Option 2: OLW (like WLW before it) checks the registry for plugins too and so you can add a registry key telling OLW where to find the plugin. Whilst this feature is supported by OLW this should enable the plugin to survive OLW auto updates without you having to do anything. Just download and extract the plugin to a folder on your harddrive and then add a new registry key to HKEY_CURRENT_USER\SOFTWARE\OpenLiveWriter\PluginAssemblies with the name (can be anything) and the location of the plugin. For example:

RegValueExample

 

ALL SOFTWARE IS PROVIDED AS-IS. THERE IS ARE NO WARRANTIES WITH RESPECT TO SOFTWARE AND I HEREBY DISCLAIM ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY. NO WARRANTY IS MADE THAT THE SOFTWARE WILL OPERATE ERROR-FREE OR REGARDING THE RESULTS TO BE ACHIEVED.

140 comments

  1. Gerhard Lausser · · Reply

    Hi Rich,
    thanks for writing this plugin. It makes -handling with live writer so easy.The only thing i miss is the type=plain for code samples (or better, configuration file samples) where syntax highlighting is not desired.

    Greetings from Munich,
    Gerhard

    1. Gerhard, there is a source code language type of ‘text’ which should be ideal for situations where you want plain formatting. Try out the new version and see what you think.

  2. […] But how do you use the WordPress Syntax Highlighter when using Microsoft’s Live Writer (which I really find a good tool for offline writing) for posting? There are syntax highlighting Plug-ins available for Live Writer, but they are all not compatible with the WordPress way of syntax highlighting. After doing some Google searches, I’ve found a special Live Writer Plug-in supporting WordPress written by Rich Hewlett. It can be downloaded here. […]

  3. […] Windows Live Writer와 WordPress 그리고 Syntax Highlighting Published 1월 21, 2010 Uncategorized Leave a Comment 여러 가지 플러그인들이 나와 있지만 어느 것 하나 내 맘에 쏙 드는 건 아직 찾지 못했습니다. 그렇지만 주로 코드 샘플을 다른 곳에서 복사해 온다는 가정 하에 하나의 플러그인을 정했습니다. 바로가기 […]

  4. […] it turns out that Windows Live Writer has a neat extension system. Moreover, a kind soul wrote a plugin specifically tailored for use with WordPress. In particular, the plugin inserts the right […]

  5. […] wstawiane są długie kody źródłowe. Z pomocą przychodzi tutaj wtyczka odnaleziona pod adresem https://richhewlett.com/software/wlwsourcecodeplugin/. Autor zezwala na jej bezpłatne pobranie i wykorzystywanie (licencja Creative Common License). […]

  6. This is a great plug-in, I was using another one, but this one now looks more refined.
    Great job by the way.

    I appreciate it…

    Until next time,
    LEHenryJr

  7. […] Najczęściej wykorzystywana przeze mnie jest funkcja wstawiania kodu w języku C#, więc na jej poprawności zależy mi najbardziej. Okazyjnie jednak pojawia się kod w innych językach, stąd w tym poście zobaczymy jak on jest interpretowany przez wtyczkę. Jednocześnie zachęcam do przetestowania wtyczki na własnej skórze i informowanie autora o znalezionych błędach, aby mogła być ona jeszcze lepsza. Adres strony, z której można pobrać wspomnianą wtyczkę to https://richhewlett.com/wlwsourcecodeplugin/ […]

  8. Hi, Thanks for the useful plugin. I was very happy with 1.1.0. I am having plenty of problems with 1.2. I am using LiveWriter 14.0.8117.416 in Windows 7 64 bit.

    1. XML tags in my code snippet are being capitalized.
    2. This new version adds a lot of JavaScript code, which is not what I like.
    3. Preview is not working very well. Sometimes, it shows the JavaScript added by the plugin.

    1. Hi, Viv.

      Thanks for the feedback., my responses are below:

      1. The XML tags are capitalised by the WordPress.com syntax highlighter as part of the formatting and so will be shown in capitals on your blog once it’s posted regardless of using the plug-in or not.
      2. The plug-in does add JavaScript but this is purely for the preview functionality to work within Live Writer and the script will not be posted with the blog post when you submit it.
      3. Sorry to hear that preview is not working well for you, but it sounds as though the problem could be just the way Live Writer works. If you change any of the snippet’s properties in the editor then the preview will temporarily be disabled and the raw snippet code will be displayed until the view is refreshed by switching to Source or Preview views. Unfortunately Live Writer doesn’t refresh the editor view unless you switch to another view and back again. Perhaps this is the problem you’re experiencing?

  9. Really nice plugin, thanks for making it !

    There’s only one thing I’d like to change: would it be possible to use the WordPress.com tags instead of HTML + CSS + JS ? I often use the code view, so I’d prefer not to have the markup cluttered with unreadable areas like that…

    1. I’m glad you like it Thomas.

      The HTML + CSS + JS is purely to implement the Preview functionality within Live Writer and it doesn’t get included with your blog post. When you publish your post the code snippet is enclosed in the appropriate ‘sourcecode’ tags supported by WordPress. If you don’t want to see any of this markup within LiveWriter then you can disable preview for the code snippet via the right hand properties tab.

  10. Hi Rich. I like your plugin. One thing I noticed off the bat was an issue with the Wrap Lines. It appears that the code sent to WordPress looks like this

    
    
    blah blah

    . When it renders in my browser IE, Firefox, Chrome. The lines do not wrap then just extend out. If I remove the

     tags inside the WordPress Web editor then they wrap as normal.  Just wondering why the plugin needs to output the 
     tags around the  block?  Thanks.
  11. I figured it out. Please delete my previous comments above. I put it all in here.
    Basically your plugin is outputting a “pre” tag wrapper around the “sourcecode” block. I figured out you need this because wordpress will collapse the code that is returned by the GeneratePublishHtml function if the code isn’t contained within a “pre” wrapper. Unfortunately this pre wrapper is telling browsers to not wrap the lines. Therefore a CSS style=”white-space: normal” is need on the “pre” wrapper element. When this style is used the browsers will now render the code correctly without the line breaks.

    Hope this helps. Do you think it would be possible to add this style attribute into a new version of your plugin?

    Thanks

    1. Thanks for your comment and for spotting this issue. I hope to address it in the next version.

  12. Hi there–

    Thank you for the plugin. It posts well to my wordpress.com account.

    The preview doesn’t seem to be working at all for me, however. I wonder if this is because I am using Live Writer 2011 which is the version that is available from Microsoft’s site. From the screenshots on this page it appears that you are or were using an earlier version.

    Would you expect the preview functionality to work with LV 2011? If no, could you let me know what version you use, and if you have a link to download it that would be very helpful.

    Thanks again in any case.
    -nate

    1. Hi Nate. After some investigation it appears that the latest version of Live Writer (included in Live Essentials 2011) does not support running JavaScript in the preview or edit modes. This is required for my plugin to generate the preview. I am looking at ways to get around this as I want to support the latest version of Live Writer. In the meantime you may be able to download the original Live Essentials. Try this link http://g.live.com/1rewlive3/en/wlsetup-web.exe.

  13. Many thanks for this plug-in. It seems to do exactly what I want.

  14. […] pertama saya uncheck konversi dari normal quotes ke smart quotes. Selanjutnya saya juga menginstall WLW Source Code Plugin. Plugin ini memungkinkan kita untuk mengepost source code dengan format default Source Formatter […]

  15. […] WLW Code Plugin « Getting A Users Username in ASP.NET […]

  16. […] is a test of a new syntax highlighting plugin that works for WordPress-hosted blogs.  I think I’m going to like it!  This is the same […]

  17. […] choose the plug-in written by Rich Hewlett. It works fine for me and can be found here. Dit bericht is geplaatst in downloads en getagd met code block, LiveWriter, plug-in. Bookmark de […]

  18. […] Side note: I have tried almost a dozen plug-ins to get source code to appear correctly in this blog.  None of them have worked well.  The code looks beautiful in Windows Live Writer, but when published to wordpress.com it looks terrible.  I know I have recommended plug-ins before, so I waited until I was positive about this: If you are posting source code to wordpress.com hosted blog through windows liver writer, my recommendation is to use this plug-in https://richhewlett.com/wlwsourcecodeplugin/ […]

  19. […] SyntaxHighlighter Evolved plug-in.  Additionally, if you use Windows Live Writer you need the Live Writer Source Code Plug-in For WordPress.com Blogs.  With this plug-in combination, you click one button in WLW to bring up a new window that you […]

  20. Kevin · · Reply

    Richard,

    Thanks for writing this plugin.

    I’m encountering a problem where I end up with a thick grey border around my code snippet, you can see a example of this here:

    http://blog.zygonia.net/2011/05/11/test-post/

    I’ve tried two different themes and the border is always there. If I edit the post in WordPress after posting and remove the

    
    

    wrapper around the then the grey border goes away. Obviously this isn't an ideal solution especially where a post could have several code snippets.

    Any ideas how to solve this?

    I'm running WordPress 3.1.2 and posting using WLW 2011 (Build 15.4.3508.1109).

    Cheers
    Kev

    1. Hi Kev.

      I’m not able to see your test post, but the issue you describe is caused by the CSS properties on your WordPress template. It’s usually due to the CSS properties on your PRE or CODE elements specifying a border or backcolor. The site is therefore rendering correctly but not as you’d wish. I would recommend changing the CSS file to remove the border or backcolor for these HTML elements. There is not a way of automatically removing these during posting from Live Writer in this version of the plugin I’m afraid. Perhaps I can look at making the HTML output more customisable in future versions but LiveWriter is very particular on the HTML from plugins and so I’m not sure how customisable it could be.

      Rich

  21. Nice work, It would be good if you could set a default though

    1. Glad you like it.

      Do you mean a default language in code entry form? That’s a good idea. It could default to the last one you used. I’ll add it to my improvements list.

      1. Yeah that’s right, I find i’ll most likely use csharp so it would be good it it defaulted to that. last used would be fine.

      2. As of the new V1.4 version the language drop down will default to the last used by the user.

  22. Very nice. I thought I was going to have to write posts with Live Writer and then add the code snips via the WP web editor. This makes it much easier. I agree with the previous comment. Remembering the last used language would be a great improvement.

    1. As of the new V1.4 version of the plugin the language drop down will default to the last used by the user.

  23. I’ve found an issue that seems to be caused by the Div tags created by this plugin.

    1. Post a page with some source code (i’m using csharp) using this addin
    2. In Windows Live Writer Open the page you posted in the previous step

    The title and categoises of the post are not retrieved. After some testing if i remove this div tag from around the tags in wordpress then the post loads the title and category but the plugin no longer functions, however the source code still functions correctly in my post

    1. This defect has been fixed in the new version (v1.4) available for download now.

      Rich

  24. […] to paste in source code into Live Writer, is to use a code formatting plugin. I am trying out the WLW Source Code Highlighter Plugin and it is much easier than switching to the HTML view in WordPress and manually writing out the […]

  25. […] Just to save you the trouble, here is the best code formatter for windows live writer when publishing to wordpress.  This is more of a reminder for myself so’s I don’t have to scour the web to find this again, but hopefully this will save someone else some time in trying to track down a good code formatter.  You can grab it here. […]

  26. […] type Update:  Massive thanks to Rich Hewlett for his excellent Live Writer / Word Press plugin that now makes my code snippets WAY more user friendly.  Thanks Rich!  All code snippets […]

  27. […] type Update:  Massive thanks to Rich Hewlett for his excellent Live Writer / Word Press plugin that now makes my code snippets WAY more user friendly.  Thanks Rich!  All code snippets […]

  28. […] destroys the source code tags and converts them to ascii.  To take care of that I downloaded this plugin from Rich Hewlett.  Now I can easily format by blogs post and add code […]

  29. Excellent plugin! Thanks. The only issue I have is that when you download a post that has code previously inserted by using the plugin from the server I can’t edit its properties anymore. The plugin removes the id that allows it to recognize the previously entered snippet.

  30. […] it destroys the source code tags and converts them to ascii.  To take care of that I downloaded this plugin from Rich Hewlett.  Now I can easily format by blogs post and add code […]

  31. […] It is quite annoy that I have to do this every time. I have tried a bunch of plugins from WLW and none of them works right for me. Until I found this ONE! https://richhewlett.com/wlwsourcecodeplugin/ […]

  32. check ths windows live writer XsltPlugin here http://bit.ly/wQpeiF

  33. Hi, I’d like to report a bug. When I enter this into your plugin:

    <?php …some PHP code here…

    it will not convert it to a proper HTML entity, e.g. "<?php" etc. This will cause all sorts of issues, from WLW WYSIWYG mode not displaying it properly to saving it incorrectly into WordPress database and even possible data loss when this post is loaded into WordPress's own WYSIWYG editor where it will simply strip this piece of content.

    I suspect the "<" character will cause trouble in other languages too because it doesn't seem to be handled correctly.

    1. I have the same problem with csharp code such as List. The angle brackets are not being html encoded in the final output and thus my code just shows List. The gets interpreted as an html tag. Please update with a fix. Thanks.

      1. funny, the comment I just posted also doesn’t html encode the angle brackets. It should have shown up as List<T%gt;

      2. Let’s try that one last time List<T>

      3. Thanks for the comment. This issue is fixed in the new version of the plugin (v1.4) available for download now.

    2. Thanks for reporting this issue. I’m glad to report that it is fixed in the new version of the plugin (v1.4) available for download now.

  34. […] říkal jsem si, kód půjde zadat pomocí syntaxe , existuje pro to plugin do Live Writeru, a když se jedná o “oficiální” řešení na wordpress.com, určitě s tím nebude žádný […]

  35. […] A quick search for Windows Live Writer plugins that support this short code turned up many. I tried a few of the code highlighters and finally settled on the one posted by Rich Hewlett called WLW Code Plugin. […]

  36. […] WLW Code Plugin « Physical vs Virtual Kanban Boards […]

  37. […] を参考に、WLW Code Plugin « Rich Hewlettからダウンロードしたファイルを解凍し、「C:Program Files (x86)Windows Live WriterPlugins」に配置しました。 […]

  38. […] It is quite annoying that I have to do this every time. I have tried a bunch of plugins from WLW and none of them works right for me. Until I found this ONE! https://richhewlett.com/wlwsourcecodeplugin/ […]

  39. […] https://richhewlett.com/wlwsourcecodeplugin/ Like this:LikeBe the first to like this. Categories: work Comments (0) Trackbacks (0) Leave a comment Trackback […]

  40. Hey Rich, great plugin thanks for making it. I\’m experiencing the dark border issue as well but I can mess with my CSS. My biggest problem is that when I post HTML or XML code snippets it turns all of the \’less than\’ and \’greater than\’ symbols into in the post. During preview or local preview it looks fine. It\’s only messed up after post. Please see http://bit.ly/QvZqIf for an example. Any ideas?

    1. Hi, sorry for the delay in replying, I’ve been on holiday and therefore offline for a few weeks. A similar issue to this was fixed in version 1.4 of the plugin, can you confirm what version on the plugin you are using?

  41. […] ソースコードを挿入するのに The Live Writer Source Code Plug-in For WordPress.comhttps://richhewlett.com/wlwsourcecodeplugin/ […]

  42. […] ソースコードを挿入するのに The Live Writer Source Code Plug-in For WordPress.com https://richhewlett.com/wlwsourcecodeplugin/ […]

  43. Hey Rich, Thanks for your work. I am trying to use the plugin with WLW 2012 and Syntax Highlighter 3.1.3. The XML formatting is showing up as <xsl:template name="ShowPresence"> rather than XML tags. Any Ideas? Matthew

    1. Hi, thanks for your comment. The plugin only works for WordPress.com hosted blogs as it relies on the shortcode functionality built into the WP.com framework. Are you self hosting a WordPress blog? If not can you confirm the version of the plugin you are using.
      Thanks,
      Rich.

      1. Thanks! (Obviously the XML above looks fine, it shouldn’t mine is all escape characters. I am self hosting and trying 1.4, I have been using 1.3 for a while. I’ll switch back and try that one again.

      2. Matthew,
        I’ve just rolled out an update (v1.4.1) which adds the ability to turn off the HTML encoding changes I made for v1.4. This should hopefully resolve your problem whilst enabling you to benefit from the bug fixes/features introduced in v1.4. For more info on v1.4.1 check out https://richhewlett.com/2012/09/19/live-writer-syntax-highlighting-plug-in-minor-update/

        Rich

      3. Actually it doesn’t have to be hosted on WP.com. I have a self-hosted blog, and the plugin is working fine; you just need to install the “SyntaxHighlighter Evolved” WordPress plugin.

      4. Thanks for the info Thomas it’s good to know its useful to even more people.

        Rich

  44. […] the The Live Writer Source Code Plug-in For WordPress.com Blogs. The preview looks good but the published version looks really messed up. Could anybody let me know […]

  45. Works great except I am not seeing the “copy to clipboard” icon. Any ideas?
    Thanks

    1. Hi. Syntax Highlighter (on which the underlying WordPress.com Source Code highlighting functionality is built) uses Adobe Flash for the ‘Copy To Clipboard’ feature. This means if you don’t have Flash installed/enabled in your browser then you don’t see the Clipboard icon. I believe that the latest version of Syntax Highlighter avoids the use of Flash and so this problem should go away once WordPress.com update to the newer version under the hood.
      I hope this helps.
      Rich

  46. […] WLW Code Plugin is not listed in Windows Live plugin repository. It has many more language support. The installation is done by simply copying the file to the Plugins folder under the Windows Live Writer program files folder, for example C:Program FilesWindows LiveWriterPlugins. […]

  47. […] when they got transferred over to WordPress they looked horrible.  So I ended up finding a new Live Writer plugin called SyntaxHighlighter that looks even nicer on my […]

  48. […] I should take this up with. Hootsuite? Chrome? WordPress? Rich Hewlett who wrote the WordPress source code plugin for Windows Live Writer? (Thanks Rich, it’s […]

  49. I picked up that Hootsuite’s Hootlet extension for Google Chrome messes up #region and #endregion tags in code snippets I inserted with this plugin. I pretty sure this is Hootsuite’s problem, but I thought I would just give a heads up. There are some screenshots of the problem on my blog: http://pagehalffull.wordpress.com/2012/11/28/how-the-hootsuite-hootlet-broke-my-browser-kindof/

    1. Glad you like the plugin. Thanks for heads up on this issue, hopefully HootSuite will resolve this soon.

      Rich

  50. […] plug-in : Insert Code for Windows Live Writer for code snippets here, but did not work. So, tried another one which is the famous SyntaxHighlighter I was using but now as a plug-in for […]

  51. Rich, how is the HTML formatting supposed to work? Do we choose XML? I tried that and the markup just changed to (ul)(li)My Content(/li)(/ul) etc. Is this as designed? It’s mid way down my post. http://blog.aptillon.com Step 8 under Integrating with Search. Thanks!

    1. matthewmcd · · Reply

      I fiddled with it and got a brush not configured error. Then I just copied the settings from another section to get it to work. How’s it supposed to work for plain HTML?

      1. Hi Matthew, v1.4 of my plugin added html to the language dropdown and so for plain HTML select that option. Also if you experience any strange encoding issues (which seem to depend on the site design) then the latest plugin version v.1.4.1 provides an encoding override switch (see https://richhewlett.com/2012/09/19/live-writer-syntax-highlighting-plug-in-minor-update/ for more info). If you are using an older version of my plugin then selecting XML was the only way to go but the syntax highlighter wordpress plugin seemed to struggle sometimes with using XML for HTML.
        Hope this helps.
        Rich

    2. Yep, it appears that the Theme plays a big role in how well things work.

  52. Just amazing, boy. This is what I call doing a GOOD action for mankind!

  53. […] untuk mempercantik tampilan kode dalam setiap tulisan kita. Plug-in dapat ditemukan pada tautan ini, atau untuk mendownload secara langsung, dapat juga mengklik tautan ini  (versi […]

  54. […] Live Writer Syntax Highlighting Plug-in (Source Code Highlighter Plugin for WordPress.com) […]

  55. […] tags around your source code, and type the code directly into the HTML. That seems to work. I did try a plugin that supposedly handles all this for you, but wasn’t satisfied with the […]

  56. […] Source Code formatter for WordPress in WLW, by Rich Hewlett […]

  57. […] Evolved on my WordPress instance, which was super simple to do, and I can still use the Source Code Highlighter Plugin for WordPress.com plugin for Windows Live Writer which is […]

  58. […] I’ve stumbled across a great plugin from Rich Hewlett which has developed a free Windows Live Writer plugin that lets you import code into your blog and is very simple and easy to use. Once installed it resides in the “Insert” tab in “Windows Live Writer”. It has a variety of code to import into your blog but please see more at https://richhewlett.com/wlwsourcecodeplugin/ […]

  59. fantastic plugin! this is exactly what i need! thank you very much !
    anyone using this with live writer 2012 ? ( version 16.4.3508.205) i tried to paste my source code in, c language with chinese characters. but chinese chars are not displayed correctly ( i can expect that ) , but i didn’t see the syntax formating in mini preview or preview in template, however after publishing it, i can see the

     ... 

    part is in my post. but it’s inside a

     pair, and on top there is 
    
    
    
    is this normal or something is wrong ? thanks !
    1. i removed another code posting plugin that may interfere with yours, but still the preview is not working. and there is a

       pair wrapping around the  part,    is that normal ?
      1. Hi, your comment lost some of the detail but I think you are referring to PRE tags being inserted. These are normal. You might need to set this HTML encoding setting in the plugin options to get better results (the need for the setting varies between different CSS themes) https://richhewlett.com/2012/09/19/live-writer-syntax-highlighting-plug-in-minor-update/

        Rich

  60. […] syntaxí nepočítají, i když jich jinak pro SyntaxHighligher několik existuje. Jeden z nich, WLW Code Plugin (Rich Hewlett), je dokonce přímo pro WordPress.com, ale ten počítá s tagem namísto (jinak zřejmě […]

  61. […] WLW SourceCode Plug-In pro WordPress.com od Riche Hewletta (Free) – Plug-in pro vkládání code-snipettů do postů Windows Live Writeru při publikování na WordPress.com. Žádný zázrak, ale lepší řešení jsem zatím neobjevil. […]

  62. […] diese Tags in Windows Live Writer nutzen zu können gibt es ein interessantes Plug-in mit dem Namen WLW Code Plugin von Rich Hewlett. Ist das Plug-in aktiv (Kopiervorgang in den Plug-in-Ordner von Live Writer) […]

  63. captainkernel · · Reply

    I’m having a lot of trouble with this. In Live Writer the embedded code appears very large, in a narrow column with a bland green background the text is all black, I cannot resize the embedded block in any way.

    When I post it the updated blogs looks OK-ish but it has a thick grey border.

    If I select an embedded code block in Live Writer I see the settings come up on the right, but altering these has no effect on what is seen in the Live Writer editor.

    In Live Writer when I use preview in the plugin I see a warning

    “To help protect your security, your web browser has restricted this file from showing active content that could access your computer. Click here for options…”

    I click and select “Allow blocked content” but the preview doesn’t change its just plain black text on a white background (unlike your demo above which shows alternating grey/white rows).

    Every time I do an insert of code and try to preview it I get the same warning.

    I’ve tweaked some setting in IE but to no avail and there are just lots and lost of security/activeX options and I’m bewildered by it all.

    I’m using Live Writer 2012, Windows 8.1 Ultimate x64 with IE 11 installed and 1.4.1 of your plugin.

    Any ideas much appreciated.

    1. Hi. Sorry to hear you are having issues. I’ve investigated and it seems there is a bug with the preview feature that’s been caused by a recent change on the WordPress side. I will code a fix and post a new version of the plugin for download once I’ve tested it. This bug only impacts the preview and not the submitted blog post.
      The grey box around the code snippet when it’s posted to your blog is an issue with the CSS in your theme formatting the coffee snippet that way. It probably sees it as a link. A tweak to your CSS can fix this or changing themes. It’s not related to the plugin.
      Thanks for your comment.
      Rich

    2. Hi, a new version of the plug-in version 1.4.2 is now available for download from https://richhewlett.com/wlwsourcecodeplugin/ . This should address the plug-in preview issues. The security warning will still appear as thats an IE feature and is quite normal. It is possible to turn it off in the IE settings however I don’t recommend doing that as its a security feature, instead just allow the content each time.
      Rich

      1. captainkernel · ·

        Many thanks, this is greatly appreciated – I’ll explore this very soon and let you know how it goes. Sincerely Hugh Date: Tue, 26 Nov 2013 21:42:58 +0000 To: hugh_gleaves@hotmail.com

      2. captainkernel · ·

        OK I looked at this and yes the code is now displayed nicely with colors etc. in preview mode, however: 1. Symbols like > or ” are rendered in their “&” (entity) form when uploaded to a blog. 2. I can find no way to get the alternating striped background effect either in preview or uploaded. 3. The pasted code (as seen in WLW) show no format – it just appears as ordinary text, even when I click it and the blocks borders appear in the WLW editor. I’ve created a crude page on my new WordPress blog that shows the “&” issue. Thanks Date: Tue, 26 Nov 2013 21:42:58 +0000 To: hugh_gleaves@hotmail.com

      3. captainkernel · ·

        Here is blog showing “&” problem.
        http://captainkernel.wordpress.com/

      4. Hi, try turning off HTML encoding in the plugin options in Live Writer. More info can be foubd here: http://goo.gl/8qBqCz

      5. When I posted this as a comment – the square bracket stuff is lost and cant be seen when you read my comment, so here it is as an e-mail. I’ve looked at this issue some more and its totally bewildering – I just installed LW on a clean Win 8.1 laptop, set up the blog account and copied the two plugin files to the correct folder. If I run LW and grab an existing post that contains source, I get the same error that I get on my Surface table, namely the downloaded source code text has this when viewed as HTML: If I click on the source area in LW your plugin reports an error at the top of its own drawing area that says: “Selected item cannot be edited”. Can I ask if you made any kind of small change to the v 1.4.2 DLL after you initially posted it here? If I run LW on my desktop and grab the same posts, I dont see that square bracket stuff nor is it present in the post when I view it as HTML in LW and your plugin is fine, if I select the code I see the various settings etc. This is confusing as hell because it looks as if my desktop and my laptop/surface are actually seeing different data when the download a page in LW which makes no sense to me. I’ve checked the DLL size and all copies of it on all three machines are the same size. However on the desktop there’s another odd folder: C:\Program Files (x86)\Windows Live Writer\Plugins and that has other highlighters in it, this folder may exist though from an install of an older version of LW, I cant recall. I am totally at a loss to understand what I’m seeing and so I can only use LW and your plugin from my desktop not my laptop or surface, all three are running Windows 8.1 Thanks

        Date: Tue, 26 Nov 2013 21:42:58 +0000 To: hugh_gleaves@hotmail.com

      6. This certainly is bewildering. No changes have been made since I posted 1.4.2 and I only created one copy of it. The square bracket code looks to be the final mark-up that is sent to the WordPress blog when a post is finally posted. The same should be seen if you view your post in the WordPress Dashboard Posts page. On that page before the square bracket mark-up it should also have div tag that tells LiveWriter that this was created via a plugin, enabling the post to be re-edited in LiveWriter (this is Windows Live Writer functionality). You should be able to reopen that post though and have it recognise that the plugin was used, although I’m not sure if I have ever re-opened a previously submitted blog post across multiple machines.
        I’ve just managed to test re-opening a submitted post across different machines and I too am getting the same problem. I will keep investigating but it appears to be a Live Writer issue related to how Live Writer records an internal reference of plugins (which is unique per machine).

  64. Korporal Kernel · · Reply

    Something odd occurred earlier, you might have some ideas.

    If I downloaded a post to my Surface using Live Writer, but embedded source code cant be edited and the plugin complains. The code was created by the same plugin though but from my desktop (again via Live Writer).

    If I examine the downloaded post in LW, looking at the HTML, I see this odd square bracket section appearing after the stuff created by your plugin:

    
    If I visit the blog page and look at the source as seen by IE, I see this:
    
    
    
    
    
    
    If I go to my desktop PC, use LW and download the same post, the sequare brackets are absent, the downloaded post is the same as what's rendered in IE.
    
    This is just bewildering, utterly mindblowing stuff!
    
    I'm hoping you have some ideas!
    
    Thanks.
  65. I’ve looked at this issue some more and its totally bewildering – I just installed LW on a clean Win 8.1 laptop, set up the blog account and copied the two plugin files to the correct folder. If I run LW and grab an existing post that contains source, I get the same error that I get on my Surface table, namely the downloaded source code text has this when viewed as HTML:

    If I click on the source area in LW your plugin reports an error at the top of its own drawing area that says:

    “Selected item cannot be edited”

    Can I ask if you made any kind of small change to the v 1.4.2 DLL after you initially posted it here?

    If I run LW on my desktop and grab the same posts, I dont see that square bracket stuff nor is it present in the post when I view it as HTML in LW and your plugin is fine, if I select the code I see the various settings etc.

    This is confusing as hell because it looks as if my desktop and my laptop/surface are actually seeing different data when the download a page in LW which makes no sense to me.

    I’ve checked the DLL size and all copies of it on all three machines are the same size.

    However on the desktop there’s another odd folder:

    C:\Program Files (x86)\Windows Live Writer\Plugins

    and that has other highlighters in it, this folder may exist though from an install of an older version of LW, I cant recall.

    I am totally at a loss to understand what I’m seeing and so I can only use LW and your plugin from my desktop not my laptop or surface, all three are running Windows 8.1

    Thanks

  66. Thanks for taking time to look at this, I’m just making do with wordpress’s own editor for now, but do like LW a lot.

  67. […] Writer で Syntax Highlighter を使うと改行がおかしくなるので、WLW Code Plugin という Syntax Highlighter […]

  68. […] found this great live writer plugin that allows you to copy and paste code snippets straight into live writer set the code language and […]

  69. […] creating one, but further searches show that Rich Hewlett did it and is actually maintaining it: WLW Code Plugin for WordPress.com Blogs. You just need to download the zip file, extract the files the WLW Plugins directory, and restart […]

  70. You’re a life saver… or would that be “Windows Live” saver — Microsoft has removed all of the plug-ins for Windows Live Writer from being downloaded, and I needed a code formatted,not only could I actually download yours, but yours works better than the “code insert” plugin that I had used for years! Thanks a ton!

    P.S. Did need to disable the HTML from being escaped – so if others have that same issue, the author of this plugin has very nicely included that as one of the plug-in options.

  71. […] WLW SourceCode Plug-In pro WordPress.com od Riche Hewletta (Free) – Plug-in pro vkládání code-snipettů do postů Windows Live Writeru při publikování na WordPress.com. Žádný zázrak, ale lepší řešení jsem zatím neobjevil. […]

  72. work perfect with SyntaxHighlighter Evolved(plugin) on my personal WordPress , thx.

  73. Feeling quite silly that in 7 years of blogging I am discovering this now! Awesome plugin, thanks a ton!

  74. […] Hoping that the world had improved since the last time I evaluated my alternatives I set out on a quick google session today. Indeed the wordpress.com has added support for syntax highlighting , leveraging Alex Gorbatchev’s SyntaxHighlighter. This is good, but like I said, I like the Windows Live Writer. Continuing my search quest I found, and installed, a plugin that enables this feature from within my good old writer. It is called WLW code plugin. […]

  75. […] However WordPress.com do support a built in Syntax Highlighter described here: https://en.support.wordpress.com/code/posting-source-code/ and I found a plugin for it here: https://richhewlett.com/wlwsourcecodeplugin/. […]

  76. I am also suffering from the “thick borders” problem reported by a couple of other people. When I publish the post and take a look at the source I see this:

    
    
    SyntaxHighlighter.config.bloggerMode = true;
    SyntaxHighlighter.all();
    

    (don't be distracted by the example being about SyntaxHighlighter... in danger of getting a bit meta!)

    Is it to be expected that there are two pre tags?

    When I edit the post using the online wordpress.com editor and make an unrelated change and then save the post, the border disappears and the source HTML shows that:

    has been removed.
    
    Also if I use the online editor to manually add a code snippet using the square bracket tags, thje snippets are fine.
    
    I am using v1.4.2 with WLW 2012. 
    
    So there is a workaround but I wondered if a fix could be made to prevent the extra pre getting added?
  77. Unfortunately my previous posy got scrambled, but suffice it to say that two pre tags are being added. The superfluous one looks like this:

    pre style=”white-space:normal;”

    If I edit my post online it disappears and if I use the square brackets technique for escaping code snippets I don’t get the problem.

  78. […] summarized in a past post, I have been using Source Code Highlighter for WordPress.com (which is a plugin for Windows Live Writer, i.e., WLW, my preferred blog writer) to post formatted […]

  79. Hi Richard,

    I notice that your latest blog post code snippets are suffering from the same problem. They have a thick grey border where as the snippet on this page doesn’t.

    It is caused by an additional, unclosed pre tag.

  80. […] WLW SourceCode Plug-In pro WordPress.com od Riche Hewletta (Free) – Plug-in pro vkládání code-snipettů do postů Windows Live Writeru při publikování na WordPress.com. Žádný zázrak, ale lepší řešení jsem zatím neobjevil. […]

  81. […] plugin – https://richhewlett.com/wlwsourcecodeplugin/, pozor, je potřeba vybrat nějaké vhodné téma. Některá témata dost kazí výsledek. […]

  82. I encounter two issues:

    (1) Can’t prevent lines wrapping

    (2) Display codes with HTML entries (e.g., <), instead of characters (e.g., '<'), for instance,

    public final class Integer extends Number implements Comparable<Integer>

  83. […] use WLW Code Plugin, but display codes with HTML entries (e.g., ‘& lt ;’), instead of HTML characters […]

  84. […] Evolved (wordpress插件)和WLW Code Plugin (Windows Live […]

  85. […] kept me from using it until now was the missing WLW Pluging (The Live Writer Source Code Plug-in For WordPress.com Blogs) from Rich Hewlett. I always used to […]

  86. I can’t get it working on OLW 0.6.0.0 There’s nothing in the plugin config

    1. Hi, I’m not able to reproduce any problems with OLW 0.6. Was it working for you before it upgraded to v0.6?

      1. No, I’ve just tried to install it for the first time.

      2. Finally I get the plugin working. The problem was I forgot to unblock the .dll file
        Thanks for this pluging!

  87. This is awesome, thank you!
    I am so tired of WP mangling posts.

What do you think? Leave a comment.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: