@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.

Convert phutil_render_tag() to phutil_tag() for inline comments

Test Plan:
Looked at file with lint errors in Diffusion.

I've also tried inline comments in Differential but it failed.
I'll try it again after you land all your diffs.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2432

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

vrana 6e959011 de026135

+37 -36
+10 -7
src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
··· 324 324 } 325 325 } 326 326 } 327 - $html[] = 327 + $html[] = hsprintf( 328 328 '<tr class="inline">'. 329 329 '<th />'. 330 - '<td class="left">'.$comment_html.'</td>'. 330 + '<td class="left">%s</td>'. 331 331 '<th />'. 332 - '<td colspan="3" class="right3">'.$new.'</td>'. 333 - '</tr>'; 332 + '<td colspan="3" class="right3">%s</td>'. 333 + '</tr>', 334 + $comment_html, 335 + $new); 334 336 } 335 337 } 336 338 if ($n_num && isset($new_comments[$n_num])) { 337 339 foreach ($new_comments[$n_num] as $comment) { 338 340 $comment_html = $this->renderInlineComment($comment, 339 341 $on_right = true); 340 - $html[] = 342 + $html[] = hsprintf( 341 343 '<tr class="inline">'. 342 344 '<th />'. 343 345 '<td class="left" />'. 344 346 '<th />'. 345 - '<td colspan="3" class="right3">'.$comment_html.'</td>'. 346 - '</tr>'; 347 + '<td colspan="3" class="right3">%s</td>'. 348 + '</tr>', 349 + $comment_html); 347 350 } 348 351 } 349 352 }
+22 -19
src/applications/differential/view/DifferentialInlineCommentView.php
··· 175 175 } 176 176 177 177 if ($links) { 178 - $links = 179 - '<span class="differential-inline-comment-links">'. 180 - implode(' &middot; ', $links). 181 - '</span>'; 178 + $links = phutil_tag( 179 + 'span', 180 + array('class' => 'differential-inline-comment-links'), 181 + array_interleave(" \xC2\xB7 ", $links)); 182 182 } else { 183 183 $links = null; 184 184 } ··· 217 217 $author = $handles[$inline->getAuthorPHID()]->getName(); 218 218 } 219 219 220 - $markup = javelin_render_tag( 220 + $markup = javelin_tag( 221 221 'div', 222 222 array( 223 223 'class' => $classes, 224 224 'sigil' => $sigil, 225 225 'meta' => $metadata, 226 226 ), 227 - '<div class="differential-inline-comment-head">'. 228 - $anchor. 229 - $links. 230 - ' <span class="differential-inline-comment-line">'.$line.'</span> '. 231 - phutil_escape_html($author). 232 - '</div>'. 233 - '<div class="differential-inline-comment-content">'. 234 - '<div class="phabricator-remarkup">'. 235 - $content. 227 + hsprintf( 228 + '<div class="differential-inline-comment-head">'. 229 + '%s%s <span class="differential-inline-comment-line">%s</span> %s'. 236 230 '</div>'. 237 - '</div>'); 231 + '<div class="differential-inline-comment-content">'. 232 + '<div class="phabricator-remarkup">%s</div>'. 233 + '</div>', 234 + $anchor, 235 + $links, 236 + $line, 237 + $author, 238 + $content)); 238 239 239 240 return $this->scaffoldMarkup($markup); 240 241 } ··· 247 248 $left_markup = !$this->onRight ? $markup : ''; 248 249 $right_markup = $this->onRight ? $markup : ''; 249 250 250 - return 251 + return hsprintf( 251 252 '<table>'. 252 253 '<tr class="inline">'. 253 254 '<th></th>'. 254 - '<td class="left">'.$left_markup.'</td>'. 255 + '<td class="left">%s</td>'. 255 256 '<th></th>'. 256 - '<td class="right3" colspan="3">'.$right_markup.'</td>'. 257 + '<td class="right3" colspan="3">%s</td>'. 257 258 '</tr>'. 258 - '</table>'; 259 + '</table>', 260 + $left_markup, 261 + $right_markup); 259 262 } 260 263 261 264 }
+5 -10
src/applications/diffusion/controller/DiffusionBrowseFileController.php
··· 264 264 )); 265 265 } 266 266 267 - $corpus_table = javelin_render_tag( 267 + $corpus_table = javelin_tag( 268 268 'table', 269 269 array( 270 270 'class' => "diffusion-source remarkup-code PhabricatorMonospaced", 271 271 'sigil' => 'diffusion-source', 272 272 ), 273 - implode("\n", $rows)); 274 - 275 - // TODO: [HTML] Major cheating here. 276 - $corpus_table = phutil_safe_html($corpus_table); 273 + $rows); 277 274 278 275 $corpus = phutil_tag( 279 276 'div', ··· 774 771 ->setMarkupEngine($engine) 775 772 ->setInlineComment($inline) 776 773 ->render(); 777 - $rows[] = 778 - '<tr class="inline">'. 779 - str_repeat('<th></th>', ($needs_blame ? 5 : 1)). 780 - '<td>'.$inline_view.'</td>'. 781 - '</tr>'; 774 + $row = array_fill(0, ($needs_blame ? 5 : 1), phutil_tag('th')); 775 + $row[] = phutil_tag('td', array(), $inline_view); 776 + $rows[] = phutil_tag('tr', array('class' => 'inline'), $row); 782 777 } 783 778 return $rows; 784 779 }