git.iko.soy/typeable/pandoc
on master help sign in
+ Replaced 'comparing' combinator in markdown reader with 'compare'.
c1ebe94fiddlosopher
src/Text/Pandoc/Readers/Markdown.hs+1−2
@@ -4,7 +4,6 @@ module Text.Pandoc.Readers.Markdown (
4 ) where
4 ) where
5
5
6import Data.List ( findIndex, sortBy )
6import Data.List ( findIndex, sortBy )
7−import Data.Ord ( comparing )
8import Text.ParserCombinators.Pandoc
7import Text.ParserCombinators.Pandoc
9import Text.Pandoc.Definition
8import Text.Pandoc.Definition
10import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXEnvironment )
9import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXEnvironment )
@@ -123,7 +122,7 @@ parseMarkdown = do
123 state <- getState
122 state <- getState
124 let keys = reverse $ stateKeyBlocks state
123 let keys = reverse $ stateKeyBlocks state
125 let notes = reverse $ stateNoteBlocks state
124 let notes = reverse $ stateNoteBlocks state
126− let sortedNotes = sortBy (comparing numberOfNote) notes
125+ let sortedNotes = sortBy (\x y -> compare (numberOfNote x) (numberOfNote y)) notes
127 return (Pandoc (Meta title author date) (blocks' ++ sortedNotes ++ keys))
126 return (Pandoc (Meta title author date) (blocks' ++ sortedNotes ++ keys))
128
127
129--
128--
src/Text/Pandoc/Writers/HTML.hs+1−1
@@ -142,7 +142,7 @@ blockToHtml options (Note ref lst) =
142 let contents = (concatMap (blockToHtml options) lst) in
142 let contents = (concatMap (blockToHtml options) lst) in
143 "<li id=\"fn" ++ ref ++ "\">" ++ contents ++ " <a href=\"#fnref" ++ ref ++
143 "<li id=\"fn" ++ ref ++ "\">" ++ contents ++ " <a href=\"#fnref" ++ ref ++
144 "\" class=\"footnoteBacklink\" title=\"Jump back to footnote " ++ ref ++
144 "\" class=\"footnoteBacklink\" title=\"Jump back to footnote " ++ ref ++
145− "\">&#8617;</a></li>"
145+ "\">&#8617;</a></li>\n"
146blockToHtml options (Key _ _) = ""
146blockToHtml options (Key _ _) = ""
147blockToHtml options (CodeBlock str) = "<pre><code>" ++ (codeStringToHtml str) ++
147blockToHtml options (CodeBlock str) = "<pre><code>" ++ (codeStringToHtml str) ++
148 "\n</code></pre>\n"
148 "\n</code></pre>\n"
tests/writer.html+6−3
@@ -439,13 +439,16 @@ Cat &amp; 1 \\ \hline
439<hr />
439<hr />
440<ol>
440<ol>
441<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.</p>
441<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.</p>
442− <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">&#8617;</a></li><li id="fn2"><p>Here's the long note. This one contains multiple blocks.</p>
442+ <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">&#8617;</a></li>
443+<li id="fn2"><p>Here's the long note. This one contains multiple blocks.</p>
443<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
444<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
444<pre><code> { &lt;code> }
445<pre><code> { &lt;code> }
445</code></pre>
446</code></pre>
446<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</p>
447<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</p>
448+ <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li>
447− <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li><li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters.</p>
449+<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters.</p>
448− <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li></ol>
450+ <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li>
451+</ol>
449</div>
452</div>
450</body>
453</body>
451</html>
454</html>
tests/writer.smart.html+6−3
@@ -439,13 +439,16 @@ Cat &amp; 1 \\ \hline
439<hr />
439<hr />
440<ol>
440<ol>
441<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.</p>
441<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.</p>
442− <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">&#8617;</a></li><li id="fn2"><p>Here&rsquo;s the long note. This one contains multiple blocks.</p>
442+ <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">&#8617;</a></li>
443+<li id="fn2"><p>Here&rsquo;s the long note. This one contains multiple blocks.</p>
443<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
444<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
444<pre><code> { &lt;code> }
445<pre><code> { &lt;code> }
445</code></pre>
446</code></pre>
446<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</p>
447<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</p>
448+ <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li>
447− <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li><li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters.</p>
449+<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters.</p>
448− <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li></ol>
450+ <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li>
451+</ol>
449</div>
452</div>
450</body>
453</body>
451</html>
454</html>