From daeb1aa685fa4cc3ad6d7e0b0e41943573bef5d9 Mon Sep 17 00:00:00 2001
From: Alina Banerjee <alinab@users.noreply.github.com>
Date: Thu, 1 Aug 2019 16:01:39 -0500
Subject: [PATCH] Update parsing to strip whitespace from table cells (#1074)

* Update parsing to strip leading & trailing whitespace from table cells

* Update fixture data to disallow whitespaces at both ends in table cells

* Add test case for whitespaces stripped from both ends of table cells

* Update table reference test data for html tests
---
 .../table-cell-strip-whitespaces.input        |  5 +
 .../table-cell-strip-whitespaces.parsed       | 29 ++++++
 .../fixtures/examples/table-simple.parsed     | 28 ++----
 .../fixtures/examples/table1.parsed           | 45 ++++-----
 .../fixtures/examples/table2.parsed           | 20 ++--
 .../fixtures/examples/table3.parsed           | 22 ++---
 .../fixtures/examples/table4.parsed           | 10 +-
 .../fixtures/examples/table5.parsed           | 27 ++----
 .../src/Documentation/Haddock/Parser.hs       | 18 ++--
 html-test/ref/Table.html                      | 96 +++++++++----------
 10 files changed, 152 insertions(+), 148 deletions(-)
 create mode 100644 haddock-library/fixtures/examples/table-cell-strip-whitespaces.input
 create mode 100644 haddock-library/fixtures/examples/table-cell-strip-whitespaces.parsed

diff --git a/haddock-library/fixtures/examples/table-cell-strip-whitespaces.input b/haddock-library/fixtures/examples/table-cell-strip-whitespaces.input
new file mode 100644
index 0000000000..f5e3756dcd
--- /dev/null
+++ b/haddock-library/fixtures/examples/table-cell-strip-whitespaces.input
@@ -0,0 +1,5 @@
++------+--------------+-------------------------------------------------+
+| C1   |     C2       |         C3                                      |
++======+==============+=================================================+
+| row  | 'test'       | 'test table cell with  .. whitepspace '         |
++------+--------------+-------------------------------------------------+
diff --git a/haddock-library/fixtures/examples/table-cell-strip-whitespaces.parsed b/haddock-library/fixtures/examples/table-cell-strip-whitespaces.parsed
new file mode 100644
index 0000000000..190023697d
--- /dev/null
+++ b/haddock-library/fixtures/examples/table-cell-strip-whitespaces.parsed
@@ -0,0 +1,29 @@
+DocTable
+  Table
+    {tableBodyRows = [TableRow
+                        [TableCell
+                           {tableCellColspan = 1,
+                            tableCellContents = DocString "row",
+                            tableCellRowspan = 1},
+                         TableCell
+                           {tableCellColspan = 1,
+                            tableCellContents = DocIdentifier "test",
+                            tableCellRowspan = 1},
+                         TableCell
+                           {tableCellColspan = 1,
+                            tableCellContents = DocString
+                                                  "'test table cell with  .. whitepspace '",
+                            tableCellRowspan = 1}]],
+     tableHeaderRows = [TableRow
+                          [TableCell
+                             {tableCellColspan = 1,
+                              tableCellContents = DocString "C1",
+                              tableCellRowspan = 1},
+                           TableCell
+                             {tableCellColspan = 1,
+                              tableCellContents = DocString "C2",
+                              tableCellRowspan = 1},
+                           TableCell
+                             {tableCellColspan = 1,
+                              tableCellContents = DocString "C3",
+                              tableCellRowspan = 1}]]}
diff --git a/haddock-library/fixtures/examples/table-simple.parsed b/haddock-library/fixtures/examples/table-simple.parsed
index b5e624539a..d027c75d6e 100644
--- a/haddock-library/fixtures/examples/table-simple.parsed
+++ b/haddock-library/fixtures/examples/table-simple.parsed
@@ -3,50 +3,40 @@ DocTable
     {tableBodyRows = [TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " 200  ",
+                            tableCellContents = DocString "200",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocAppend
-                                                  (DocString "   ")
-                                                  (DocAppend
-                                                     (DocMonospaced (DocString "OK"))
-                                                     (DocString "       ")),
+                            tableCellContents = DocMonospaced (DocString "OK"),
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString
-                                                  " operation successful                     ",
+                            tableCellContents = DocString "operation successful",
                             tableCellRowspan = 1}],
                       TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " 204  ",
+                            tableCellContents = DocString "204",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocAppend
-                                                  (DocString " ")
-                                                  (DocAppend
-                                                     (DocMonospaced (DocString "No Content"))
-                                                     (DocString " ")),
+                            tableCellContents = DocMonospaced (DocString "No Content"),
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
                             tableCellContents = DocString
-                                                  " operation successful, no body returned   ",
+                                                  "operation successful, no body returned",
                             tableCellRowspan = 1}]],
      tableHeaderRows = [TableRow
                           [TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString " code ",
+                              tableCellContents = DocString "code",
                               tableCellRowspan = 1},
                            TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString " message      ",
+                              tableCellContents = DocString "message",
                               tableCellRowspan = 1},
                            TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString
-                                                    " description                              ",
+                              tableCellContents = DocString "description",
                               tableCellRowspan = 1}]]}
diff --git a/haddock-library/fixtures/examples/table1.parsed b/haddock-library/fixtures/examples/table1.parsed
index 2fa58fd8a7..8b8908f4cf 100644
--- a/haddock-library/fixtures/examples/table1.parsed
+++ b/haddock-library/fixtures/examples/table1.parsed
@@ -3,79 +3,66 @@ DocTable
     {tableBodyRows = [TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " body row 1, column 1   ",
+                            tableCellContents = DocString "body row 1, column 1",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " column 2   ",
+                            tableCellContents = DocString "column 2",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " column 3 ",
+                            tableCellContents = DocString "column 3",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " column 4 ",
+                            tableCellContents = DocString "column 4",
                             tableCellRowspan = 1}],
                       TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " body row 2             ",
+                            tableCellContents = DocString "body row 2",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 3,
-                            tableCellContents = DocString " Cells may span columns.          ",
+                            tableCellContents = DocString "Cells may span columns.",
                             tableCellRowspan = 1}],
                       TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " body row 3             ",
+                            tableCellContents = DocString "body row 3",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
                             tableCellContents = DocString
-                                                  (concat
-                                                     [" Cells may  \n",
-                                                      " span rows. \n",
-                                                      "            "]),
+                                                  (concat ["Cells may\n", "span rows.\n"]),
                             tableCellRowspan = 2},
                          TableCell
                            {tableCellColspan = 2,
-                            tableCellContents = DocAppend
-                                                  (DocString " ")
-                                                  (DocAppend
-                                                     (DocMathDisplay
-                                                        (concat
-                                                           ["                  \n",
-                                                            " f(n) = \\sum_{i=1}   \n",
-                                                            " "]))
-                                                     (DocString "                  ")),
+                            tableCellContents = DocMathDisplay
+                                                  (concat ["\n", "f(n) = \\sum_{i=1}\n"]),
                             tableCellRowspan = 2}],
                       TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " body row 4             ",
+                            tableCellContents = DocString "body row 4",
                             tableCellRowspan = 1}]],
      tableHeaderRows = [TableRow
                           [TableCell
                              {tableCellColspan = 1,
                               tableCellContents = DocString
                                                     (concat
-                                                       [" Header row, column 1   \n",
-                                                        " (header rows optional) "]),
+                                                       ["Header row, column 1\n",
+                                                        "(header rows optional)"]),
                               tableCellRowspan = 1},
                            TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString
-                                                    (concat [" Header 2   \n", "            "]),
+                              tableCellContents = DocString "Header 2\n",
                               tableCellRowspan = 1},
                            TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString
-                                                    (concat [" Header 3 \n", "          "]),
+                              tableCellContents = DocString "Header 3\n",
                               tableCellRowspan = 1},
                            TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString
-                                                    (concat [" Header 4 \n", "          "]),
+                              tableCellContents = DocString "Header 4\n",
                               tableCellRowspan = 1}]]}
diff --git a/haddock-library/fixtures/examples/table2.parsed b/haddock-library/fixtures/examples/table2.parsed
index e3dbf0b4f7..44cc813b6d 100644
--- a/haddock-library/fixtures/examples/table2.parsed
+++ b/haddock-library/fixtures/examples/table2.parsed
@@ -3,44 +3,44 @@ DocTable
     {tableBodyRows = [TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " row 1, col 1 ",
+                            tableCellContents = DocString "row 1, col 1",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " column 2 ",
+                            tableCellContents = DocString "column 2",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " column 3  ",
+                            tableCellContents = DocString "column 3",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " column 4  ",
+                            tableCellContents = DocString "column 4",
                             tableCellRowspan = 1}],
                       TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " row 2        ",
+                            tableCellContents = DocString "row 2",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 3,
-                            tableCellContents = DocString "                                  ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1}],
                       TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " row 3        ",
+                            tableCellContents = DocString "row 3",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString "          ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString "           ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString "           ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1}]],
      tableHeaderRows = []}
diff --git a/haddock-library/fixtures/examples/table3.parsed b/haddock-library/fixtures/examples/table3.parsed
index cabff9cbfd..c978b50f76 100644
--- a/haddock-library/fixtures/examples/table3.parsed
+++ b/haddock-library/fixtures/examples/table3.parsed
@@ -3,48 +3,48 @@ DocTable
     {tableBodyRows = [TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " row 1, col 1 ",
+                            tableCellContents = DocString "row 1, col 1",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " column 2 ",
+                            tableCellContents = DocString "column 2",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " column 3  ",
+                            tableCellContents = DocString "column 3",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " column 4  ",
+                            tableCellContents = DocString "column 4",
                             tableCellRowspan = 1}],
                       TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " row 2        ",
+                            tableCellContents = DocString "row 2",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 2,
-                            tableCellContents = DocString " Use the command ``ls ",
+                            tableCellContents = DocString "Use the command ``ls",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " more``.   ",
+                            tableCellContents = DocString "more``.",
                             tableCellRowspan = 1}],
                       TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString " row 3        ",
+                            tableCellContents = DocString "row 3",
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString "          ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString "           ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString "           ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1}]],
      tableHeaderRows = []}
diff --git a/haddock-library/fixtures/examples/table4.parsed b/haddock-library/fixtures/examples/table4.parsed
index cfdd6f0f26..c4dabb0d6c 100644
--- a/haddock-library/fixtures/examples/table4.parsed
+++ b/haddock-library/fixtures/examples/table4.parsed
@@ -8,10 +8,10 @@ DocAppend
                                  {tableCellColspan = 1,
                                   tableCellContents = DocString
                                                         (concat
-                                                           ["   outer     \n",
-                                                            "             \n",
-                                                            "-------+     \n",
-                                                            " inner |     "]),
+                                                           ["outer\n",
+                                                            "\n",
+                                                            "-------+\n",
+                                                            "inner |"]),
                                   tableCellRowspan = 1}]],
            tableHeaderRows = []})
      (DocAppend
@@ -21,6 +21,6 @@ DocAppend
              {tableBodyRows = [TableRow
                                  [TableCell
                                     {tableCellColspan = 1,
-                                     tableCellContents = DocString " inner ",
+                                     tableCellContents = DocString "inner",
                                      tableCellRowspan = 1}]],
               tableHeaderRows = []})))
diff --git a/haddock-library/fixtures/examples/table5.parsed b/haddock-library/fixtures/examples/table5.parsed
index 9a547ad390..f9a387bb0c 100644
--- a/haddock-library/fixtures/examples/table5.parsed
+++ b/haddock-library/fixtures/examples/table5.parsed
@@ -4,50 +4,43 @@ DocTable
                         [TableCell
                            {tableCellColspan = 1,
                             tableCellContents = DocString
-                                                  (concat
-                                                     [" row 2        \n",
-                                                      "              \n",
-                                                      "              \n",
-                                                      " row 3        "]),
+                                                  (concat ["row 2\n", "\n", "\n", "row 3"]),
                             tableCellRowspan = 2},
                          TableCell
                            {tableCellColspan = 3,
                             tableCellContents = DocAppend
-                                                  (DocString " Use the command  ")
+                                                  (DocString "Use the command  ")
                                                   (DocAppend
                                                      (DocMonospaced (DocString "ls | more"))
-                                                     (DocString
-                                                        (concat
-                                                           [".    \n",
-                                                            "                                  "]))),
+                                                     (DocString ".\n")),
                             tableCellRowspan = 1}],
                       TableRow
                         [TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString "          ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString "           ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1},
                          TableCell
                            {tableCellColspan = 1,
-                            tableCellContents = DocString "           ",
+                            tableCellContents = DocEmpty,
                             tableCellRowspan = 1}]],
      tableHeaderRows = [TableRow
                           [TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString " row 1, col 1 ",
+                              tableCellContents = DocString "row 1, col 1",
                               tableCellRowspan = 1},
                            TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString " column 2 ",
+                              tableCellContents = DocString "column 2",
                               tableCellRowspan = 1},
                            TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString " column 3  ",
+                              tableCellContents = DocString "column 3",
                               tableCellRowspan = 1},
                            TableCell
                              {tableCellColspan = 1,
-                              tableCellContents = DocString " column 4  ",
+                              tableCellContents = DocString "column 4",
                               tableCellRowspan = 1}]]}
diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs
index d79da40ba2..b9f7024594 100644
--- a/haddock-library/src/Documentation/Haddock/Parser.hs
+++ b/haddock-library/src/Documentation/Haddock/Parser.hs
@@ -293,7 +293,7 @@ picture = DocPic . makeLabeled Picture
 -- >>> parseString "\\(\\int_{-\\infty}^{\\infty} e^{-x^2/2} = \\sqrt{2\\pi}\\)"
 -- DocMathInline "\\int_{-\\infty}^{\\infty} e^{-x^2/2} = \\sqrt{2\\pi}"
 mathInline :: Parser (DocH mod a)
-mathInline = DocMathInline . T.unpack 
+mathInline = DocMathInline . T.unpack
              <$> disallowNewline  ("\\(" *> takeUntil "\\)")
 
 -- | Display math parser, surrounded by \\[ and \\].
@@ -301,7 +301,7 @@ mathInline = DocMathInline . T.unpack
 -- >>> parseString "\\[\\int_{-\\infty}^{\\infty} e^{-x^2/2} = \\sqrt{2\\pi}\\]"
 -- DocMathDisplay "\\int_{-\\infty}^{\\infty} e^{-x^2/2} = \\sqrt{2\\pi}"
 mathDisplay :: Parser (DocH mod a)
-mathDisplay = DocMathDisplay . T.unpack 
+mathDisplay = DocMathDisplay . T.unpack
               <$> ("\\[" *> takeUntil "\\]")
 
 markdownImage :: Parser (DocH mod a)
@@ -509,7 +509,7 @@ tableStepFour rs hdrIndex cells =  case hdrIndex of
     -- extract cell contents given boundaries
     extract :: Int -> Int -> Int -> Int -> Text
     extract x y x2 y2 = T.intercalate "\n"
-        [ T.take (x2 - x + 1) $ T.drop x $ rs !! y'
+        [ T.stripEnd $ T.stripStart $ T.take (x2 - x + 1) $ T.drop x $ rs !! y'
         | y' <- [y .. y2]
         ]
 
@@ -596,7 +596,7 @@ definitionList indent = DocDefList <$> p
         Right i -> (label, contents) : i
 
 -- | Drops all trailing newlines.
-dropNLs :: Text -> Text 
+dropNLs :: Text -> Text
 dropNLs = T.dropWhileEnd (== '\n')
 
 -- | Main worker for 'innerList' and 'definitionList'.
@@ -670,7 +670,7 @@ takeNonEmptyLine = do
 --
 -- More precisely: skips all whitespace-only lines and returns indentation
 -- (horizontal space, might be empty) of that non-empty line.
-takeIndent :: Parser Text 
+takeIndent :: Parser Text
 takeIndent = do
   indent <- takeHorizontalSpace
   choice' [ "\n" *> takeIndent
@@ -728,14 +728,14 @@ examples = DocExamples <$> (many (try (skipHorizontalSpace *> "\n")) *> go)
         substituteBlankLine "<BLANKLINE>" = ""
         substituteBlankLine xs = xs
 
-nonEmptyLine :: Parser Text 
+nonEmptyLine :: Parser Text
 nonEmptyLine = try (mfilter (T.any (not . isSpace)) takeLine)
 
 takeLine :: Parser Text
 takeLine = try (takeWhile (Parsec.noneOf "\n") <* endOfLine)
 
 endOfLine :: Parser ()
-endOfLine = void "\n" <|> Parsec.eof 
+endOfLine = void "\n" <|> Parsec.eof
 
 -- | Property parser.
 --
@@ -787,7 +787,7 @@ hyperlink = choice' [ angleBracketLink, markdownLink, autoUrl ]
 
 angleBracketLink :: Parser (DocH mod a)
 angleBracketLink =
-    DocHyperlink . makeLabeled Hyperlink 
+    DocHyperlink . makeLabeled Hyperlink
     <$> disallowNewline ("<" *> takeUntil ">")
 
 markdownLink :: Parser (DocH mod a)
@@ -817,7 +817,7 @@ autoUrl :: Parser (DocH mod a)
 autoUrl = mkLink <$> url
   where
     url = mappend <$> choice' [ "http://", "https://", "ftp://"] <*> takeWhile1 (Parsec.satisfy (not . isSpace))
-    
+
     mkLink :: Text -> DocH mod a
     mkLink s = case T.unsnoc s of
       Just (xs,x) | x `elem` (",.!?" :: String) -> DocHyperlink (mkHyperlink xs) `docAppend` DocString [x]
diff --git a/html-test/ref/Table.html b/html-test/ref/Table.html
index 6897e8b283..cf89b99254 100644
--- a/html-test/ref/Table.html
+++ b/html-test/ref/Table.html
@@ -87,33 +87,33 @@
 	    ><thead
 	      ><tr
 		><th
-		  > code </th
+		  >code</th
 		  ><th
-		  > message      </th
+		  >message</th
 		  ><th
-		  > description                              </th
+		  >description</th
 		  ></tr
 		></thead
 	      ><tbody
 	      ><tr
 		><td
-		  > 200  </td
+		  >200</td
 		  ><td
-		  >   <code
+		  ><code
 		    >OK</code
-		    >       </td
+		    ></td
 		  ><td
-		  > operation successful                     </td
+		  >operation successful</td
 		  ></tr
 		><tr
 		><td
-		  > 204  </td
+		  >204</td
 		  ><td
-		  > <code
+		  ><code
 		    >No Content</code
-		    > </td
+		    ></td
 		  ><td
-		  > operation successful, no body returned   </td
+		  >operation successful, no body returned</td
 		  ></tr
 		></tbody
 	      ></table
@@ -133,33 +133,33 @@
 	    ><tbody
 	      ><tr
 		><td
-		  > 200  </td
+		  >200</td
 		  ><td
-		  >   <code
+		  ><code
 		    >OK</code
-		    >       </td
+		    ></td
 		  ><td
-		  > operation successful                     </td
+		  >operation successful</td
 		  ></tr
 		><tr
 		><td
-		  > 204  </td
+		  >204</td
 		  ><td
-		  > <code
+		  ><code
 		    >No Content</code
-		    > </td
+		    ></td
 		  ><td
-		  > operation successful, no body returned   </td
+		  >operation successful, no body returned</td
 		  ></tr
 		><tr
 		><td
-		  > 404  </td
+		  >404</td
 		  ><td
-		  > <code
+		  ><code
 		    >Not Found</code
-		    >  </td
+		    ></td
 		  ><td
-		  > resource not found                       </td
+		  >resource not found</td
 		  ></tr
 		></tbody
 	      ></table
@@ -179,57 +179,57 @@
 	    ><thead
 	      ><tr
 		><th
-		  > Header row, column 1   
- (header rows optional) </th
+		  >Header row, column 1
+(header rows optional)</th
 		  ><th
-		  > Header 2   
-            </th
+		  >Header 2
+</th
 		  ><th
-		  > Header 3 
-          </th
+		  >Header 3
+</th
 		  ><th
-		  > Header 4 
-          </th
+		  >Header 4
+</th
 		  ></tr
 		></thead
 	      ><tbody
 	      ><tr
 		><td
-		  > body row 1, column 1   </td
+		  >body row 1, column 1</td
 		  ><td
-		  > column 2   </td
+		  >column 2</td
 		  ><td
-		  > column 3 </td
+		  >column 3</td
 		  ><td
-		  > column 4 </td
+		  >column 4</td
 		  ></tr
 		><tr
 		><td
-		  > <code
+		  ><code
 		    ><a href="#" title="Table"
 		      >tableWithHeader</a
 		      ></code
-		    >      </td
+		    ></td
 		  ><td colspan="3"
-		  > Cells may span columns.          </td
+		  >Cells may span columns.</td
 		  ></tr
 		><tr
 		><td
-		  > body row 3             </td
+		  >body row 3</td
 		  ><td rowspan="2"
-		  > Cells may  
- span rows. 
-            </td
+		  >Cells may
+span rows.
+</td
 		  ><td colspan="2" rowspan="2"
-		  > <span class="mathjax"
-		    >\[                  
- f(n) = \sum_{i=1}   
- \]</span
-		    >                  </td
+		  ><span class="mathjax"
+		    >\[
+f(n) = \sum_{i=1}
+\]</span
+		    ></td
 		  ></tr
 		><tr
 		><td
-		  > body row 4             </td
+		  >body row 4</td
 		  ></tr
 		></tbody
 	      ></table
-- 
GitLab