diff --git a/Gemfile b/Gemfile
index 1fbc240bf6f8d2c0b792b8d5796d13c0c907d61c..00ff75ae7195125871c19b00ff9bc38a8fe164d8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -104,7 +104,7 @@ gem 'hashie-forbidden_attributes'
 gem 'kaminari', '~> 1.0'
 
 # HAML
-gem 'hamlit', '~> 2.6.1'
+gem 'hamlit', '~> 2.8.8'
 
 # Files attachments
 gem 'carrierwave', '~> 1.2'
diff --git a/Gemfile.lock b/Gemfile.lock
index a889c4dc3a0d5791f08cf00e45036217ea25ef5a..ee5da96665cd2de53862462477a3f628841be412 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -381,8 +381,8 @@ GEM
       rake (>= 10, < 13)
       rubocop (>= 0.49.0)
       sysexits (~> 1.1)
-    hamlit (2.6.1)
-      temple (~> 0.7.6)
+    hamlit (2.8.8)
+      temple (>= 0.8.0)
       thor
       tilt
     hashdiff (0.3.4)
@@ -889,7 +889,7 @@ GEM
     sys-filesystem (1.1.6)
       ffi
     sysexits (1.2.0)
-    temple (0.7.7)
+    temple (0.8.0)
     test-prof (0.2.5)
     test_after_commit (1.1.0)
       activerecord (>= 3.2)
@@ -900,7 +900,7 @@ GEM
       rack (>= 1, < 3)
     thor (0.19.4)
     thread_safe (0.3.6)
-    tilt (2.0.6)
+    tilt (2.0.8)
     timecop (0.8.1)
     timfel-krb5-auth (0.8.3)
     toml (0.1.2)
@@ -1057,7 +1057,7 @@ DEPENDENCIES
   graphql (~> 1.8.0)
   grpc (~> 1.11.0)
   haml_lint (~> 0.26.0)
-  hamlit (~> 2.6.1)
+  hamlit (~> 2.8.8)
   hashie-forbidden_attributes
   health_check (~> 2.6.0)
   hipchat (~> 1.5.0)
diff --git a/Gemfile.rails5.lock b/Gemfile.rails5.lock
index 8c46b8c5916defc30babd3f394999333137046f7..66325234e29e57e8da95738ccba35f3608275f20 100644
--- a/Gemfile.rails5.lock
+++ b/Gemfile.rails5.lock
@@ -384,8 +384,8 @@ GEM
       rake (>= 10, < 13)
       rubocop (>= 0.49.0)
       sysexits (~> 1.1)
-    hamlit (2.6.1)
-      temple (~> 0.7.6)
+    hamlit (2.8.8)
+      temple (>= 0.8.0)
       thor
       tilt
     hashdiff (0.3.4)
@@ -898,7 +898,7 @@ GEM
     sys-filesystem (1.1.6)
       ffi
     sysexits (1.2.0)
-    temple (0.7.7)
+    temple (0.8.0)
     test-prof (0.2.5)
     text (1.3.1)
     thin (1.7.0)
@@ -1067,7 +1067,7 @@ DEPENDENCIES
   graphql (~> 1.8.0)
   grpc (~> 1.11.0)
   haml_lint (~> 0.26.0)
-  hamlit (~> 2.6.1)
+  hamlit (~> 2.8.8)
   hashie-forbidden_attributes
   health_check (~> 2.6.0)
   hipchat (~> 1.5.0)
diff --git a/app/views/shared/hook_logs/_content.html.haml b/app/views/shared/hook_logs/_content.html.haml
index 532712ee6d15f9c276cd4c9f720d2e35cf14851e..f3b56df0c96428e8a736e9ccd8d0b5df6fa28b1f 100644
--- a/app/views/shared/hook_logs/_content.html.haml
+++ b/app/views/shared/hook_logs/_content.html.haml
@@ -30,7 +30,7 @@
 
 %h5 Request body:
 %pre
-  :plain
+  :escaped
     #{JSON.pretty_generate(hook_log.request_data)}
 %h5 Response headers:
 %pre
@@ -40,5 +40,5 @@
 
 %h5 Response body:
 %pre
-  :plain
+  :escaped
     #{hook_log.response_body}
diff --git a/changelogs/unreleased/upgrade-hamlit-for-ruby25.yml b/changelogs/unreleased/upgrade-hamlit-for-ruby25.yml
new file mode 100644
index 0000000000000000000000000000000000000000..39e101215071b57f41e8a02e8a6f85f8ab429559
--- /dev/null
+++ b/changelogs/unreleased/upgrade-hamlit-for-ruby25.yml
@@ -0,0 +1,5 @@
+---
+title: 'Update hamlit to fix ruby 2.5 incompatibilities, fixes #42045'
+merge_request:
+author: Matthew Dawson
+type: fixed