diff --git a/diff.routing.yml b/diff.routing.yml
index c858606..1ba1cff 100644
--- a/diff.routing.yml
+++ b/diff.routing.yml
@@ -1,9 +1,8 @@
 diff.revisions_diff:
-  path: '/node/{node}/revisions/view/{left_revision}/{right_revision}/{filter}'
+  path: '/node/{node}/revisions/view/{left_revision}/{right_revision}'
   defaults:
     _controller: '\Drupal\diff\Controller\NodeRevisionController::compareNodeRevisions'
     _title: Diff General Settings
-    filter: 'raw'
   requirements:
     _access_node_revision: 'view'
   options:
diff --git a/src/Controller/GenericRevisionController.php b/src/Controller/GenericRevisionController.php
index e8052a6..21b8d79 100644
--- a/src/Controller/GenericRevisionController.php
+++ b/src/Controller/GenericRevisionController.php
@@ -3,6 +3,7 @@
 namespace Drupal\diff\Controller;
 
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\RequestStack;
 use Drupal\Core\Controller\ControllerBase;
 use Drupal\Core\Datetime\DateFormatter;
 use Drupal\Component\Render\FormattableMarkup;
@@ -42,18 +43,26 @@ class GenericRevisionController extends ControllerBase {
   protected $entityComparison;
 
   /**
+   * The request stack object.
+   */
+  protected $requestStack;
+
+  /**
    * Constructs a GenericRevisionController object.
    *
    * @param DateFormatter $date
    *   DateFormatter service.
    * @param DiffEntityComparison $entityComparison
    *   DiffEntityComparison service.
+   * @param RequestStack $request_stack
+  +   *   The request stack.
    */
-  public function __construct(DateFormatter $date, DiffEntityComparison $entityComparison) {
+  public function __construct(DateFormatter $date, DiffEntityComparison $entityComparison, RequestStack $request_stack) {
     $this->date = $date;
     $this->config = $this->config('diff.settings');
     $this->nonBreakingSpace = new FormattableMarkup('&nbsp;', array());
     $this->entityComparison = $entityComparison;
+    $this->requestStack = $request_stack;
   }
 
   /**
@@ -62,7 +71,8 @@ class GenericRevisionController extends ControllerBase {
   public static function create(ContainerInterface $container) {
     return new static(
         $container->get('date.formatter'),
-        $container->get('diff.entity_comparison')
+        $container->get('diff.entity_comparison'),
+        $container->get('request_stack')
     );
   }
 
@@ -95,26 +105,19 @@ class GenericRevisionController extends ControllerBase {
    *   The left revision.
    * @param \Drupal\Core\Entity\EntityInterface $right_revision
    *   The right revision.
-   * @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 entity revisions.
    */
-  public function compareEntityRevisions(RouteMatchInterface $route_match, EntityInterface $left_revision, EntityInterface $right_revision, $filter) {
+  public function compareEntityRevisions(RouteMatchInterface $route_match, EntityInterface $left_revision, EntityInterface $right_revision) {
     $entity_type_id = $left_revision->getEntityTypeId();
     $entity = $route_match->getParameter($entity_type_id);
     $diff_rows = array();
     $build = array(
       '#title' => $this->t('Changes to %title', ['%title' => $entity->label()]),
     );
-    if (!in_array($filter, array('raw', 'raw-plain'))) {
-      $filter = 'raw';
-    }
-    elseif ($filter == 'raw-plain') {
-      $filter = 'raw_plain';
-    }
+    $filter = $this->requestStack->getCurrentRequest()->query->get('filter');
+    $filter = ($filter == 'raw-plain') ? 'raw_plain' : 'raw';
 
     $entity_type_id = $entity->getEntityTypeId();
     $storage = $this->entityTypeManager()->getStorage($entity_type_id);
diff --git a/src/Controller/NodeRevisionController.php b/src/Controller/NodeRevisionController.php
index 9e04643..b86cfba 100644
--- a/src/Controller/NodeRevisionController.php
+++ b/src/Controller/NodeRevisionController.php
@@ -37,21 +37,17 @@ class NodeRevisionController extends GenericRevisionController {
    *   Vid of the node revision from the left.
    * @param $right_revision
    *   Vid of the node revision from the right.
-   * @param $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) {
+  public function compareNodeRevisions(NodeInterface $node, $left_revision, $right_revision) {
     $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);
+    $build = $this->compareEntityRevisions($route_match, $left_revision, $right_revision);
     return $build;
   }
 
-
 }
