git.iko.soy/typeable/pandoc
on master help sign in
MediaWiki writer: Remove newline before `</ref>`.

Closes #2652.

commitf90b82d3d9e53ff005911252d1a9242bba0d5272 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 21 Feb 2017, 23:03 (10 years ago) parente462f80
2 files changed+5−9
src/Text/Pandoc/Writers/MediaWiki.hs+2−2 test/writer.mediawiki+3−7
src/Text/Pandoc/Writers/MediaWiki.hs+2−2
@@ -434,8 +434,8 @@ inlineToMediaWiki (Image attr alt (source, tit)) = do
434434inlineToMediaWiki (Note contents) = do
435435 contents' <- blockListToMediaWiki contents
436436 modify (\s -> s { stNotes = True })
437− return $ "<ref>" ++ contents' ++ "</ref>"
438− -- note - may not work for notes with multiple blocks
437+ return $ "<ref>" ++ stripTrailingNewlines contents' ++ "</ref>"
438+ -- note - does not work for notes with multiple blocks
439439
440440highlightingLangs :: Set.Set String
441441highlightingLangs = Set.fromList [
test/writer.mediawiki+3−7
@@ -633,18 +633,14 @@ Here is a movie [[File:movie.jpg|movie]] icon.
633633
634634= Footnotes =
635635
636−Here is a footnote reference,<ref>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
637−</ref> and another.<ref>Here’s the long note. This one contains multiple blocks.
636+Here is a footnote reference,<ref>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.</ref> and another.<ref>Here’s the long note. This one contains multiple blocks.
638637
639638Subsequent blocks are indented to show that they belong to the footnote (as with list items).
640639
641640<pre> { &lt;code&gt; }</pre>
642−If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
643−</ref> This should ''not'' be a footnote reference, because it contains a space.[^my note] Here is an inline note.<ref>This is ''easier'' to type. Inline notes may contain [http://google.com links] and <code>]</code> verbatim characters, as well as [bracketed text].
644−</ref>
641+If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</ref> This should ''not'' be a footnote reference, because it contains a space.[^my note] Here is an inline note.<ref>This is ''easier'' to type. Inline notes may contain [http://google.com links] and <code>]</code> verbatim characters, as well as [bracketed text].</ref>
645642
646−<blockquote>Notes can go in quotes.<ref>In quote.
647−</ref>
643+<blockquote>Notes can go in quotes.<ref>In quote.</ref>
648644</blockquote>
649645# And in list items.<ref>In list.</ref>
650646