Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/markup/blockrule/PhutilRemarkupTableBlockRule.php
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | private function newTable(PhutilDOMNode $table) { | ||||
foreach ($rows as $row) { | foreach ($rows as $row) { | ||||
$cells = $row->selectChildrenWithTags(array('td', 'th')); | $cells = $row->selectChildrenWithTags(array('td', 'th')); | ||||
$cell_specs = array(); | $cell_specs = array(); | ||||
foreach ($cells as $cell) { | foreach ($cells as $cell) { | ||||
if ($cell->isContentNode()) { | if ($cell->isContentNode()) { | ||||
$content = $node->getContent(); | $content = $node->getContent(); | ||||
if (!strlen(trim($content))) { | if ($content === null || trim($content) === '') { | ||||
continue; | continue; | ||||
speck: Please simplify this | |||||
Not Done Inline ActionsAnother possibility: if ($content === null || trim($content) === '') { valerio.bozzolan: Another possibility:
```lang=php
if ($content === null || trim($content) === '') {
``` | |||||
} | } | ||||
return $table->newRawString(); | return $table->newRawString(); | ||||
} | } | ||||
// Respect newlines in table cells as literal linebreaks. | // Respect newlines in table cells as literal linebreaks. | ||||
$content = $cell->newRawContentString(); | $content = $cell->newRawContentString(); | ||||
Show All 27 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
Please simplify this