private Function<Html, Option<Html>> renderContent(final StreamsEntry entry, final boolean truncate)
{
return c -> {
Html description = truncate ? truncate(SUMMARY_LIMIT, c) : c;
if (truncate && c.equals(description))
{
return none();
}
Map<String, Object> context = ImmutableMap.<String, Object>builder().
put("contentHtml", description).
put("truncated", truncate).
put("isComment", isComment(entity)).
put("contentUri", entry.getAlternateLink()).
build();
return some(new Html(render(templateRenderer, "confluence-content-block.vm", context)));
};
}
};