diff --git a/datasette/templates/database.html b/datasette/templates/database.html
index c1e39bd155..8f0c65d7a7 100644
--- a/datasette/templates/database.html
+++ b/datasette/templates/database.html
@@ -3,7 +3,8 @@
{% block title %}{{ database }}{% endblock %}
{% block extra_head %}
-{{ super() }}
+{{- super() -}}
+
{% include "_codemirror.html" %}
{% endblock %}
diff --git a/datasette/templates/query.html b/datasette/templates/query.html
index 75f7f1b1ca..d0121976d2 100644
--- a/datasette/templates/query.html
+++ b/datasette/templates/query.html
@@ -3,7 +3,8 @@
{% block title %}{{ database }}{% if query and query.sql %}: {{ query.sql }}{% endif %}{% endblock %}
{% block extra_head %}
-{{ super() }}
+{{- super() -}}
+
{% if columns %}