Note that there are some explanatory texts on larger screens.

plurals
  1. POConvert Evernote Markup Language (ENML) to Markdown with pandoc
    primarykey
    data
    text
    <p>I'm trying to convert <a href="http://dev.evernote.com/doc/articles/enml.php" rel="nofollow">Evernote Markup Language</a> (ENML) to Markdown using Pandoc. ENML is mostly a subset of XHTML with a few additional elements. The element I'm trying to convert is a special <code>&lt;en-todo checked="true"/&gt;</code>. Here's a sample ENML document with two <code>en-todo</code> items:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt; &lt;!DOCTYPE en-note SYSTEM "xml/enml2.dtd"&gt; &lt;en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"&gt; &lt;div&gt;&lt;en-todo checked="true"/&gt;This is a thing&lt;br/&gt;&lt;/div&gt; &lt;div&gt;&lt;en-todo checked="false"/&gt;This is another thing&lt;br/&gt;&lt;/div&gt; &lt;/en-note&gt; </code></pre> <p>I'm trying to convert it to the following markdown:</p> <pre><code>[X] This is a thing [ ] This is another thing </code></pre> <p>My current approach is to create a JSON filter</p> <pre><code>pandoc --parse-raw -f html -t json test.enml | \ ./my-filter | pandoc -f json -t markdown </code></pre> <p>I'm not sure how to properly parse the <code>RawInline</code> blocks:</p> <pre><code>[ { "Para": [ { "RawInline": [ "html", "&lt;en-todo checked=\"true\"&gt;" ] }, { "RawInline": [ "html", "&lt;/en-todo&gt;" ] }, { "Str": "This" }, "Space", { "Str": "is" }, "Space", { "Str": "a" }, "Space", { "Str": "thing" }, "LineBreak" ] }, { "RawBlock": [ "html", "&lt;/div&gt;" ] }, { "RawBlock": [ "html", "&lt;div&gt;" ] }, { "Para": [ { "RawInline": [ "html", "&lt;en-todo checked=\"false\"&gt;" ] }, { "RawInline": [ "html", "&lt;/en-todo&gt;" ] }, { "Str": "This" }, "Space", { "Str": "is" }, "Space", { "Str": "another" }, "Space", { "Str": "thing" }, "LineBreak" ] } ] </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload