@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix two rendering issues with Jupyter notebooks

Summary:
See PHI1752.

- Early exit of document layout can cause us to fail to populate available rows.
- Some Jupyter documents have "markdown" cells with plain strings, apparently.

Test Plan: Successfully rendered example diff from PHI1752.

Differential Revision: https://secure.phabricator.com/D21285

+15 -5
+1
src/applications/files/diff/PhabricatorDocumentEngineBlocks.php
··· 61 61 $lists = $this->lists; 62 62 63 63 if (count($lists) != 2) { 64 + $this->layoutAvailableRowCount = 0; 64 65 return array(); 65 66 } 66 67
+14 -5
src/applications/files/document/PhabricatorJupyterDocumentEngine.php
··· 63 63 $blocks->addBlockList($uref, $u_blocks); 64 64 $blocks->addBlockList($vref, $v_blocks); 65 65 } catch (Exception $ex) { 66 + phlog($ex); 66 67 $blocks->addMessage($ex->getMessage()); 67 68 } 68 69 ··· 85 86 switch ($utype) { 86 87 case 'markdown': 87 88 $usource = idx($ucell, 'source'); 88 - $usource = implode('', $usource); 89 + if (is_array($usource)) { 90 + $usource = implode('', $usource); 91 + } 89 92 90 93 $vsource = idx($vcell, 'source'); 91 - $vsource = implode('', $vsource); 94 + if (is_array($vsource)) { 95 + $vsource = implode('', $vsource); 96 + } 92 97 93 98 $diff = id(new PhutilProseDifferenceEngine()) 94 99 ->getDiff($usource, $vsource); ··· 254 259 $hash_input = $cell['raw']; 255 260 break; 256 261 case 'markdown': 257 - $hash_input = implode('', $cell['source']); 262 + $hash_input = $cell['source']; 263 + if (is_array($hash_input)) { 264 + $hash_input = implode('', $cell['source']); 265 + } 258 266 break; 259 267 default: 260 268 $hash_input = serialize($cell); ··· 367 375 $results = array(); 368 376 foreach ($cells as $cell) { 369 377 $cell_type = idx($cell, 'cell_type'); 370 - 371 378 if ($cell_type === 'markdown') { 372 379 $source = $cell['source']; 373 - $source = implode('', $source); 380 + if (is_array($source)) { 381 + $source = implode('', $source); 382 + } 374 383 375 384 // Attempt to split contiguous blocks of markdown into smaller 376 385 // pieces.