Hi, I have the latest and greatest of MarsEdit and is looking at migrating some old blog with code in it over to a new wordpress.com blog I've set up. Problem is syntax highlighting of this code. Wordspress supports the [sourcecode] tags, but MarsEdit adds and other formatting within those tags and it really screws up when it gets published.
Is there anything I can do to avoid MarsEdit from doing this, or a plugin for MarsEdit that enables code blocks or something. I'd really love to avoid having to dive into HTML to be able to do this.
Hi - unfortunately MarsEdit doesn't have any special knowledge of these WordPress "shortcode" tags. They are not legal HTML, so MarsEdit doesn't know what to make of them, and probably doesn't preserve them the way WordPress would like.
It's on my TODO list to look into supporting "WordPress Shortcodes" better, but unfortunately for the time being I can't really endorse using MarsEdit in a situation where you need to make use of these codes.
In my searching for an answer I saw server text filter being mentioned, is there any kind of script I could write that would be run automatically before it got sent to the server. That way I could strip away any HTML inside the shortcodes.
Btw: Keep up the great work on the product - really loving it!
Thanks for the suggestion.I can imagine at some point supporting a concept of "content type" that would inform MarsEdit which editor is most appropriate. This would be useful for varying behavior for different kinds of markup too, like Markdown for instance.
I would also *very* much like to be able to use the Rich Text Editor for most of a post, but be able to paste (or select and specify) a literal piece of HTML that won't get wrapped in anything (not even whitespace or a .)
That way, I could paste in a bare video embedding URL, or create a Wordpress shortcode, without having the entire post be in HTML.
Right now, HTML or shortcodes are getting wrapped in . This is even the case if I use "Paste HTML Source" for some reason.
Wordpress's magic requires the shortcode or special URL text to be on a line by itself, with no whitespace before or after on that line (let alone tags).
If you click on a particular type, e.g. Vimeo, you'll see how they support either a bare URL, or a shortcode to pass formatting parameters.
(It would be even better if custom rich text macros could also set their contents to be literal HTML, so I could create a menu item that would create a shortcode and pull the URL from the clipboard. But I can do that with TextExpander if need be..)
Thanks for the link to the shortcodes documentation. I just need to sit down at some point and really think through what supporting those in MarsEdit would entail.
As for the rich text macros I want to point out that in fact they are HTML based now. So if you have specific HTML you want to inject into a post from rich-text mode, a formatting-menu macro is a way to do that.
I've finally found a workaround for this. In short it's a combination of the <pre> tags that MarsEdit's rich text editor doesn't muck around too much (except for ampersands, at times) and with a special CSS class, some clever JavaScript-based plugin can automatically color those code blocks.