formBuilder()->getForm('Drupal\diff\Form\RevisionOverviewForm', $node); } /** * Returns a table which shows the differences between two node revisions. * * @param \Drupal\node\NodeInterface $node * The node whose revisions are compared. * @param int $left_revision * Vid of the node revision from the left. * @param int $right_revision * Vid of the node revision from the right. * @param string $filter * If $filter == 'raw' raw text is compared (including html tags) * If $filter == 'raw-plain' markdown function is applied to the text before comparison. * * @return array * Table showing the diff between the two node revisions. */ public function compareNodeRevisions(NodeInterface $node, $left_revision, $right_revision, $filter) { $storage = $this->entityTypeManager()->getStorage('node'); $route_match = \Drupal::routeMatch(); $left_revision = $storage->loadRevision($left_revision); $right_revision = $storage->loadRevision($right_revision); $build = $this->compareEntityRevisions($route_match, $left_revision, $right_revision, $filter); return $build; } }