Page MenuHomePhabricator

D18751.id45011.diff
No OneTemporary

D18751.id45011.diff

diff --git a/src/markup/engine/__tests__/remarkup/table-with-long-header.txt b/src/markup/engine/__tests__/remarkup/table-with-long-header.txt
new file mode 100644
--- /dev/null
+++ b/src/markup/engine/__tests__/remarkup/table-with-long-header.txt
@@ -0,0 +1,8 @@
+|x|
+||--
+~~~~~~~~~~
+<div class="remarkup-table-wrap"><table class="remarkup-table">
+<tr><td>x</td></tr>
+</table></div>
+~~~~~~~~~~
+| x |
diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupSimpleTableBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupSimpleTableBlockRule.php
--- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupSimpleTableBlockRule.php
+++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupSimpleTableBlockRule.php
@@ -73,7 +73,14 @@
// Mark previous row with headings.
foreach ($cells as $i => $cell) {
if ($cell['content']) {
- $rows[last_key($rows)]['content'][$i]['type'] = 'th';
+ $last_key = last_key($rows);
+ if (!isset($rows[$last_key]['content'][$i])) {
+ // If this row has more cells than the previous row, there may
+ // not be a cell above this one to turn into a <th />.
+ continue;
+ }
+
+ $rows[$last_key]['content'][$i]['type'] = 'th';
}
}
}

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 15, 11:55 PM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6714979
Default Alt Text
D18751.id45011.diff (1 KB)

Event Timeline