Commit 2327578a authored by epriestley's avatar epriestley
Browse files

Respect linebreaks in full HTML tables in Remarkup

Fixes T5427. See PHI1630. See also T13160 and D20568.

In the full HTML table syntax with "<table>", respect linebreaks as literals inside "<td>" cells.

Test Plan: Previewed some full-HTML tables with and without linebreaks, saw what seemed like sensible rendering behavior.

Maniphest Tasks: T5427

Differential Revision:
parent 9d1af762
......@@ -121,8 +121,19 @@ final class PhutilRemarkupTableBlockRule extends PhutilRemarkupBlockRule {
return $table->newRawString();
// Respect newlines in table cells as literal linebreaks.
$content = $cell->newRawContentString();
$content = $this->applyRules($content);
$content = trim($content, "\r\n");
$lines = phutil_split_lines($content, $retain_endings = false);
foreach ($lines as $key => $line) {
$lines[$key] = $this->applyRules($line);
$content = phutil_implode_html(
$cell_specs[] = array(
'type' => $cell->getTagName(),
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment