Dashes and quotes being escaped when compiling

I use Scrivener with Multimarkdown to write HTML for the web (which is brilliant) but have hit a minor problem with symbols like dashes and quotes being escaped when output. This is not a big deal as they render fine in HTML but sometimes I need the output in plain text (rather than HTML) for a few email newsletter subscribers.

For example a dash (-) is converted into ampersand hash 8211 semi-colon.

If I escape the dash in Scrivener; e.g. - then it outputs as - but this is impractical for general editing.

I don’t know whether this is a setting in Scrivener I have got wrong or something in Markdown. I’ve tried turning off various formatting options like smart quotes but it makes no difference.

Any help would be appreciated.

regards… Steve
Scrivener 2.2 (Mac OS X 10.6)

That’s a function of the MMD system itself, it’s all post-Scrivener. It has a typography post-processing system which converts inch/foot marks and the various dashes to en/em-dashes and encodes them so that you needn’t use an editor that handles them, or manually type them in.

If you need plain-text output though, why not just use the MultiMarkdown plain compile format? Are you wanting to get rid of the syntax as well? In that case let me know what MMD version you have installed (or not, if you are using the built-in copy in Scrivener).

Thanks for explaining that, thought it was me! I’m using MMD version 3 point something, not sure how to check exactly which version it is. I downloaded it some time ago when I first installed Scrivener and placed it in the Library/Application Support/MultiMarkDown directory.

After I’d made the post I actually thought a bit more about my workflow. The escape characters are only an issue when creating an email newsletter. I use Vertical Response and they have a means of converting the HTML version into the text version automatically and I’ve always used that. After the conversion, I then tidy up the text as it always needs a bit of manipulation as well as removing the escape codes.

As you suggest it would actually make more sense to compile the text version as plain text straight out of Scrivener. I’ll give that a go when I produce the next newsletter and see how it looks.

I guess if I was feeling adventurous I could always modify the relevant MMD file so it doesn’t do the escaping in the first place.

I assume having the escape codes in the HTML is not a problem for Web Content Accessibility Guidelines.


No, in fact using escape codes is the preferred method for accessibility and maximum web compatibility. Using raw Unicode is something that is now technically possible, but not all browsers work with it.

Okay, MMD3, there are no support files you need to edit, it’s just an option of the basic program. You need to use the –nosmart switch on the multimarkdown command. You could modify the mmd2XHTML.pl shell script in the Application support folder to look like:

if [ $# = 0 ] then multimarkdown --nosmart else until [ "$*" = "" ] do multimarkdown --nosmart -b "$1" shift done fi

But, that would then make it so it would always leave your inch/foot marks alone, even for the Web, which you probably don’t want.

So the other alternative is to just compile to a plain MMD file from Scrivener, and then use the Terminal to convert it. I recommend this variation:

multimarkdown --nosmart compiled_filename.txt -o html_filename.html

Running that will create a file called “html_filename.html” in the same folder.

By the way, thanks for that. :slight_smile: I’m one of those that gets the text part exclusively, and I hate it when a company can’t be bothered to fix up their text part, and are obviously only including it to get around spam filters. Last place I worked at, I always hand-crafted the text-part as well as the HTML. Markdown makes a pretty good look for plain-text, that is after all one of its primary points: to be readable as well as functional. Links are the only thing I stray away from when communicating with non-MMD users. I prefer the:


…format (which does work in MMD).

Thanks again, it certainly helps to bounce ideas of someone else.

Most of my output is straight for the web anyway and the combination of Scrivener and MMD is an absolute godsend. I cannot imagine going back to using other writing tools now.

I’m going to leave the escape codes in the HTML version and look at ways of automating some of the conversion work on the text version of the newsletter.

I’ve used Automator in the past for some repetitive jobs and I think I’ll investigate editors like Tex-Edit that support Automator to do find/replace type commands. That way I should be able to tidy up the newsletter file in a consistent manner with little effort.