diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 3 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 2 | ||||
-rw-r--r-- | tests/writer.html | 9 | ||||
-rw-r--r-- | tests/writer.smart.html | 9 |
4 files changed, 14 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 499c2ecea..034e5d8e4 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -4,7 +4,6 @@ module Text.Pandoc.Readers.Markdown ( ) where import Data.List ( findIndex, sortBy ) -import Data.Ord ( comparing ) import Text.ParserCombinators.Pandoc import Text.Pandoc.Definition import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXEnvironment ) @@ -123,7 +122,7 @@ parseMarkdown = do state <- getState let keys = reverse $ stateKeyBlocks state let notes = reverse $ stateNoteBlocks state - let sortedNotes = sortBy (comparing numberOfNote) notes + let sortedNotes = sortBy (\x y -> compare (numberOfNote x) (numberOfNote y)) notes return (Pandoc (Meta title author date) (blocks' ++ sortedNotes ++ keys)) -- diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index dadd45e39..f1bd0f8b5 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -142,7 +142,7 @@ blockToHtml options (Note ref lst) = let contents = (concatMap (blockToHtml options) lst) in "<li id=\"fn" ++ ref ++ "\">" ++ contents ++ " <a href=\"#fnref" ++ ref ++ "\" class=\"footnoteBacklink\" title=\"Jump back to footnote " ++ ref ++ - "\">↩</a></li>" + "\">↩</a></li>\n" blockToHtml options (Key _ _) = "" blockToHtml options (CodeBlock str) = "<pre><code>" ++ (codeStringToHtml str) ++ "\n</code></pre>\n" diff --git a/tests/writer.html b/tests/writer.html index e8d7c228f..6fcb949ec 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -439,13 +439,16 @@ Cat & 1 \\ \hline <hr /> <ol> <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> - <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">↩</a></li><li id="fn2"><p>Here's the long note. This one contains multiple blocks.</p> + <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">↩</a></li> +<li id="fn2"><p>Here's the long note. This one contains multiple blocks.</p> <p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p> <pre><code> { <code> } </code></pre> <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> - <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">↩</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> - <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">↩</a></li></ol> + <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">↩</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> + <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">↩</a></li> +</ol> </div> </body> </html> diff --git a/tests/writer.smart.html b/tests/writer.smart.html index b63e78968..508b0abf5 100644 --- a/tests/writer.smart.html +++ b/tests/writer.smart.html @@ -439,13 +439,16 @@ Cat & 1 \\ \hline <hr /> <ol> <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> - <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">↩</a></li><li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p> + <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">↩</a></li> +<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p> <p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p> <pre><code> { <code> } </code></pre> <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> - <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">↩</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> - <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">↩</a></li></ol> + <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">↩</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> + <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">↩</a></li> +</ol> </div> </body> </html> |