Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Is Mars Edit stripping quote marks?

edited April 2012 in MarsEdit
I seem to remember something like this a long time ago, but I just realized that all my single, straight quote marks are being stripped out when I post to WordPress. At first I thought there were just a couple of careless typos, but after manually fixing these in Mars Edit and reposting, they are gone again. Smart quotes and double quotes (straight/dumb or curly/smart) are not affected. If I edit the post in WordPress (a pain!), they are fine. Any ideas?


  • The index page says there is one comment, but nothing is showing up? This is a test post to see if I have a problem...
  • Weird - I did respond but it must not have stuck. Let me try again.

    Do you mean that when you post e.g. "Here is a quoted word: 'test'" to your blog, it shows up as "Here is a quoted word: test"?

    It's hard to imagine MarsEdit being responsible for this. The first thing I usually advise in situations like this is to disable all WordPress plugins, to try to zero in on whether there a conflict or one of the plugins is causing the behavior. Is that feasible for your site as a quick test?

  • Yes, your example is what is happening. Two reasons why I wondered if it was a Mars Edit issue: 1. It began happening after I upgraded to the last version of ME (3.5). 2. When I reopen the post in ME after posting, the quotes are missing there also, not just on the web version--even though they *were* present in ME before I posted. And I suppose, 3, I've not had any updates to my WP plugins in a while (I don't run very many, mostly 2 spam filters and maybe 2 or 3 others).
  • Usually the only way that the content gets modified by MarsEdit is if it's deemed somehow "invalid" for transmission to the blog (i.e. it has some illegal characters or something), then it gets passed through a "tidy" process that tries to clean it up. I would be surprised if that stripped single quotes, but you never know!

    If you can capture the network log it might help me to pinpoint the problem.

    1. Open MarsEdit
    2. Select Window -> Network Log from the menu bar.
    3. Clear the log if it's not already empty.
    4. Try to send a sample post to the blog again from MarsEdit, with single quotes in it.
    5. Copy the network log contents.

    I recommend mailing me the log contents instead of posting here: Thanks!


  • Rod, thanks again for sending me the log by email. I want to follow up here in case it helps anybody else. I found this discussion on WordPress's forums that seems very similar if not identical to the issue you are seeing:

    In that case it seemed as though the issues did trace back to server versions of libxml2, which seems like it could be related to your situation too. I wonder if you could check to see if there is a newer version of libxml2 plugin that you have installed available?

  • Not according to the plugin autoupdate in WordPress. I'll check the version number and see if I can verify the current version on the plug-in page.
  • My version of "LibXML2 Fix" is 0.2.4.

    If you refer to the actual version number of "LibXML2" on the server, then I'll have to see if I can figure out how to find that file and its version number.

    The thread you referenced is to posting with the iOS WP app and it looks like it was a problem in the app itself rather than in LibXML2, though I don't doubt that this may be related.

    My WP install is running on my site on a hosting server. Stats from there which may be relevant:

    Platform Type: Debian
    MySQL Version: 5.0.91-log
    Perl Version: 5.8.8
    PHP Version: 5.2.12

    Other than that, I don't know how to find any other version numbers or even if I have access to determine such. I could submit a support ticket to my hosting company to inquire if that would help. If anyone can tell me how to determine the libxml2 version, I'd appreciate it.
  • As of last Oct. when I had a similar problem (though then with angle brackets), I was told that

    "libxml2 is installed in our server with the version 2.6.32"

    I just found the server PHP test page:

    PHP configuration includes:
    DOM/XML enabled
    DOM/XML API Version 20031129
    libxml Version 2.6.32
    HTML Support enabled
    XPath Support enabled
    XPointer Support enabled
    Schema Support enabled
    RelaxNG Support enabled
    - - -

    The support page for the LibXML-fix plugin says that:
    "PHP 5.2.9 and libxml2 2.7.3" are required to avoid the problem fixed by the plugin, so my host is still running an old version of libxml2. In the past they have declined to update that file. They told me that:

    "The libXML Version which we are currently using on our server is 2.6.32. The version 2.7.8, which is released is not yet compatible with our server. The version: 2.6.32 is supported in our shared hosting platform. Please submit your suggestion for a service change at . If the priority for your suggestion is high then our engineering team will start working on this. But there is no ETA for the stable version of libXML getting upgraded."

    So hopefully my current issue isn't related to libXML2!

    Standing by...


  • Thanks for all the legwork, Rod. I'm starting to think it would be a really interesting test to see if posting from another client exhibits the same issue. Is it convenient for you to try posting to your blog from an iOS client like the WordPress app, or from another Mac app like ecto? It would be useful to zero in on whether this is a MarsEdit-only issue or something affecting our blog in general.

  • Test post from iOS WordPress app on my iPhone *retains* the single quotes (and converts them to curly quotes as usual). See here:

  • Hmm. I am guessing that the conversion to curly quotes is circumventing the issue. Have you ever used ecto before? It's pretty similar to MarsEdit as far as setting it up. And I think it will probably preserve the apostrophes, so it might be a better test to see if it causes the same issue on your blog:

    If you are able to download and try it out with ecto that would be another useful data point. Sorry we are not making too much progress here. I hope we will have a breakthrough soon.

  • Sorry to be slow responding. Here's a link to a sample post using ecto:

    The single quotes are preserved and WordPress automatically inserted the smart/curly versions.
  • Thanks, Rod. I'm piecing together all the information now. It sounds like, based on the comment here from daniloercoli:

    That you are indeed suffering another one of the nuanced issues of the libxml2 issue, from running the older version. According to his comment there the libxml2 fix plugin doesn't cover the apostrophe/quotes issue discussed in that thread, and which you are evidently running into again now.

    Unfortunately the "updated version" he linked to from that comment is no longer a valid link. I'm not sure exactly what he tweaked in the plugin but probably something specifically to translate these apos; characters into literal apostrophes or their numeric counterparts, which don't seem to provoke the bug in libxml2.

    The workaround for the WordPress for iOS and ecto scenarios seems to be that they never escape the ' character and always leave it as-is. I am not completely opposed to making this change, but my understanding is that the ' and " characters are also reserved and need to be escaped to be 100% proper. I view this workaround as something of a mucking up of MarsEdit just to suit a broken libxml2 library.

    I am frankly frustrated with web server admins who refuse to address this issue. They caused the probably initially by upgrading one or both of libxml2 and PHP to the versions that are installed now, and it's irresponsible to leave things in a broken state and claim that the later versions are "not compatible" with their setup. Another option for them (as I understand it) would be to downgrade one or both of them to avoid the conflict between the two libraries.

    I think at the very least it's worth checking in with the server team again to see if they have had any change of perspective about the prospects of updating their libxml2 library.

  • Doing a little more research I have discovered it may be possible to circumvent the issues if I continue escaping the characters, but use numeric escape codes instead of e.g. &apos. I'll look into this. If there's a workaround I can make that will alleviate the problem while still leave me strictly encoding everything I need to, I'd be happy to do that.
  • If you could make that change to decimal encoding in a beta version, I'd be glad to test it on my server for you. (You have my email; I doubt you want to post a link to a beta version here.)
  • Cool, I will let you know when I have something to try.
  • This problem just cropped up for me recently too. My server admin refuses to update so I've been using the libxml2 fix as well. Looking for a fix, but I'm not a real techie.
  • Thanks, Paige. Stay tuned here and I'll post something soon I hope. I am thinking to play it safe I will probably make the "fix" in MarsEdit an optional thing that you can turn on with a secret preference first, in case it has negative side-effects for people who aren't publishing to one of these problematic hosts.
  • I'm finding the problem effecting apostrophes. I guess that's the same problem.
  • Folks - I have put together a beta test build with support for a new "secret" preference setting that would make MarsEdit behave encode the contents of a post somewhat unconventionally, but in a way that may improve the behavior with these buggy servers running older libxml2 and php libraries.

    If you'd like to try out the beta version and let me know how it works for you, that would be great.

    1. Quit MarsEdit.
    2. Open Terminal App from Applications -> Utilities on your Mac
    3. In Terminal, paste and press return to run this command:

    defaults write RSUseNumericXMLEntityEncodings -bool YES

    4. Download the beta version of MarsEdit and open it:

    5. Try to connect to your blog again, and publish a post with the problematic characters included.

    I'll be curious to hear how this works for you all. Because the change in behavior here is really not ideal from a "purist" perspective, it's somewhat painful for me to offer this workaround ;) But if it helps you all then I'm probably willing to ship a public version of MarsEdit with the workaround solution in place. Hopefully over time the servers will get their acts in gear and I will eventually be able to remove the workaround.

  • RodRod
    edited May 2012
    Thanks Daniel. I'll try it shortly. I just put up another post and realized there was another new problem that's related: it also strips the quote marks from an href so that the entire post become the link! I fought that this past week unsuccessfully; couldn't figure out what I was doing wrong, so finally gave up and posted manually from the WP Dashboard (a pain!). When the same thing happened again tonight, I realized what was happening. The curious thing is that none of this was happening just two or three weeks ago, so something changed. My WP installation shows all the same version numbers that it has had since last fall (i.e, for the related files, libxml2 and php libraries; the WP version number is the latest release, 3.3.2). I don't know if it was the last update to Mars Edit or the last WP update (I think both have been updated in the last month?), but something broke something. Back with a beta version test report soon. (BTW, might want to also post an "undo" command for Terminal; I'd guess it would be identical except changing YES to NO?)
  • It works! Thanks much. I appreciate that you are a "coding purist"! But also flexible enough to help us contend with recalcitrant system admins. :)

    Test post is here:
  • Great to hear it works, Rod! I am also glad that you appreciate my position about making the change unilaterally. I feel much better keeping the "canonical" behavior by default and allowing people to change it as necessary.
  • Bless you, Daniel, for implementing this fix! It saved me a lot of headaches.
  • cheard - I am glad to hear it!
  • Daniel - is this yet a fix for MarsEdit? I am using and having the same issue.
  • Hi Neal - I continue to stress that the problem should be fixed on individual servers, but yes, if they refuse or can't fix it in a timely manner, then the "defaults write" trick above may help, and is available in the public release. Let me know how it goes!

  • Hi Daniel - yes, sadly refuse to upgrade their xml library.

    I am looking at a new hosting.
  • Daniel - have installed the latest and run the script - all working fine.

    Does the latest release have the secret preference and if at a later date the xml library is updated, is there a way to go back to basics?
  • Hi Neal - yeah, the latest version should continue to have the secret preference for the indefinite future. When anybody wants to back to the standard behavior, just delete the secret preference:

    defaults delete RSUseNumericXMLEntityEncodings
Sign In or Register to comment.