<div class="markdown">
<p>On 2 Dec 2013, at 16:31, Thomas Wölk wrote: </p>
<blockquote>
<p>On 2 Dec 2013, at 13:53, Kee Hinckley wrote: </p>
<blockquote>
<p>From the docs, it seemed as though creating </p>
<p>{<br/>
name = ‘Markdown to HTML’;<br/>
events = ( ‘email.display’ );<br/>
input = ‘canonical’;<br/>
output = ‘html’;<br/>
select = ‘(content-type.type !exists or (content-type.type = text and content-type.subtype = plain)) and content-type.markup = markdown’;<br/>
script = ‘#!/usr/bin/env bash\necho “<div markup=\\"markdown\\">”\n/usr/local/bin/multimarkdown\necho “</div>”\n’;<br/>
uuid = ‘DB65F8BE–6DE5–4BD5-AB9A–0A27599BE8C5’;<br/>
} </p>
<p>#!/bin/sh </p>
<p>tee /tmp/foo.mailmate | sed -e ‘s/2 AE883AA–33F3–4330-A544-A3B12C621468//g’ | /usr/local/bin/multimarkdown </p>
</blockquote>
<p>That’s very clever. </p>
<p>Possible to upload the script in RAW-format? </p>
<p>What is the last UUID? (AE883AA–33F3–4330-A544-A3B12C621468) is it different from the line above? Can you please explain your solution? </p>
</blockquote>
<p>I’ve attached the script. To use it (until someone can explain how I can properly use script support to do this), you would save mysundown somewhere safe (e.g. ~/bin) and do something like this: </p>
<pre><code class="bash">chmod +x ~/bin/mysundown
mv /Applications/MailMate.app/Contents/SharedSupport/bin/sundown to /Applications/MailMate.app/Contents/SharedSupport/bin/sundown.orig
ln -s ~/bin/mysundown /Applications/MailMate.app/Contents/SharedSupport/bin/sundown
</code></pre>
<p>Note that you’ll have to do the last two steps ever time MailMate updates. </p>
<p>I’ve made a couple changes since my last email. </p>
<p>MultiMarkdown treats subsequent lines with no blank between them as continuations (which is correct for the spec), but you don’t really want that for email, and many markdown processors make that an option. So the script now appends two spaces after each line to force a break. So far that’s worked everywhere except for the use of backticks to create a code block. So I’ve worked around that. There may be other things that it breaks, but so far it’s doing okay with everything I’ve thrown at it. Any more tweaks and I’ll have to switch from sed to perl or something. View this raw (or the text version) to see the original markdown. I don’t know if the sundown processor supported these or not, I wasn’t able to get tables to work in my brief experiments, but I wanted to use the same pre-processor I used elsewhere anyway. </p>
<p>Another side effect/bug with MultiMarkdown; multiple blank lines are treated like a single blank line. </p>
<h2 id="someexamples">Some Examples</h2>
<pre><code class="javascript">var i = 1;
int a = 2;
</code></pre>
<p>That was the case where a space after <code>javascript</code> screwed up the processing, by making multi markdown think it was a single line code block instead of a pre-code block.<a href="#fn:1" id="fnref:1" title="see footnote" class="footnote">[1]</a> </p>
<p>Here’s a table: </p>
<table>
<caption id="tableheader"><em>Table Header</em></caption>
<colgroup>
<col style="text-align:left;"/>
<col style="text-align:right;"/>
<col style="text-align:center;"/>
</colgroup>
<thead>
<tr>
<th style="text-align:left;">This is header1</th>
<th style="text-align:right;">This is header2</th>
<th style="text-align:center;">This is header 3</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">left</td>
<td style="text-align:right;">right</td>
<td style="text-align:center;">center</td>
</tr>
<tr>
<td style="text-align:left;" colspan="2">spanning two columns</td>
<td style="text-align:right;">some</td>
</tr>
</tbody>
</table>
<p>Some samples from the github page on markdown: </p>
<p>Inline-style:<br/>
<img src="https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png" alt="alt text" title="Logo Title Text 1" /> </p>
<p>Reference-style:<br/>
<img src="https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png" alt="alt text" id="logo" title="Logo Title Text 2" /> </p>
<p>The latest MultiMarkdown download can be found <a href="http://fletcherpenney.net/multimarkdown/download/">here</a>. </p>
<pre><code>## Some Examples
```javascript
var i = 1;
int a = 2;
```
That was the case where a space after ``javascript`` screwed up the processing, by making multi markdown think it was a single line code block instead of a pre-code block.[^footnote]
[^footnote]: At this point I'm probably giving MultiMarkdown TMI. Of course if you really want TMI, ask me about my MultiMarkdown->MediaWiki/Jira converter and the workflow I use for writing documents in Scrivener that end up in the Wiki.
Here's a table:
| This is header1 | This is header2 | This is header 3 |
| --- | ---: | :---: |
| left | right | center |
| spanning two columns || some |
[_Table Header_]
Some samples from the github page on markdown:
Inline-style:
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1")
Reference-style:
![alt text][logo]
[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2"
The latest MultiMarkdown download can be found [here](http://fletcherpenney.net/multimarkdown/download/).
</code></pre>
<div class="footnotes">
<hr />
<ol>
<li id="fn:1">
<p>At this point I’m probably giving MultiMarkdown TMI. Of course if you really want TMI, ask me about my MultiMarkdown->MediaWiki/Jira converter and the workflow I use for writing documents in Scrivener that end up in the Wiki. <a href="#fnref:1" title="return to article" class="reversefootnote"> ↩</a></p>
</li>
</ol>
</div>
</div>