git.iko.soy/typeable/pandoc
on master help sign in
+ Replaced 'comparing' combinator in markdown reader with 'compare'.

'comparing' is from Data.Ord, which is not available in GHC 6.4. + Added line break after </li> in HTML footnote output, for easier inspection of the source. git-svn-id: https://pandoc.googlecode.com/svn/trunk@245 788f1e2b-df1e-0410-8736-df70ead52e1b

commitc1ebe94e40a66a092c2cd501eda1edb5ec216938 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateTue 19 Dec 2006, 23:46 (20 years ago) parent34bb7a1
4 files changed+14−9
src/Text/Pandoc/Readers/Markdown.hs+1−2 src/Text/Pandoc/Writers/HTML.hs+1−1 tests/writer.html+6−3 tests/writer.smart.html+6−3
src/Text/Pandoc/Readers/Markdown.hs+1−2
@@ -4,7 +4,6 @@ module Text.Pandoc.Readers.Markdown (
44 ) where
55
66import Data.List ( findIndex, sortBy )
7−import Data.Ord ( comparing )
87import Text.ParserCombinators.Pandoc
98import Text.Pandoc.Definition
109import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXEnvironment )
@@ -123,7 +122,7 @@ parseMarkdown = do
123122 state <- getState
124123 let keys = reverse $ stateKeyBlocks state
125124 let notes = reverse $ stateNoteBlocks state
126− let sortedNotes = sortBy (comparing numberOfNote) notes
125+ let sortedNotes = sortBy (\x y -> compare (numberOfNote x) (numberOfNote y)) notes
127126 return (Pandoc (Meta title author date) (blocks' ++ sortedNotes ++ keys))
128127
129128--
src/Text/Pandoc/Writers/HTML.hs+1−1
@@ -142,7 +142,7 @@ blockToHtml options (Note ref lst) =
142142 let contents = (concatMap (blockToHtml options) lst) in
143143 "<li id=\"fn" ++ ref ++ "\">" ++ contents ++ " <a href=\"#fnref" ++ ref ++
144144 "\" class=\"footnoteBacklink\" title=\"Jump back to footnote " ++ ref ++
145− "\">&#8617;</a></li>"
145+ "\">&#8617;</a></li>\n"
146146blockToHtml options (Key _ _) = ""
147147blockToHtml options (CodeBlock str) = "<pre><code>" ++ (codeStringToHtml str) ++
148148 "\n</code></pre>\n"
tests/writer.html+6−3
@@ -439,13 +439,16 @@ Cat &amp; 1 \\ \hline
439439<hr />
440440<ol>
441441<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>
443444<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
444445<pre><code> { &lt;code> }
445446</code></pre>
446447<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− <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>
448− <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li></ol>
448+ <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li>
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>
450+ <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li>
451+</ol>
449452</div>
450453</body>
451454</html>
tests/writer.smart.html+6−3
@@ -439,13 +439,16 @@ Cat &amp; 1 \\ \hline
439439<hr />
440440<ol>
441441<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>
443444<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
444445<pre><code> { &lt;code> }
445446</code></pre>
446447<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− <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>
448− <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li></ol>
448+ <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li>
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>
450+ <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li>
451+</ol>
449452</div>
450453</body>
451454</html>