Published by marco on
The earthli blogging format uses HTML-like formatting, described in the lengthy manual (with examples). However, Encodo’s blogging back-end now uses Umbraco, with Markdown for content. I used to be able to cross-post with ease, by copy/pasting. Now, I need to convert the content from Markdown to earthli formatting.
The following steps suffice to convert any article:
### ([^\n]+)$
=> <h level=“3”>\1</h>
## ([^\n]+)$
=> <h>\1</h>
\[([^!][^\]]+)\]\(([^\)]+)\)
=> <a href=“\2”>\1</a>
\*\*([^\*]+)\*\*
=> <b>\1</b>
_([^_]+)_
=> <i>\1</i>
```txt\n([^`]+)\n```
=> <pre>\1</pre>
```[a-z]+\n([^`]+)\n```
=> <code>\1</code>
`([^`]+)`
=> <c>\1</c>
I haven’t automated this process yet because I only rarely transfer articles.