From ba965d17365f3b6d14f3fd652d0a0d03a491057f Mon Sep 17 00:00:00 2001 From: Francesco Occhipinti Date: Sun, 18 Mar 2018 04:39:26 +0100 Subject: RST writer: filter out empty inline containers (#4434). There is nothing in RST that corresponds to e.g. `Emph []`, so we just filter out elements like this. --- test/Tests/Writers/RST.hs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/Tests/Writers/RST.hs b/test/Tests/Writers/RST.hs index b8778f995..884281af2 100644 --- a/test/Tests/Writers/RST.hs +++ b/test/Tests/Writers/RST.hs @@ -50,14 +50,18 @@ tests = [ testGroup "rubrics" , "" , " quoted"] ] - , testGroup "spaces are stripped within inlines" - -- pandoc issue 4327 "The text within inline markup may not - -- begin or end with whitespace" - -- http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup - [ "multiple" =: + , testGroup "inlines" + [ "are removed when empty" =: -- #4434 + plain (strong (str "")) =?> "" + , "do not cause the introduction of extra spaces when removed" =: + plain (strong (str "") <> emph (str "text")) =?> "*text*" + , "spaces are stripped at beginning and end" =: + -- pandoc issue 4327 "The text within inline markup may not + -- begin or end with whitespace" + -- http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup strong (space <> str "text" <> space <> space) =?> "**text**" - , "single" =: - strong (space) =?> "****" + , "single space stripped" =: + strong (space) =?> "" ] , testGroup "headings" [ "normal heading" =: -- cgit v1.2.3