From bae107df0f88496fd9bd2c8da89f334c5652171b Mon Sep 17 00:00:00 2001 From: Sam <1631095+takuy@users.noreply.github.com> Date: Wed, 25 Nov 2020 22:48:11 -0500 Subject: [PATCH] colspanned columns should inherit tag Colspanned columns need to inherit the tag of the original column. Otherwise, in a header row, this leaves you with a bunch of `th` tags separated by `tds` tags (since the default is to treat an empty tag as `td` per https://github.com/cosmocode/edittable/blob/09298eaff7a6ebcb9892511587fac055380c5653/action/editor.php#L222) When the array is parsed by build_table, this means the table is actually malformed per DokuWiki syntax and what should be a `^` ends up being a `|`; this later generates bad or unexpected HTML - `th` elements end up in `tbody` instead of `thead`. --- renderer/json.php | 1 + 1 file changed, 1 insertion(+) diff --git a/renderer/json.php b/renderer/json.php index 19de5e4..2a759cb 100644 --- a/renderer/json.php +++ b/renderer/json.php @@ -127,6 +127,7 @@ private function _tablefield_close() { for($c = 1; $c < $colspan; $c++) { // hide colspanned cell in same row + $this->tmeta[$row][$col + $c]['tag'] = $this->tmeta[$row][$col]['tag']; $this->tmeta[$row][$col + $c]['hide'] = true; $this->tmeta[$row][$col + $c]['rowspan'] = 1; $this->tmeta[$row][$col + $c]['colspan'] = 1;