The Live Writer Source Code Plug-in For WordPress.com Blogs
- For information on the plugin and it’s features see below.
- For downloads and setup instructions check here.
- For troubleshooting tips check here.
- There is now a fully online version here https://WPCodePreview.com
The following software is free to download and use, subject to the MIT 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.
To download the plugin visit the “Downloads and Setup” page.
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:
Preview your code in the code editor:
Preview your changes within your blog template externally to Live Writer:
Features:
-
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.
-
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.
-
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.
- Easy Installation. Just copy the files to the Live Writer plugins folder (see instructions below).
- 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)) - For all versions you can now preview your changes within the Code Editor window for fast review of your code changes.
-
You can trim the whitespace from the code snippet after pasting it in.
-
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.
- The Code Entry Window now enables scrolling so that you can easily mange your code snippet.
- 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.
DOWNLOAD & Setup Instructions
For more information and how it was built check out the “More Info” page.
Also there is now a fully online version at https://WPCodePreview.com
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.
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
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.
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
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.
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?
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…
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.
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
. When it renders in my browser IE, Firefox, Chrome. The lines do not wrap then just extend out. If I remove the
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
Thanks for your comment and for spotting this issue. I hope to address it in the next version.
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
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.
Many thanks for this plug-in. It seems to do exactly what I want.
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
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
Nice work, It would be good if you could set a default though
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.
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.
As of the new V1.4 version the language drop down will default to the last used by the user.
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.
As of the new V1.4 version of the plugin the language drop down will default to the last used by the user.
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
This defect has been fixed in the new version (v1.4) available for download now.
Rich
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.
check ths windows live writer XsltPlugin here http://bit.ly/wQpeiF
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.
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.
funny, the comment I just posted also doesn’t html encode the angle brackets. It should have shown up as List<T%gt;
Let’s try that one last time List<T>
Thanks for the comment. This issue is fixed in the new version of the plugin (v1.4) available for download now.
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.
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?
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?
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
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.
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.
Rich, I rolled back to 1.3 and it’s working again. http://www.ableblue.com/blog/archive/2012/09/11/show-presence-in-sharepoint-search-results/
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
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.
Thanks for the info Thomas it’s good to know its useful to even more people.
Rich
Works great except I am not seeing the “copy to clipboard” icon. Any ideas?
Thanks
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
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/
Glad you like the plugin. Thanks for heads up on this issue, hopefully HootSuite will resolve this soon.
Rich
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!
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?
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
Yep, it appears that the Theme plays a big role in how well things work.
Just amazing, boy. This is what I call doing a GOOD action for mankind!
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
i removed another code posting plugin that may interfere with yours, but still the preview is not working. and there is a
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
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.
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
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
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
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
Here is blog showing “&” problem.
http://captainkernel.wordpress.com/
Hi, try turning off HTML encoding in the plugin options in Live Writer. More info can be foubd here: http://goo.gl/8qBqCz
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
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).
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:
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
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.
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.
work perfect with SyntaxHighlighter Evolved(plugin) on my personal WordPress , thx.
Feeling quite silly that in 7 years of blogging I am discovering this now! Awesome plugin, thanks a ton!
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:
(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:
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.
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.
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>
I can’t get it working on OLW 0.6.0.0 There’s nothing in the plugin config
Hi, I’m not able to reproduce any problems with OLW 0.6. Was it working for you before it upgraded to v0.6?
No, I’ve just tried to install it for the first time.
Finally I get the plugin working. The problem was I forgot to unblock the .dll file
Thanks for this pluging!
This is awesome, thank you!
I am so tired of WP mangling posts.
There is a problem with OLW 0.6. This is the log:
SyntaxHighlight_WordPressCom_OLWPlugIn.dll’ —> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
Thanks for your work.
Problem fixed after edit the OpenLiveWriter.exe.config . The conf is
Hi, thanks for the plugin and post.
I am following your instructions on how to deploy the plugin for OLW and none of the 2 options work for me. My os is win10 and my account is local admin. Have you any suggestion.
-Yaniv
Hi, thanks for the plugin and post.
I am following your instructions on how to deploy the plugin for OLW and none of the 2 options work for me. My os is win10 and my account is local admin. Have you any suggestion.
-Yaniv
Hi Yaniv, the zip file may be marked as blocked by windows after it was downloaded which can cause problems when trying to use the plugin. Right click on the downloaded zip file > properties > unblock to resolve this. See microsoft link here for more info.
I hope this solves your problem.
Rich
I have verified it is not blocked. The extracted contents include 2 files: SyntaxHighlight_WordPressCom_OLWPlugIn.dll (49 kb) and SyntaxHighlight_WordPressCom_OLWPlugIn.txt (1 kb),
Any other suggestion ?
Are there any errors or is the plugin just not appearing in Live Writer? Does the plugin appear in the Options? Have you checked that you are using Open Live Writer for the latest plugin and not Windows Live Writer. The new plugin supports OLW whereas older versions support WLW.
Rich
Hi Rich,
The plugin for Open Live Writer works just fine. But I notice that all my quotes in my PowerShell script get HTML Encoded. How can this be fixed?
Example:
$resourceType = "Microsoft.Web/sites/config"
should be:
$resourceType = “Microsoft.Web/sites/config”
Cheers!
Octavie
Hi Octavie,
Try toggling the “Disable HTML Encoding” flag in the Plugin options inside of Live Writer. See screenshot here.
Regards,
Rich
My code is showing wrapped in
tags which displays around the content in my post. How can I get rid of these?
Hi Reed. All snippets are wrapped in “sourcecode” shortcode tags to enable wordpress to replace these at display time with the source code view. It’s natural to see them before you publish but if you are seeing them after publishing then there is something wrong with your wordpress install.
Hi Rich, I did the unblock of the zip copied two files into my app-0.6.0.0 folder but it doesn’t appear, I am stuck help me out here please
Hi, firstly check that you are using “Open Live Writer” for the V2 of the plugn or if you are still on “Windows Live Writer” then use V1.x. Did you add the two files into a “Plugins” folder under app-0.6.0.0 folder (as opposed to adding them to the root of app-0.6.0.0)? Also check that the DLLs themselves are unblocked after extracting from the unblocked Zip file. If still no luck check the OLW log file here C:\Users\XXXYOURUSERXX\AppData\Local\OpenLiveWriter\Open Live Writer.log for any errors, for more info see https://arjunachith.wordpress.com/2016/12/26/open-live-writer-plugin-not-working/ . Hope that helps.
Rich
Thanks Rich, I am using Open Live Writer that I just downloaded before this plugin, I added the two files in the \Plugins folder under app-0.6.0.0 (and just for checking in the app-0.6.0.0 folder also) DLLs are unblocked, in the log I am getting this, how to fix it?
“System.IO.FileNotFoundException: Could not load file or assembly ‘WindowsLive.Writer.Api, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
File name: ‘WindowsLive.Writer.Api, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
Ah ok, so it looks like a mismatch between the versions of OLW vs WLW. The WindowsLive.Writer.Api is used by Windows Live Writer and not by Open Live Writer. As this is appearing in the log it means you are either using WINDOWS Live Writer and not OPEN Live Writer OR you are using the V1.x version of my plugin with OPEN Live Writer. In Summary please check that you are running Open Live Writer (http://openlivewriter.org/ ) with plugin Version 2.0.
Rich
Good god, I was using your plugin meant for WLW instead of OLW, you know what I think your post is too long, if you can place the links for both on top of your post it would be much easier, just a thought, never the less awesome stuff and things for helping me out, it works now
I’m glad we found the problem. You’re right about the layout of the post, I keep meaning to tidy it up. Happy to help.
*Thanks 🙂
Hi Rich,
I have installed ver 2 and having an issue with the following 2 signs in the code snippet when formatting for t-sql: (greater than and smaller than it becomes something like: >)
Thanks ahead
-Yaniv
Hi Yaniv, try toggling the html encoding option in the plugin options as that may help.
Rich
Hi Rich,
Can you please show an example for that?
Thanks
-Yaniv
Hi. Details here. https://richhewlett.com/2012/09/19/live-writer-syntax-highlighting-plug-in-minor-update/
Hope it helps.
Rich
Thanks Rich for your quick reply. But I think there is a misunderstanding, the issue I experience is with WOW and not WLW.
I was using WLW happily for years but following a recent format I found out that is is no longer available for download
Both plugin versions (OLW and WLW) have feature parity and so that html toggle feature is in both versions.
Thanks Rich! This seems like the only workable code-plugin for open live writer out there.
What plugin should I use for my wordpress site (not wordpress.com)? I tried syntaxhighlighter evolved, this almosts works but it shows the [sourcecode] tag in the beginning and does not replace quot; with actual ” chars.
Thanks
Thanks Rich!, seems like the only code plugin for Open Live Writer out there
What plugin should I use on my wordpress site (not wordpress.com) ? I tried syntaxhighlighter evolved, which almost works, but it shows [sourcecode] tag in the beginning and does not replace quot; with actual ” characters
Thanks
Hi. You shouldn’t need a plugin for your wordpress site for the sourcecode tags to work as I believe the functionality is built into self hosted wordpress sites out the box.
No nothing happens if I deactivate highlighter plugins. The code will be stand out yes, but nothing is being highlighted, just the font is changing to courier? I think. So the plugins are parsing something (just not correct).
Hi, I try to use your plugin with Open Live Writer app-0.6.2. I follow instruction Option 1 and 2, but nothing work.
I don’t see the plugin in the Insert Banner
Hi Arnaud. Have you installed Live Writer via the Windows Store? I’ve just found out that the Store version doesnt yet support plugins. If you have the store version you would need to remove it and install it via the openlivewriter.org website.
If you are not using the windows store version and are still having the problem then it is likely that you have not right clicked on the zip file after downloading (and before extracting) and choosen to ‘unblock’ it. That’s the most common issue.
I’ve just found a different issue with OpenLiveWriter 0.6.2 and plugins that prevents users reselecting the code to edit properties which I will investigate but it seems to be a writer issue not a plugin issue.
Regards,
Rich
It would be nice to be able to specify the source for SyntaxHighlighter. I use WP offline.
Hi. The plugin just adds the WordPress shortcode tags into your post. The highlighting is handled by WordPress and so the source is not something that can be set by the plugin. I agree it would be a good feature for WordPress to include.
This seems to no longer work with OLW 0.6.2 and WordPress.com. Any chance of an update?
Hi, to be honest there are a few issues with Live Writer since it became Open Live Writer as opposed to Windows Live Writer and it seems the latest version 0.6.2 is the least plugin friendly from my experience. The plugin does still work in V0.6.2 but it doesnt look like it is. You can insert code and post the article and it will correctly highlight the code, however in v0.6.2 the ability to re-edit the options of the code snippet you have entered is broken and so it is not possible to select the Code in the editor and re-open the editor settings toolbar. Its worth noting that the plugin no longer formats the code in the Live Writer editor (due to changes/bugs in Live Writer) but the code will be formatted correctly when you post to your blog. If you post a test post to your blog using the (Post Draft to Blog button) and then view it in WordPress then you should be able to see that it has been formatted correctly. Using a draft post will allow you to confirm that it is working without you having to publish the test blog post.
So far I have not been able to get a fully featured Plugin working with Open Live Writer but I will keep plugging away when I get some time. Unfortunately it appears that the Open Live Writer project is dormant with no new releases I may be limited as to what I can do with 0.6.2.
Rich
Hi Rich,
I just downloaded, unlocked and placed at the correct location. Restarted OLW and the plugin is seen in the application. The problem i face is that when inserting a code block it does not get formatted by rather remains as ordinary plain text.
Thank You
-Yaniv
Hi. The plugin no longer formats the code in the Live Writer editor (due to changes/bugs in Live Writer) but the code will be formatted correctly when you post to your blog. If you post a test post to your blog using the (Post Draft to Blog button) and then view it in WordPress then you should be able to see that it has been formatted correctly. Using a draft post will allow you to confirm that it is working without you having to publish the test blog post.
Rich
Hi Rich
I have missed your reply and posted again. However I just tried 2 posts, a draft and a real post but the code block appears as plain text unformatted.
OLW is my favorite blogging app, I really hope we can get this to work.
Thank You
-Yaniv
Hi, thank you for making this plugin.
Hope you will be able to help.
I have installed the plugin and it can be seen as Enabled under the Plugins in OLW.
The issue I face is that the inserted code block does not get formatted (i have tried sql and powershell)
Thanks
-Yaniv