@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<?php
2
3final class PhutilRemarkupQuotesBlockRule
4 extends PhutilRemarkupQuotedBlockRule {
5
6 public function getMatchingLineCount(array $lines, $cursor) {
7 $pos = $cursor;
8
9 if (preg_match('/^>/', $lines[$pos])) {
10 do {
11 ++$pos;
12 } while (isset($lines[$pos]) && preg_match('/^>/', $lines[$pos]));
13 }
14
15 return ($pos - $cursor);
16 }
17
18 public function extractChildText($text) {
19 return array('', $this->normalizeQuotedBody($text));
20 }
21
22 public function markupText($text, $children) {
23 if ($this->getEngine()->isTextMode()) {
24 return $this->getQuotedText($children);
25 }
26
27 $attributes = array();
28 if ($this->getEngine()->isHTMLMailMode()) {
29 $style = array(
30 'border-left: 3px solid #a7b5bf;',
31 'color: #464c5c;',
32 'font-style: italic;',
33 'margin: 4px 0 12px 0;',
34 'padding: 4px 12px;',
35 'background-color: #f8f9fc;',
36 );
37
38 $attributes['style'] = implode(' ', $style);
39 }
40
41 return phutil_tag(
42 'blockquote',
43 $attributes,
44 $children);
45 }
46
47}