Page MenuHomePhabricator

Remarkup is rendered literally in Diviner
Open, LowPublic

Description

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

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Remarkup.
joshuaspence added a subscriber: joshuaspence.
joshuaspence added a subscriber: terrismotox.

I'm assuming that @terrismotox is just playing around.

("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.

epriestley removed a subscriber: terrismotox.

To move forward, we should split this into two tasks:

  • One for getBodyForFeed(), which is straightforward and can be implemented today.
  • One for Diviner, which is unrelated and probably has a solution involving product changes (don't show the summaries, or paginate differently, or something) rather than a purely technical one.

So how do I fix this in Phame, Pholio, Ponder. I can't find a positive example.

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.

chad renamed this task from Remarkup is rendered literally in summaries to Remarkup is rendered literally in Diviner.Dec 5 2015, 10:47 PM
chad updated the task description. (Show Details)