Remarkup text is rendered literally in summaries. Instead, maybe we should render remarkup in some sort of plain-text mode.
I've observed this in Diviner
joshuaspence | |
Nov 21 2015, 9:46 PM |
F987785: Screenshot_20151122-083908.png | |
Nov 21 2015, 9:46 PM |
F987788: Screenshot_20151122-084131.png | |
Nov 21 2015, 9:46 PM |
Remarkup text is rendered literally in summaries. Instead, maybe we should render remarkup in some sort of plain-text mode.
I've observed this in Diviner
("No time specified" in Phame is a bit odd too, but I think that's been fixed already)
These cases aren't closely related.
The calling code expects PhabricatorTransaction->getBodyForFeed() to return a rendered HTML body, but many applications (Phame, Pholio, Ponder) return raw remarkup instead.
Phame, at least, also summarizes inconsistently -- it uses PhutilUTF8StringTruncator, while comments use PhabricatorMarkupEngine::summarize().
We should probably provide a getRemarkupBodyForFeed() or similar instead, and have getBodyForFeed() call this by default (as it already extracts comment bodies) and handle summarization itself, then convert applications to use the new method.
I explicitly didn't markup Diviner since I think this page will take like 6 minutes to render if we markup all the snippets and I didn't want to deal with finding a solution when I wrote it. I still don't have a particularly good solution. My concern about the rendering time may be unwarranted.
To move forward, we should split this into two tasks:
There isn't really one, all the applications that do it right are doing comments, and you can't do the same thing they're doing very easily. Audit does something but it's a mess. It should really just get restructured, I think.
You might be able to just return new PHUIRemarkupView(...) and get away with it. That'll be a bit inefficient but that's probably fine for now.