Textile writer: get rid of header, odd, even classes on tr.

This follows #9376.
This commit is contained in:
John MacFarlane
2024-06-07 14:22:17 -07:00
parent b4b0a6d61b
commit a0ba712b70
2 changed files with 17 additions and 21 deletions
+1 -5
View File
@@ -337,14 +337,10 @@ tableRowToTextile :: PandocMonad m
-> TW m Text
tableRowToTextile opts alignStrings rownum cols' = do
let celltype = if rownum == 0 then "th" else "td"
let rowclass = case rownum of
0 -> "header"
x | x `rem` 2 == 1 -> "odd"
_ -> "even"
cols'' <- zipWithM
(\alignment item -> tableItemToTextile opts celltype alignment item)
alignStrings cols'
return $ "<tr class=\"" <> rowclass <> "\">\n" <> T.unlines cols'' <> "</tr>"
return $ "<tr>\n" <> T.unlines cols'' <> "</tr>"
alignmentToText :: Alignment -> Text
alignmentToText alignment = case alignment of
+16 -16
View File
@@ -3,7 +3,7 @@ Simple table with caption:
<table>
<caption>Demonstration of simple table syntax.</caption>
<thead>
<tr class="header">
<tr>
<th align="right">Right</th>
<th align="left">Left</th>
<th align="center">Center</th>
@@ -11,19 +11,19 @@ Simple table with caption:
</tr>
</thead>
<tbody>
<tr class="odd">
<tr>
<td align="right">12</td>
<td align="left">12</td>
<td align="center">12</td>
<td align="left">12</td>
</tr>
<tr class="even">
<tr>
<td align="right">123</td>
<td align="left">123</td>
<td align="center">123</td>
<td align="left">123</td>
</tr>
<tr class="odd">
<tr>
<td align="right">1</td>
<td align="left">1</td>
<td align="center">1</td>
@@ -44,7 +44,7 @@ Simple table indented two spaces:
<table>
<caption>Demonstration of simple table syntax.</caption>
<thead>
<tr class="header">
<tr>
<th align="right">Right</th>
<th align="left">Left</th>
<th align="center">Center</th>
@@ -52,19 +52,19 @@ Simple table indented two spaces:
</tr>
</thead>
<tbody>
<tr class="odd">
<tr>
<td align="right">12</td>
<td align="left">12</td>
<td align="center">12</td>
<td align="left">12</td>
</tr>
<tr class="even">
<tr>
<td align="right">123</td>
<td align="left">123</td>
<td align="center">123</td>
<td align="left">123</td>
</tr>
<tr class="odd">
<tr>
<td align="right">1</td>
<td align="left">1</td>
<td align="center">1</td>
@@ -82,7 +82,7 @@ Multiline table with caption:
<col width="16%" />
<col width="35%" />
<thead>
<tr class="header">
<tr>
<th align="center">Centered Header</th>
<th align="left">Left Aligned</th>
<th align="right">Right Aligned</th>
@@ -90,13 +90,13 @@ Multiline table with caption:
</tr>
</thead>
<tbody>
<tr class="odd">
<tr>
<td align="center">First</td>
<td align="left">row</td>
<td align="right">12.0</td>
<td align="left">Example of a row that spans multiple lines.</td>
</tr>
<tr class="even">
<tr>
<td align="center">Second</td>
<td align="left">row</td>
<td align="right">5.0</td>
@@ -113,7 +113,7 @@ Multiline table without caption:
<col width="16%" />
<col width="35%" />
<thead>
<tr class="header">
<tr>
<th align="center">Centered Header</th>
<th align="left">Left Aligned</th>
<th align="right">Right Aligned</th>
@@ -121,13 +121,13 @@ Multiline table without caption:
</tr>
</thead>
<tbody>
<tr class="odd">
<tr>
<td align="center">First</td>
<td align="left">row</td>
<td align="right">12.0</td>
<td align="left">Example of a row that spans multiple lines.</td>
</tr>
<tr class="even">
<tr>
<td align="center">Second</td>
<td align="left">row</td>
<td align="right">5.0</td>
@@ -150,13 +150,13 @@ Multiline table without column headers:
<col width="16%" />
<col width="35%" />
<tbody>
<tr class="odd">
<tr>
<td align="center">First</td>
<td align="left">row</td>
<td align="right">12.0</td>
<td align="left">Example of a row that spans multiple lines.</td>
</tr>
<tr class="even">
<tr>
<td align="center">Second</td>
<td align="left">row</td>
<td align="right">5.0</td>