Request for a newline in a table (T5427)


I saw the following

I needed the same last week…

Its probably not the best idea but my solution was to add a {newline} remarkup extension in src/extensions


final class RemarkupNewLineRule extends PhabricatorRemarkupCustomInlineRule
  public function getPriority() {
    return 300.0;

  public function apply($text) {
        return preg_replace_callback(
        array($this, 'markupNewLine'),

  public function markupNewLine($matches) {
    $engine = $this->getEngine();
    if ($engine->isTextMode()) {
      return "\n";
    if ($engine->isHTMLMailMode()) {
      return phutil_safe_html('<br>');
    // Normal mode, return parsed text
    return $this->getEngine()->storeText(phutil_safe_html('<br>'));


Then I used this in the remarkup

This is a {newline} test

           <td>Tom {newline} and John</td>
           <td>New York and {newline} Paris</td>

And it shows like this…



Sweet, thanks for sharing! I needed this too.