diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2020-09-13 23:20:26 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2020-09-13 23:23:11 +0200 |
commit | 34151e8da8e1863b7954d87c1713b97f3a944545 (patch) | |
tree | 3a946f442374d192a9a0db5df561bf07bdefbc65 /test | |
parent | 62948f35794ab2095dc934f437669dcdeb0b0ced (diff) | |
download | pandoc-34151e8da8e1863b7954d87c1713b97f3a944545.tar.gz |
HTML writer: support intermediate table headers
Closes: #6314
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Old.hs | 2 | ||||
-rw-r--r-- | test/tables/students.html4 | 55 | ||||
-rw-r--r-- | test/tables/students.html5 | 55 | ||||
-rw-r--r-- | test/tables/students.native | 37 |
4 files changed, 148 insertions, 1 deletions
diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index fc5721edb..d1d27d9a5 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -272,7 +272,7 @@ extendedWriterTests pandocPath format opts ("tables" </> name <.> "native") ("tables" </> name <.> format) - in map testForTable ["planets", "nordics"] + in map testForTable ["planets", "nordics", "students"] where opts = ["-r", "native", "-w", format, "--columns=78", "--variable", "pandoc-version="] diff --git a/test/tables/students.html4 b/test/tables/students.html4 new file mode 100644 index 000000000..b02b0aba8 --- /dev/null +++ b/test/tables/students.html4 @@ -0,0 +1,55 @@ +<table id="students" source="mdn"> +<caption><p>List of Students</p></caption> +<colgroup> +<col width="50%" /> +<col width="50%" /> +</colgroup> +<thead> +<tr class="header"> +<th align="center">Student ID</th> +<th align="center">Name</th> +</tr> +</thead> +<tbody class="souvereign-states"> +<tr class="odd"> +<th align="left" colspan="2">Computer Science</th> +</tr> + +<tr class="odd"> +<td align="left">3741255</td> +<td align="left">Jones, Martha</td> +</tr> +<tr class="even"> +<td align="left">4077830</td> +<td align="left">Pierce, Benjamin</td> +</tr> +<tr class="odd"> +<td align="left">5151701</td> +<td align="left">Kirk, James</td> +</tr> +</tbody> +<tbody> +<tr class="odd"> +<th align="left" colspan="2">Russian Literature</th> +</tr> + +<tr class="odd"> +<td align="left">3971244</td> +<td align="left">Nim, Victor</td> +</tr> +</tbody> +<tbody> +<tr class="odd"> +<th align="left" colspan="2">Astrophysics</th> +</tr> + +<tr class="odd"> +<td align="left">4100332</td> +<td align="left">Petrov, Alexandra</td> +</tr> +<tr class="even"> +<td align="left">4100332</td> +<td align="left">Toyota, Hiroko</td> +</tr> +</tbody> +</table> diff --git a/test/tables/students.html5 b/test/tables/students.html5 new file mode 100644 index 000000000..af9e088fb --- /dev/null +++ b/test/tables/students.html5 @@ -0,0 +1,55 @@ +<table id="students" data-source="mdn"> +<caption><p>List of Students</p></caption> +<colgroup> +<col style="width: 50%" /> +<col style="width: 50%" /> +</colgroup> +<thead> +<tr class="header"> +<th style="text-align: center;">Student ID</th> +<th style="text-align: center;">Name</th> +</tr> +</thead> +<tbody class="souvereign-states"> +<tr class="odd"> +<th style="text-align: left;" colspan="2">Computer Science</th> +</tr> + +<tr class="odd"> +<td style="text-align: left;">3741255</td> +<td style="text-align: left;">Jones, Martha</td> +</tr> +<tr class="even"> +<td style="text-align: left;">4077830</td> +<td style="text-align: left;">Pierce, Benjamin</td> +</tr> +<tr class="odd"> +<td style="text-align: left;">5151701</td> +<td style="text-align: left;">Kirk, James</td> +</tr> +</tbody> +<tbody> +<tr class="odd"> +<th style="text-align: left;" colspan="2">Russian Literature</th> +</tr> + +<tr class="odd"> +<td style="text-align: left;">3971244</td> +<td style="text-align: left;">Nim, Victor</td> +</tr> +</tbody> +<tbody> +<tr class="odd"> +<th style="text-align: left;" colspan="2">Astrophysics</th> +</tr> + +<tr class="odd"> +<td style="text-align: left;">4100332</td> +<td style="text-align: left;">Petrov, Alexandra</td> +</tr> +<tr class="even"> +<td style="text-align: left;">4100332</td> +<td style="text-align: left;">Toyota, Hiroko</td> +</tr> +</tbody> +</table> diff --git a/test/tables/students.native b/test/tables/students.native new file mode 100644 index 000000000..13122ede2 --- /dev/null +++ b/test/tables/students.native @@ -0,0 +1,37 @@ +[Table ("students",[],[("source","mdn")]) (Caption Nothing + [Para [Str "List", Space, Str "of", Space, Str "Students"]]) + [(AlignLeft,ColWidth 0.5) + ,(AlignLeft,ColWidth 0.5)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1) [Plain [Str "Student", Space, Str "ID"]] + ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1) [Plain [Str "Name"]]]]) + [TableBody ("",["souvereign-states"],[]) (RowHeadColumns 0) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 2) [Plain [Str "Computer", Space, Str "Science"]]]] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "3741255"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Jones,", Space, Str "Martha"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4077830"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Pierce,", Space, Str "Benjamin"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5151701"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Kirk,", Space, Str "James"]]]] + ,TableBody ("",[],[]) (RowHeadColumns 0) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 2) [Plain [Str "Russian", Space, Str "Literature"]]]] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "3971244"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Nim,", Space, Str "Victor"]]]] + ,TableBody ("",[],[]) (RowHeadColumns 0) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 2) [Plain [Str "Astrophysics"]]]] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4100332"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Petrov,", Space, Str "Alexandra"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4100332"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Toyota,", Space, Str "Hiroko"]]]]] + (TableFoot ("",[],[]) []) +] |